llm顾问mcp
](https://www.npmjs.com/package/llm-advisor-mcp) ](https://www.npmjs.com/package/llm-advisor-mcp)   ](https://nodejs.org/) 
英语 | 日本语
为您的AI助手提供实时LLM/VLM知识。 定价、基准和建议——每小时更新一次,而不是每个培训周期。
法学硕士有知识界限。问Claude“现在最好的编码模型是什么?”它无法用当前的数据来回答。这个MCP服务器通过将实时模型智能直接输入到AI助手的上下文窗口中来修复这个问题。
- 零配置 -没有API密钥,没有注册。一个安装命令。
- 低代币 --紧凑的Markdown表(约300个标记),而不是原始JSON(约3000个标记)。你的上下文窗口很重要。
- 5个基准来源 --SWE长椅、LM Arena Elo、OpenCompass VLM、Aider Polyglot和OpenRouter定价合并为一个统一的视图。
______________________________________________________________________
用例
- “现在最好的编码模型是什么?” —
list_top_models与类别coding - “比较克劳德、GPT和双子座” —
compare_models配有并排桌子 - “找到一个具有1M上下文的廉价模型” —
recommend_model由于预算限制 - “model X有哪些基准?” —
get_model_info按百分比排名
______________________________________________________________________
快速开始
克劳德代码
claude mcp add llm-advisor -- npx -y llm-advisor-mcp克劳德代码(Windows)
claude mcp add llm-advisor -- cmd /c npx -y llm-advisor-mcp克劳德桌面/光标/风帆
添加到MCP配置文件中:
{
"mcpServers": {
"llm-advisor": {
"command": "npx",
"args": ["-y", "llm-advisor-mcp"]
}
}
}就是这样。没有API密钥,没有 .env 文件夹。
兼容客户端
| 客户端 | 支持 | 安装方法 |
|---|---|---|
| 克劳德代码 | 是 | claude mcp add |
| Claude Desktop | 是 | JSON配置 |
| 游标 | 是 | JSON配置 |
| Windsurf | 是 | JSON配置 |
| 任何MCP客户端 | 是 | stdio传输 |
______________________________________________________________________
工具
get_model_info
具体模型的详细规范:定价、基准测试、百分比排名、功能,以及一个随时可用的API代码示例。
参数
| 名称 | 类型 | 必填 | 默认 | 描述 |
|---|---|---|---|---|
model | string | 是 | -- | 型号ID或部分名称(例如。 "claude-sonnet-4", "gpt-5") |
include_api_example | boolean | 否 | true | 包含一个现成的代码片段 |
api_format | enum | 否 | openai_sdk | openai_sdk, curl,或 python_requests |
输出示例
## anthropic/claude-sonnet-4
**Provider**: anthropic | **Modality**: text+image→text | **Released**: 2025-06-25
### Pricing
| Metric | Value |
|--------|-------|
| Input | $3.00 /1M tok |
| Output | $15.00 /1M tok |
| Cache Read | $0.30 /1M tok |
| Context | 200K |
| Max Output | 64K |
### Benchmarks
| Benchmark | Score |
|-----------|-------|
| SWE-bench Verified | 76.8% |
| Aider Polyglot | 72.1% |
| Arena Elo | 1467 |
| MMMU | 76.0% |
### Percentile Ranks
| Category | Percentile |
|----------|------------|
| Coding | P96 |
| General | P95 |
| Vision | P90 |
**Capabilities**: Tools, Reasoning, Vision
### API Example (openai_sdk)from openai import OpenAI client = OpenAI( base_url="https://openrouter.ai/api/v1", api_key="", ) response = client.chat.completions.create( model="anthropic/claude-sonnet-4", messages=[{"role": "user", "content": "Hello"}], )
list_top_models
Top-ranked models for a category. Includes release dates for freshness awareness.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
category | enum | Yes | — | coding, math, vision, general, cost-effective, open-source, speed, context-window, reasoning |
limit | number | No | 10 | Number of results (1-20) |
min_context | number | No | — | Minimum context window in tokens |
min_release_date | string | No | — | YYYY-MM-DD. Excludes models released before this date |
Example output
## 前五名:编码
|#|模型|关键分数|输入$/1M |输出$/1M |Context |已发布|
|------|------|------|------|------|------|------|
|1|openai/o3-pro |瑞典市场79.5%| 20.00美元| 80.00美元| 200000美元| 2025-06-10|
|2|人/claude-sonnet-4|瑞典76.8%| 3.00美元| 15.00美元| 20万| 2025-06-25|
|3 |谷歌/双子座-2.5-pro |瑞典75.2%| 1.25美元| 10.00美元| 100万美元| 2025-03-25|
|4|openai/o4 mini|SWE 73.6%|1.10|4.40|200000 |2025-04-16|
|5 |人类/claude-opus-4 |瑞典72.5%| 15.00美元| 75.00美元| 20万| 2025-05-22|
compare_models
Side-by-side comparison for 2-5 models. Best values are bolded automatically. Includes a Released row so you can spot outdated models at a glance.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
models | string[] | Yes | — | 2-5 model IDs or partial names |
Example output
## 模型比较(3个模型)
| | **人/claude-sonnet-4** | **openai/gpt-4.1** | **谷歌/双子座-2.5-pro** |
|------|------|------|------|
|输入100万美元|3.00美元| **$2.00** | $1.25 |
|产出100万美元|15.00|8.00美元| **$5.00** |
|背景| 20万| 1百万| **1米** |
|最大输出|64K|32K| **65K** |
|SWE长椅| **76.8%** | 55.0% | 75.2% |
|Aider Polyglot| **72.1%** | 65.3% | 71.8% |
第1467章 **1492** | 1445 |
|愿景|是|是|有|
|工具|是|是|有|
|推理|是|否|是|
|开源|否|否|
|发布|2025-06-25| **2025-04-14** | 2025-03-25 |
recommend_model
Personalized top-3 recommendations. Scores combine weighted benchmarks, pricing, capability bonuses, and a freshness bonus (+3 points for models released within 3 months, +1 within 6 months).
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
use_case | enum | Yes | — | coding, math, general, vision, creative, reasoning, cost-effective |
max_input_price | number | No | — | Max input price (USD/1M tokens) |
max_output_price | number | No | — | Max output price (USD/1M tokens) |
min_context | number | No | — | Minimum context window in tokens |
require_vision | boolean | No | — | Require image input support |
require_tools | boolean | No | — | Require tool/function calling support |
require_open_source | boolean | No | — | Require open-source license |
min_release_date | string | No | — | YYYY-MM-DD. Excludes older models |
Example output
## 推荐用于:编码
### 1.人/claude-sonnet-4(得分:78)
输入:3.00/100万美元|输出:15.0/100万$|上下文:20万|发布:2025-06-25
基准:瑞典队替补席:76.8%,助理:72.1%,竞技场:1467
优势:推理、工具、愿景
### 2.谷歌/双子座-2.5-flash(得分:74)
投入:15美元/百万|产出:60美元/百万||背景:100万|发布时间:2025-05-20
基准:瑞典队替补席:62.9%,竞技场:1445
优势:工具、愿景、1M+背景
### 3.openai/o4-mini(71分)
投入:110美元/百万|产出:4.40美元/百万|上下文:20万|发布时间:2025年4月16日
基准:瑞典队替补席:73.6%,竞技场:1430
优势:推理、工具
Data Sources
All data is fetched in real time from free, public APIs. No authentication required.
| Source | Data | Models | Cache TTL |
|---|---|---|---|
| OpenRouter | Pricing, context lengths, modalities, release dates | 336+ | 1 hour |
| SWE-bench | Coding benchmark (Verified leaderboard) | 30+ | 6 hours |
| LM Arena | Human preference Elo ratings | 314+ | 6 hours |
| OpenCompass VLM | Vision benchmarks: MMMU, MMBench, OCRBench, AI2D, MathVista | 284+ | 6 hours |
| Aider Polyglot | Multi-language coding pass rate | 63+ | 6 hours |
Context Cost
MCP tool definitions and responses consume your LLM's context window. This server is designed to be lean:
| Component | Tokens |
|---|---|
| All 4 tool definitions | ~1,000 |
| Typical tool response | ~250-400 |
For comparison, most MCP servers that return raw JSON consume 3,000-10,000 tokens per response. Every response from llm-advisor-mcp is pre-formatted Markdown, keeping context costs roughly 10x lower.
Architecture
┌──────────────────────────────────────────────┐
│ MCP客户端(克劳德等)│
└──────────┬───────────────────────────────────┘
│ 标准输入(JSON-RPC)
┌──────────▼───────────────────────────────────┐
│ llm顾问mcp服务器│
│ │
│ ┌─────────┐ ┌───────────┐ ┌────────────┐ │
│ │ 工具│ │ 注册表│ │ 缓存│ │
│ │ (4个工具)│──│ (统一)│──│ (记忆中)│ │
│ └─────────┘ └───────────┘ └────────────┘ │
│ │ │
│ ┌────────────┼────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │规范化器│ │百分位数│ │ Fetchers│ │
│ │(段塞图)│ │ (5只猫)│ │(5来源│ │
│ └──────────┘ └──────────┘ └──────────┘ │
└──────────────────────────────────────────────┘
│ │ │
OpenRouter SWE板凳竞技场/VLM/Aider
- TypeScript + ESM — Single entry point,
tsupbuild - In-memory cache — TTL-based (1h pricing, 6h benchmarks), stale-while-revalidate
- Cross-source normalization — Maps inconsistent model names (e.g.
Claude 3.5 Sonnetvsanthropic/claude-3.5-sonnet) to canonical IDs - Percentile computation — Ranks across 5 categories (coding, math, general, vision, cost efficiency)
- Freshness scoring — Recommendation algorithm gives a bonus to recently released models (+3 for <=3mo, +1 for <=6mo)
- Zero runtime deps beyond
@modelcontextprotocol/sdkandzod
Roadmap
| Version | Status | Highlights |
|---|---|---|
| v0.1 | Done | get_model_info + list_top_models via OpenRouter |
| v0.2 | Done | compare_models + recommend_model + SWE-bench + Arena Elo |
| v0.3 | Done | VLM benchmarks (MMMU, MMBench, OCRBench, AI2D, MathVista) + Aider Polyglot + percentile ranks + 43 tests |
| v0.4 | Current | Release date display, date-based filtering, freshness scoring in recommendations + 51 tests |
| v1.0 | Planned | Community contributions, weekly static data snapshots via GitHub Actions |
Development
git clone https://github.com/Daichi-Kudo/llm-advisor-mcp.git
cd llm-advisor-mcp
npm install
npm run build # Build with tsup
npm run dev # Run with tsx (hot reload)
npm test # Run 51 unit tests (vitest)
npm run test:watch # Watch mode项目结构
src/
index.ts # Server entry point
types.ts # Shared type definitions
tools/
model-info.ts # get_model_info tool
list-top.ts # list_top_models tool
compare.ts # compare_models tool
recommend.ts # recommend_model tool
formatters.ts # Markdown output formatters
data/
registry.ts # Unified model registry
cache.ts # In-memory TTL cache
normalizer.ts # Cross-source name normalization
percentiles.ts # Percentile rank computation
fetchers/
openrouter.ts # OpenRouter API
swe-bench.ts # SWE-bench leaderboard
arena.ts # LM Arena Elo ratings
vlm-leaderboard.ts # OpenCompass VLM benchmarks
aider.ts # Aider Polyglot scores
static/
api-examples.ts # API code snippet templates贡献
- 分叉存储库
- 创建要素分支
- 添加新功能的测试
- 跑
npm test验证所有51项测试是否通过 - 提交拉取请求
______________________________________________________________________
许可证
麻省理工学院 --Cognisant有限责任公司
