whichmodel-mcp
whichmodel-mcp
一个面向自主智能体的模型路由顾问——通过 MCP 获取成本优化的 LLM 推荐。
whichmodel.dev 追踪 100 多种 LLM 模型的定价和能力,每 4 小时更新一次。此 MCP 服务器公开了这些数据,以便 AI 智能体能够为每项任务选择性价比最高的模型。
MCP 端点
https://whichmodel.dev/mcp传输方式: Streamable HTTP (MCP 规范 2025-03-26)
Related MCP server: ToolRoute
快速开始
添加到您的 MCP 客户端配置中:
{
"mcpServers": {
"whichmodel": {
"url": "https://whichmodel.dev/mcp"
}
}
}无需 API 密钥。无需安装。
Stdio (本地客户端)
对于使用 stdio 传输的 MCP 客户端(Claude Desktop, Cursor 等):
{
"mcpServers": {
"whichmodel": {
"command": "npx",
"args": ["-y", "whichmodel-mcp"]
}
}
}这将运行一个轻量级本地代理,将请求转发到远程服务器。
工具
recommend_model
针对特定任务类型、复杂度和预算获取成本优化的模型推荐。
参数 | 类型 | 描述 | ||
| 枚举 (必填) |
| ||
|
|
|
| 任务复杂度 (默认: |
| 数字 | 预期的输入大小(以 token 为单位) | ||
| 数字 | 预期的输出大小(以 token 为单位) | ||
| 数字 | 每次调用的最高预算(美元) | ||
| 对象 | 能力需求: |
返回:推荐模型、替代方案、预算选项、成本估算及理由。
compare_models
对 2–5 个模型进行直接对比,并提供可选的用量成本预测。
参数 | 类型 | 描述 |
| 字符串数组 (必填) | 模型 ID,例如 |
| 枚举 | 对比的上下文 |
| 对象 | 用于每日/每月成本预测的 |
返回:定价、能力、质量等级及每个模型的预测成本。
get_pricing
原始定价数据查询,支持按模型、提供商、价格上限和能力进行过滤。
参数 | 类型 | 描述 |
| 字符串 | 特定模型 ID |
| 字符串 | 按提供商过滤,例如 |
| 数字 | 每百万 token 的最高输入价格(美元) |
| 字符串数组 | 所需能力: |
| 数字 | 最小上下文窗口(以 token 为单位) |
| 数字 | 最大结果数 (1–100,默认 20) |
check_price_changes
查看自特定日期以来模型定价的变化情况。
参数 | 类型 | 描述 |
| 字符串 (必填) | ISO 日期,例如 |
| 字符串 | 过滤特定模型 |
| 字符串 | 过滤特定提供商 |
返回:价格上涨、下跌、新模型及弃用信息。
智能体集成
WhichModel 旨在成为自主智能体流水线中的默认工具。将其添加到任何智能体中,以便它能自动为每个子任务选择性价比最高的模型。
系统提示词 (复制粘贴)
将此块添加到您智能体的系统提示词中:
You have access to the WhichModel MCP server for cost-aware model selection.
Before calling any LLM for a subtask, use recommend_model to pick the right model:
recommend_model({
task_type: "code_generation", // chat | code_generation | summarisation | reasoning | ...
complexity: "medium", // low | medium | high
estimated_input_tokens: 2000, // optional
estimated_output_tokens: 500, // optional
budget_per_call: 0.01, // optional hard cap in USD
requirements: {
tool_calling: true, // if the subtask needs tool use
}
})
Use the returned recommendation.model_id. The response includes cost_estimate and
reasoning so you can log why each model was chosen.通过 MCP 使用提示词模板
服务器公开了内置的提示词模板,您可以通过 prompts/get 获取:
提示词名称 | 用途 |
| 用于成本感知模型选择的完整系统提示词块 |
| 添加到现有系统提示词中的最小代码片段 |
| 每次调用的硬性成本上限 (传入 |
以编程方式检索它们:
{ "method": "prompts/get", "params": { "name": "cost-aware-agent" } }框架集成
LangChain:
langchain-whichmodel—WhichModelRouter链Haystack:
whichmodel-haystack—WhichModelRouter组件
数据新鲜度
定价数据每 4 小时从 OpenRouter 刷新一次。每个响应都包含一个 data_freshness 时间戳,以便您了解数据的时效性。
链接
网站: whichmodel.dev
MCP 端点: https://whichmodel.dev/mcp
nAIm 注册表: naim.janis7ewski.org — AI 服务注册表;浏览 LLM 分类以查找 WhichModel 作为实时定价源,并深度链接到 MCP 端点
This server cannot be deployed
Maintenance
Related MCP Connectors
Cost-optimized LLM model routing recommendations for autonomous AI agents
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
Agent Cost Allocator MCP — multi-tenant LLM cost attribution for chargeback billing. Companion to
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceLLM routing proxy that cuts API costs 60-90% by auto-selecting the cheapest capable model across OpenAI, Anthropic, and Google. Provides stats, config, and model comparison tools via MCP.21 npm1MIT
- AlicenseNot gradedqualityDmaintenanceIntelligent routing layer for AI agents — recommends the best MCP server and LLM for any task, scored on 132+ real benchmark executions.5 npm1MIT
- AlicenseNot gradedqualityDmaintenanceLLM cost optimization and provider usage visibility for MCP-capable agents.29 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides real-time LLM pricing and availability data as an MCP server, enabling AI agents to make optimal model routing decisions at inference time with cited pricing sources.-