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 指令。