MCP服务器中RequestTemplate中的URL不生效问题 #2841
Unanswered
521daichen
asked this question in
Q&A
Replies: 1 comment 11 replies
-
|
配置的URL只影响请求的header数据,不会改变目标服务。 The configured URL only affects the requested header data and will not change the target service. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
1、新建MCP服务器,绑定后端服务。服务配置的地址是 http://127.0.0.1:8080/
2、新增Tool,并配置对应的URL,如下:http://127.0.0.1:8121/
server:
description: "qdmcp-openapi"
name: "qdmcp-openapi"
tools:
args:
name: "envMcpHost"
required: true
type: "string"
name: "userId"
required: true
type: "string"
description: "获取产品信息(安全透传)"
name: "get-product-securely"
requestTemplate:
headers:
value: "{{.args.envMcpHost}}"
method: "GET"
url: "http://127.0.0.1:8121/mcp-server-api/{{.args.envMcpHost}}"
问题是:当我在requestTemplate中配置了完整的url时,转发依然转发到了 后端服务对应的 http://127.0.0.1:8080/。
我期望是能转发到http://127.0.0.1:8121/。
场景:当mcp被请求时需要进一步路由到不同的http-server 以实现多环境路由。如果要实现这样的场景,要如何配置
Beta Was this translation helpful? Give feedback.
All reactions