Context7 文档服务

Context7 文档服务

精选
开发者
upstash/context760,012 星标
Upstash
claudecursorvscodewindsurfgeneric
FreeOpen Source

关于此服务器

Upstash 出品的实时文档 MCP 服务器。为编码智能体注入最新的、按版本区分的官方库文档与代码示例,杜绝过时 API 幻觉。

安装方式

npx -y @upstash/context7-mcp
官方 README 安装指南(英文原文)

> [!NOTE]

> API Key Recommended: Get a free API key at context7.com/dashboard for higher rate limits.

Set up Context7 for your coding agents with a single command. The ctx7 CLI requires Node.js 18 or newer.

bash
npx ctx7 setup

Authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI + Skills or MCP mode. Use --cursor, --claude, or --opencode to target a specific agent.

To remove the generated setup later, run npx ctx7 remove. If you globally installed the CLI with npm install -g ctx7, remove that package separately with npm uninstall -g ctx7.

To configure manually, use the Context7 server URL https://mcp.context7.com/mcp with your MCP client and pass your API key via the Authorization: Bearer YOUR_API_KEY header. See the link below for client-specific setup instructions.

Manual Installation / Other Clients →

常见问题

Context7 解决什么问题?

AI 编码时经常用过时的库 API 写出跑不起来的代码。Context7 在提示词阶段实时注入所查库的最新版本文档和代码示例,从根上消灭"训练数据过期"导致的幻觉。

怎么在 Cursor 里安装 Context7?

在 Cursor 的 MCP 设置里添加命令 npx -y @upstash/context7-mcp 即可;Claude Code 用 claude mcp add context7 -- npx -y @upstash/context7-mcp。使用时在提示词里加一句 use context7。

Context7 免费吗?有请求限制吗?

开源且免费使用,无需 API Key 即可开始;匿名请求有频率限制,到 context7.com 免费注册拿 Key 后限额更高。背后由 Upstash 官方维护。