mcpField
L
llm-advisor

llm-advisor

本地服务
github.com/Daichi-KudoAI 与智能体219 周前更新

关于 llm-advisor

llm-advisor 是为 AI 助手提供实时 LLM 和 VLM 价格、基准测试及推荐数据的 MCP 服务。它整合五个公开数据源,并以精简的 Markdown 结果辅助模型筛选和比较。

主要功能

  1. 01每小时更新模型数据
  2. 02整合五个来源的基准测试
  3. 03模型详情与 API 示例
  4. 04排名列表与模型比较
  5. 05按预算条件推荐模型

适用场景

  1. 01按基准测试寻找编码模型
  2. 02比较模型价格与能力
  3. 03按价格和上下文限制筛选模型
  4. 04查看模型的基准测试排名

MCP 相关

向 MCP 客户端提供 get_model_info、list_top_models、compare_models 和 recommend_model 四种工具,结果采用精简的 Markdown 格式。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"daichi-kudo-llm-advisor": {
"command": "npx",
"args": [
"-y",
"llm-advisor-mcp"
]
}
}
}
启动命令npx -y llm-advisor-mcp

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmllm-advisor-mcp0.4.5

工具

4

收录的工具列表 · 更新于 2 周前

参数类型必填说明
modelstring是模型 ID 或部分名称(例如,"anthropic/claude-sonnet-4.6"、"gpt-5.1"、"gemini")
api_formatenum否API 示例格式(默认:openai_sdk)openai_sdk | curl | python_requests
include_api_exampleboolean否包含 API 用法代码示例(默认:true)

详细介绍

llm-advisor-mcp

npm version npm downloads CI License: MIT Node.js >= 18 TypeScript

Glama MCP server

English | 日本語

为你的 AI 助手提供实时的大模型/VLM 知识。 定价、基准测试和推荐——每小时更新,而非每个训练周期更新。

大模型都有知识截止日期。问 Claude“现在最好的编码模型是什么?”,它无法根据当前数据作答。这个 MCP 服务通过将实时模型情报直接提供给 AI 助手的上下文窗口,解决了这个问题。

  • 零配置——无需 API 密钥,无需注册。一条命令即可安装。
  • 低 Token 消耗——紧凑的 Markdown 表格(约 300 个 Token),而非原始 JSON(约 3,000 个 Token)。上下文窗口很重要。
  • 5 个基准数据源——SWE-bench、LM Arena Elo、OpenCompass VLM、Aider Polyglot 和 OpenRouter 定价,整合为统一视图。

使用场景

  • “现在最好的编码模型是什么?”——使用类别为 coding 的 list_top_models
  • “比较 Claude、GPT 和 Gemini”——使用 compare_models 查看并排对比表
  • “寻找支持 1M 上下文的低价模型”——使用带预算限制的 recommend_model
  • “模型 X 有哪些基准测试结果?”——使用 get_model_info 查看百分位排名

快速开始

Claude Code
claude mcp add llm-advisor -- npx -y llm-advisor-mcp
Claude Code (Windows)
claude mcp add llm-advisor -- cmd /c npx -y llm-advisor-mcp
Claude Desktop / Cursor / Windsurf

将以下内容添加到你的 MCP 配置文件中:

{
  "mcpServers": {
    "llm-advisor": {
      "command": "npx",
      "args": ["-y", "llm-advisor-mcp"]
    }
  }
}

就这么简单。无需 API 密钥,也无需 .env 文件。

兼容的客户端
客户端支持安装方式
Claude Code是claude mcp add
Claude Desktop是JSON 配置
Cursor是JSON 配置
Windsurf是JSON 配置
任意 MCP 客户端是stdio 传输

工具

get_model_info

获取指定模型的详细规格:定价、基准测试、百分位排名、能力,以及可直接使用的 API 代码示例。

参数

名称类型必填默认值说明
modelstring是—模型 ID 或部分名称(例如 "claude-sonnet-4"、"gpt-5")
include_api_exampleboolean否true包含可直接使用的代码片段
api_formatenum否openai_sdkopenai_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)
```python
from openai import OpenAI
client = OpenAI(
    base_url="https://openrouter.ai/api/v1",
    api_key="<OPENROUTER_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**

前 5 名:编码

#模型关键分数输入 $/1M输出 $/1M上下文发布日期
1openai/o3-proSWE 79.5%$20.00$80.00200K2025-06-10
2anthropic/claude-sonnet-4SWE 76.8%$3.00$15.00200K2025-06-25
3google/gemini-2.5-proSWE 75.2%$1.25$10.001M2025-03-25
4openai/o4-miniSWE 73.6%$1.10$4.40200K2025-04-16
5anthropic/claude-opus-4SWE 72.5%$15.00$75.00200K2025-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 个模型)

anthropic/claude-sonnet-4openai/gpt-4.1google/gemini-2.5-pro
输入价格(每 1M)$3.00$2.00$1.25
输出价格(每 1M)$15.00$8.00$5.00
上下文长度200K1M1M
最大输出64K32K65K
SWE-bench76.8%55.0%75.2%
Aider Polyglot72.1%65.3%71.8%
Arena Elo146714921445
视觉是是是
工具是是是
推理是否是
开源否否否
发布日期2025-06-252025-04-142025-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. anthropic/claude-sonnet-4(评分:78)

输入:$3.00/1M | 输出:$15.00/1M | 上下文:200K | 发布日期:2025-06-25 基准测试:SWE-bench:76.8%,Aider:72.1%,Arena:1467 优势:推理、工具、视觉

2. google/gemini-2.5-flash(评分:74)

输入:$0.15/1M | 输出:$0.60/1M | 上下文:1M | 发布日期:2025-05-20 基准测试:SWE-bench:62.9%,Arena:1445 优势:工具、视觉、1M+ 上下文

3. openai/o4-mini(评分:71)

输入:$1.10/1M | 输出:$4.40/1M | 上下文:200K | 发布日期:2025-04-16 基准测试:SWE-bench:73.6%,Arena:1430 优势:推理、工具


---

## Data Sources

All data is fetched in real time from free, public APIs. No authentication required.

| Source | Data | Models | Cache TTL |
|--------|------|--------|-----------|
| [OpenRouter](https://openrouter.ai/api/v1/models) | Pricing, context lengths, modalities, release dates | 300+ | 1 hour |
| [SWE-bench](https://github.com/SWE-bench/swe-bench.github.io) | Coding benchmark (Verified leaderboard) | 30+ | 6 hours |
| [LM Arena](https://lmarena.ai) | Human preference Elo ratings | 314+ | 6 hours |
| [OpenCompass VLM](https://opencompass.org.cn) | Vision benchmarks: MMMU, MMBench, OCRBench, AI2D, MathVista | 284+ | 6 hours |
| [Aider Polyglot](https://aider.chat/docs/leaderboards/) | 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 客户端(Claude 等) │ └──────────┬───────────────────────────────────┘ │ stdio (JSON-RPC) ┌──────────▼───────────────────────────────────┐ │ llm-advisor-mcp 服务 │ │ │ │ ┌─────────┐ ┌───────────┐ ┌────────────┐ │ │ │ 工具 │ │ 注册表 │ │ 缓存 │ │ │ │ (4 个工具)│──│ (统一) │──│(内存中) │ │ │ └─────────┘ └───────────┘ └────────────┘ │ │ │ │ │ ┌────────────┼────────────┐ │ │ ▼ ▼ ▼ │ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ │ │ 规范化器 │ │ 百分位数 │ │ 数据获取器│ │ │ │(slug 映射)│ │(5 个类别)│ │(5 个来源)│ │ │ └──────────┘ └──────────┘ └──────────┘ │ └──────────────────────────────────────────────┘ │ │ │ OpenRouter SWE-bench Arena / VLM / Aider


- **TypeScript + ESM** — Single entry point, `tsup` build
- **In-memory cache** — TTL-based (1h pricing, 6h benchmarks), stale-while-revalidate
- **Cross-source normalization** — Maps inconsistent model names (e.g. `Claude 3.5 Sonnet` vs `anthropic/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/sdk` and `zod`

---

## 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

```bash
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
参与贡献
  1. Fork 此仓库
  2. 创建功能分支
  3. 为新功能添加测试
  4. 运行 npm test,确认全部 51 项测试通过
  5. 提交 pull request

许可证

MIT — 由 Cognisant LLC 构建

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。