6
在后台的/user2接口中添加如下MCP配置。
server:
name: "random-user-server"
tools:
- description: "Get random user information"
name: "get-user"
requestTemplate:
method: "GET"
url: "/api/"
responseTemplate:
body: |-
# User Information
{{- with (index .results 0) }}
- **Name**: {{.name.first}} {{.name.last}}
- **Email**: {{.email}}
- **Location**: {{.location.city}}, {{.location.country}}
- **Phone**: {{.phone}}
{{- end }}
之后使用MCP Inspector加载该user2地址,发现MCP配置没有生效,反而直接将请求转发至后端Server中了。
环境Higress 版本: v2.1.0 all-in-one, Higress配置中添加了/user前缀为MCP Server