如何为mcp设置代理?

我的iflow不需要代理,但是mcp sse需要代理怎么办呢

例如

  "mcpServers": {
    "docs-langchain": {
      "url": "https://docs.langchain.com/mcp"
    }
  }

这个地址需要代理才能访问 https://docs.langchain.com/mcp

经过测试,该地址好像不需要代理就可以访问
但是iflow中,mcp一直都是已停止,重启也链接不上

这是url的响应

{
  "server": {
    "name": "Docs by LangChain",
    "version": "1.0.0",
    "transport": "http"
  },
  "capabilities": {
    "tools": {
      "SearchDocsByLangChain": {
        "name": "SearchDocsByLangChain",
        "description": "Search across the Docs by LangChain knowledge base to find relevant information, code examples, API references, and guides. Use this tool when you need to answer questions about Docs by LangChain, find specific documentation, understand how features work, or locate implementation details. The search returns contextual content with titles and direct links to the documentation pages.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "query": {
              "type": "string",
              "description": "A query to search the content with."
            }
          },
          "required": [
            "query"
          ]
        },
        "operationId": "MintlifyDefaultSearch"
      }
    },
    "resources": [],
    "prompts": []
  }
}

是不是我配置错了,还是iflow不支持?

目前还是不行的,我们收集反馈评估一下

1 个赞

可以帮我测试一下,这个mcp为什么不能使用吗,已经排除不是代理的问题了,不用代理应该都可以正常使用的

  "mcpServers": {
    "docs-langchain": {
      "url": "https://docs.langchain.com/mcp"
    }
  }

可以先让iflow帮你看看,我这边显示是访问被拒了 :joy:

好的

基本弄明白问题原因了

是mcp servce Transport 的问题,可以说一下iflow支持的mcp service的Transport类型吗,

是不是只支持 stdio与sse

是不是不支持 http与 streamable-http 类型

望解答!!!

claude code的支持是最全的,基本都支持

支持的

OK,可能是mcp的transport有问题

关于claude code 的 mcp add --transport http mcpname mcpurl

这种mcp好像iflow不能兼容,例如docs-langchain的mcp

https://docs.langchain.com/mcp

可以帮测试一下吗

https://docs.langchain.com/mcp

使用 npx @modelcontextprotocol/inspector 工具查看是 streamable-http 协议

iflow 支持 streamable-http 的话,在settings.json中应该如何配置

如果不支持的话目前的解决方案是采用mcp-proxy

用于将sse或者 streamable-http 协议代理转换为stdio

例如

streamable-http 协议的 https://docs.langchain.com/mcp

转换后配置如下

"docs-langchain": {
    "command": "mcp-proxy",
    "args": [
        "--transport",
        "streamablehttp",
        "https://docs.langchain.com/mcp"
    ],
}

完美对接iflow