Context7 MCP Server 是官方的吗?
是的。Context7 及其 MCP 服务器由 Upstash 开发;源码在 github.com/upstash/context7,npm 包为 `@upstash/context7-mcp`。
@upstash
基本信息
Context7 平台——为 LLM 和 AI 代码编辑器提供最新的代码文档
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"context7-mcp": {
"command": "npx",
"args": [
"ctx7",
"setup"
]
}
}
}工具列表暂未提供
当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。
点击上方按钮,在临时沙箱中运行此服务器并实时获取工具列表。
Context7 MCP Server 是 Upstash 官方的 Context7 MCP 服务器:它把最新的、对应具体版本的库文档和代码示例拉取到 AI 编程助手的上下文中,让回答使用当前的 API,而不是过时的训练数据。
Context7 由 Upstash 开发。MCP 服务器源码位于 upstash/context7 仓库(MIT 许可),并以 @upstash/context7-mcp 发布在 npm 上;构建文档索引的 API 后端、解析引擎和爬取引擎是私有的。你可以把它作为托管的远程服务器使用,也可以在本地运行;它还提供无需 MCP 的 CLI + Skills 模式。
最快的方式是使用安装 CLI,需要 Node.js 22.13 或更高版本:
npx ctx7 setup
它会通过 OAuth 登录、生成 API 密钥,并让你在 CLI + Skills 模式和 MCP 模式之间选择。加上 --cursor、--claude 或 --opencode 可指定目标 agent。之后如需撤销,运行 npx ctx7 remove。
手动配置时,使用远程服务器 URL https://mcp.context7.com/mcp,并在 Authorization: Bearer YOUR_API_KEY 请求头中发送密钥。建议在 context7.com/dashboard 免费获取 API 密钥以获得更高的速率限制。若要在本地运行,使用 npx -y @upstash/context7-mcp --api-key YOUR_API_KEY。
远程:
claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" \
--transport http context7 https://mcp.context7.com/mcp
本地:
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
使用远程服务器时,打开 Settings > Connectors > Add Custom Connector,名称填 Context7,URL 填 https://mcp.context7.com/mcp。使用本地服务器时,在 claude_desktop_config.json 中添加:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
添加到 ~/.cursor/mcp.json(README 中也提供一键安装按钮):
{
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
添加到 .vscode/mcp.json:
{
"servers": {
"context7": {
"type": "http",
"url": "https://mcp.context7.com/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
添加到 ~/.codex/config.toml:
[mcp_servers.context7]
url = "https://mcp.context7.com/mcp"
http_headers = { "Authorization" = "Bearer YOUR_API_KEY" }
其他 30 多个客户端的配置说明见 Context7 客户端文档。
/supabase/supabase、/vercel/next.js 这样的库 ID 可跳过搜索步骤。ctx7 library、ctx7 docs),适合不想运行 MCP 的 agent。npx ctx7 setup 一条命令为 Cursor、Claude Code 和 OpenCode 完成配置。该服务器的工具非常精简,只有两个,通常按顺序调用:
resolve-library-id 把普通库名(“supabase”、“next.js”)解析为 Context7 兼容的 ID。参数为 libraryName 和你的 query,后者用于对匹配结果排序。query-docs 根据给定的 libraryId 和 query 返回文档和示例。可选参数 language 会优先排列你所用语言的代码示例。如果你已经知道库 ID,把它写进提示词,agent 就可以直接调用 query-docs。
/login. use context7”CLAUDE.md 中加入 “Always use Context7 when I need library/API documentation, code generation, setup or configuration steps”。@upstash/context7-mcp 包仍会调用 Context7 API,因此两种方式都需要网络访问。Authorization: Bearer(远程)或 --api-key(本地)发送。ctx7sk 开头,并确认你的传输方式使用了正确的请求头或参数。/owner/repo 或 /owner/repo/version。先运行 resolve-library-id,并确认该库在 context7.com 上存在。node --version 确认 Node.js 版本足够新,尝试 @upstash/context7-mcp@latest,遇到 ERR_MODULE_NOT_FOUND 时用 bunx 代替 npx。改用远程 URL 可以完全避开 Node.js 问题。claude mcp list 检查服务器,查看 claude mcp logs context7,或删除后重新添加。可用 curl https://mcp.context7.com/ping 测试连通性。是的。Context7 及其 MCP 服务器由 Upstash 开发;源码在 github.com/upstash/context7,npm 包为 `@upstash/context7-mcp`。
有免费方案。撰写本文时,[context7.com/plans](https://context7.com/plans) 列出的 Free 方案为 $0,每月 1,000 次 API 调用;Pro 方案为每席位每月 $10,另有 Enterprise 方案。
推荐使用但并非严格必需;密钥可以带来更高的速率限制。可在 context7.com/dashboard 免费获取,或让 `npx ctx7 setup` 自动生成。
`https://mcp.context7.com/mcp`,使用 Streamable HTTP 和 `Authorization: Bearer YOUR_API_KEY` 请求头。
支持。这三者都有文档说明,此外还有 Claude Desktop、Codex 以及其他 30 多个客户端。
`ctx7 setup` 会安装一个在库相关问题时触发 Context7 的 skill。否则可在 Cursor Rules 或 `CLAUDE.md` 中添加规则,或在提示末尾加上 “use context7”。
可以。库的所有者可以提交项目,详见 Context7 文档中的 Adding Libraries 指南。
Context7 表示其项目由社区贡献,无法保证所有文档的准确性、完整性或安全性。如发现问题,可在项目页面使用 “Report” 按钮反馈。

Local-first MCP server that snapshots your project's working state into one context object. Open-core, privacy-first.
Local MCP server and CLI that keeps a Git-versioned, model-written index of a codebase and its database schema, so coding agents start each task with the whole system in view.

Orcha is a unified context layer for AI tools and agents. It stores and indexes and exposes organizational, team, or individual knowledge. Files, structured databases, and connected sources live in one workspace, and age

Sooveryn gives Claude Code a team of AI personas that remembers your project. Soov, the partner and team lead, keeps your decisions and how you work in a lasting memory, and finds them again by words and by meaning, from

Mess in, magic out: pour in your D&D and TTRPG notes and LoreKeeper keeps them as a private store for your world. Ask Claude or ChatGPT about it, or build a sourcebook.
评论