MCP 服务器
MCP 服务器设置指南
让任意 MCP 客户端实时访问 UnoRouter:搜索模型目录、查看价格、与任意模型对话。
概览
unorouter-mcp 是一个 npm 包,以 stdio 方式运行 MCP 服务器,在 MCP 注册表中的名称是 com.unorouter/mcp。它提供三个工具:search_models 过滤实时目录并支持 free_only 选项,get_pricing 返回每 100 万 tokens 的美元标价,chat 把提示词发送给任意模型。源码:github.com/0-don/unorouter-mcp。
快速配置
把这些粘贴到客户端。已登录时会自动填入你的密钥。
text
基础 URL: https://api.unorouter.com/v1
API 密钥: YOUR_API_KEY兼容性
Chat Completions
逐步设置
- 1获取 API 密钥
在 unorouter.com/token 创建密钥。服务器读取 UNOROUTER_API_KEY。UNOROUTER_BASE_URL 是可选的端点覆盖项。
bashUNOROUTER_API_KEY=YOUR_API_KEY UNOROUTER_BASE_URL=https://api.unorouter.com/v1 - 2把服务器添加到 Claude Desktop
把这段配置加入 Claude Desktop 的配置文件。npx 会在首次运行时获取 unorouter-mcp,无需事先安装。
json{ "mcpServers": { "unorouter": { "command": "npx", "args": ["-y", "unorouter-mcp"], "env": { "UNOROUTER_API_KEY": "YOUR_API_KEY" } } } } - 3或在 Claude Code 中注册
一条命令即可携带密钥注册服务器。
bashclaude mcp add unorouter -e UNOROUTER_API_KEY=YOUR_API_KEY -- npx -y unorouter-mcp - 4使用这些工具
让你的客户端去查找模型、比较价格或发送提示词。它会按需调用 search_models、get_pricing 和 chat。任何支持 stdio 的 MCP 客户端都可以。
textsearch_models filter the live catalog (free_only option) get_pricing USD list prices per 1M tokens chat send a prompt to any model
推荐模型
在这里可用的免费模型。把任意模型 id 粘贴到客户端即可。
ox-alpha:freeglm-5.3-search:freeglm-5.3-think-search:freeglm-5.3-thinking:freeglm-5.3:free
注意事项
- 带 :free 后缀的模型不收费,每个模型约限每分钟 1 次请求。
- UNOROUTER_API_KEY 是必填项。仅当要指向其他端点时才设置 UNOROUTER_BASE_URL。
- 支持注册表的 MCP 客户端可以用注册表名称 com.unorouter/mcp 安装,而不必使用 npx 命令。