Tools
Context7 (Upstash) — LLM に最新 library docs を注入する MCP サーバ
library docs を事前 index して、LLM が resolve-library-id + get-library-docs の 2 tool で必要な時だけ引く。学習データが古い library API を都度検索で埋める用途
要点
Upstash が提供する MCP サーバ。LLM の学習 cutoff より新しい library API を都度検索で埋める。数千 library の公式 docs を chunk + embedding 済みで、tool 呼び出しで該当セクションだけ返す。free tier あり。
数字 / コマンド
Claude Code (or Cursor / Cline) の設定:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}または SSE endpoint 直叩き: https://mcp.context7.com/sse
提供 tool は 2 つ:
resolve-library-id:"next.js"→ 内部 ID/vercel/next.jsget-library-docs: 内部 ID + topic (例"routing") → docs 本文
プロンプトで use context7 と書けば LLM が拾う。
詳細
何を解決するか
- LLM の training cutoff より新しい API を知らない (Next.js 15 の app router 挙動、Svelte 5 の runes 等)
- Deprecated API を平気で提案する
- 都度 WebSearch は cost / latency / ノイズが多い
使いどころ
- 刺さる: 新規 major version の library、niche library、deprecated 判定
- 刺さらない: 設計判断、モノレポ内部コード (それは repomap / 自前 embedding の領分)、docs 自体が薄い library
類似 / 競合
| プロダクト | 差分 |
|---|---|
| DevDocs.io | 人間向け UI、MCP なし |
| Kapa.ai | company 別 docs bot、有料 |
| Cursor Docs | Cursor 専用、library 手動登録 |
| WebFetch/WebSearch 直 | 汎用だが cost/精度落ちる |
| Aider repomap | 自分の repo 用、外部 library 用途外 |
制限
- Free tier に rate limit あり
- Private library は Pro/Enterprise
- 全 library がカバーされているわけではない (list に無ければ WebFetch fallback)
関連
- [[claude-context-injection]] — Claude Code の context 注入 (memory / CLAUDE.md / MCP)
- [[foxglove-mcp-bag-analysis]] — MCP サーバの別事例 (bag 解析)
最終更新: