uapis.cn 为例,含 109 个免费工具),您通过 AI 网关将其代理暴露给内部 Agent 调用。网关负责鉴权、流量管控,后端工具透明透传。参数 | 填写说明 |
MCP 服务名称 | uapis-tools |
服务展示名称 | UAPI 公共工具集 |
服务类型 | 标准 MCP 服务 |
请求协议 | Streamable HTTP(默认) |
描述 | 公共 MCP 工具集(含 109 个工具:JSON 格式化、时间戳转换、每日单词、IP 查询等) |
参数 | 填写说明 |
后端类型 | 域名/IP |
服务协议 | HTTPS |
服务地址 | uapis.cn |
服务端口 | 443 |
服务路径 | /mcp |
超时时间 | 60000 毫秒(默认) |
重试次数 | 5(默认) |
模式 | 适用场景 | 后端鉴权配置 |
Visitor 模式(快速体验,可直接跳过步骤二) | 临时演示、快速验证 | 不填任何鉴权信息,网关侧消费者 Key 鉴权即可,不向下透传 |
API Key 模式(验证完整鉴权链路) | 需要验证后端 Key > 网关 > 消费者三级鉴权 | 添加请求头 Authorization: Bearer <你的 uapis.cn API Key> |
参数 | 填写说明 |
密钥名称 | test |
密钥凭证类型 | API Key |
生成方式 | 自定义 |
凭证内容 | sk-5db73b83d1086f93dff72203312fae(仅作为测试使用) |
参数 | 填写说明 |
消费者名称 | test |
所属消费者组 | test-group |
选择密钥 | test |
http://<网关IP>/mcpservers/uapis-tools/mcp
# 获取工具列表curl -s -X POST https://uapis.cn/mcp \\-H "Content-Type: application/json" \\-d '{"jsonrpc":"2.0","method":"tools/list","id":1}' \\| python3 -c "import sys,json;d=json.load(sys.stdin);print(f'工具数: {len(d[\\"result\\"][\\"tools\\"])}')"# 预期输出: 工具数
curl -X POST http://<网关IP>/mcpservers/uapis-tools/mcp \\-H "Content-Type: application/json" \\-H "Authorization: Bearer <API_KEY>" \\-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
{"jsonrpc": "2.0","id": 1,"result": {"tools": [{"name": "post_convert_json", "description": "JSON格式化工具..."},{"name": "get_convert_unixtime", "description": "Unix时间戳转换..."},{"name": "get_daily_news_image", "description": "每日新闻图片..."},{"name": "get_daily_word", "description": "每日英语单词..."},{"name": "get_dictionary_lookup", "description": "词典查询..."}...]}}
curl -X POST http://<网关IP>/mcpservers/uapis-tools/mcp \\-H "Content-Type: application/json" \\-H "Authorization: Bearer <API_KEY>" \\-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_daily_word","arguments":{}},"id":2}'
{"jsonrpc": "2.0","id": 2,"result": {"content": [{"type": "text","text": "{\\"date\\":\\"2026-08-10\\",\\"words\\":[{\\"word\\":\\"initiative\\",\\"translation\\":\\"n. 主动行动, 首创精神, 主动权\\",\\"definition\\":\\"n readiness to embark on bold new ventures\\",\\"examples\\":[{\\"text\\":\\"Local businesses are teaming up for a charity initiative.\\",\\"translation\\":\\"当地企业正在联手举办一项慈善活动。\\"}]}]}"}]}}
文档反馈