项目介绍
MCP 服务 · 2026-11-09 更新 · 本站尚未实测
Context7 是 Upstash 维护的文档检索服务,仓库为 upstash/context7,官网为 context7.com。README 将其定位为“Up-to-date Docs for AI Agents”,即把直接从源头获取、与特定版本对应的文档和代码示例提供给 AI 编程助手,以缓解训练数据陈旧导致的过时示例、虚构 API 和旧版本泛化回答。
需要注意,本仓库主要托管 MCP 服务器源码。README 明确说明,API 后端、解析引擎和抓取引擎属于私有组件,不在本仓库内。因此,仓库公开不等同于整条服务链路均可本地部署,文档库内容也由社区提交,准确性与安全性不作保证。
核心能力
点击能力名称查看输入、输出和原文依据。
- 文档注入:在提问中加入 “use context7” 等提示后,由助手调用 Context7 拉取相关库的当前文档和示例。
- 两种接入模式:README 列出“CLI + Skills”与“MCP”两种方式。前者安装一个 Skill,引导助手通过
ctx7命令取文档,不要求 MCP;后者注册 Context7 MCP 服务器,由助手原生调用工具。 - MCP 工具:
resolve-library-id将库名解析为 Context7 兼容 ID;query-docs按库 ID 和查询检索文档,并可选传入编程语言以优先排序该语言的示例。 - CLI 命令:
ctx7 library <name> <query>按名称检索库并返回 ID;ctx7 docs <libraryId> <query>按 ID 获取文档。 - 精确指定:可在提示中直接给出
/supabase/supabase这类库 ID,跳过库名匹配步骤;也可在提问中写明版本号,让 Context7 匹配对应版本文档。
实际应用场景
适用场景
适合在 Cursor、Claude Code、OpenCode 等编程代理中进行库/API 文档查询、代码生成、初始化配置等任务,尤其是调用更新频繁的框架或 SDK 时。也可通过“添加规则”的方式让助手在涉及库文档时自动触发。
安装与接入
README 给出的单命令安装方式为:
npx ctx7 setup
该命令要求 Node.js 22.13 或更高版本,会通过 OAuth 认证、生成 API Key 并安装相应的 Skill,过程中可选择 CLI + Skills 或 MCP 模式;可用 --cursor、--claude、--opencode 指定目标代理。移除生成的配置可运行 npx ctx7 remove;若曾用 npm install -g ctx7 全局安装,需另行执行 npm uninstall -g ctx7 卸载。
手动配置时,README 要求使用 MCP 服务器地址 https://mcp.context7.com/mcp,并通过 Authorization: Bearer <API_KEY> 请求头传入 API Key。各客户端的具体配置步骤需参考官方“All Clients”文档。仓库 server.json 另列出 npm 包 @upstash/context7-mcp(stdio 传输),环境变量 CONTEXT7_API_KEY 为可选且保密。
Transport
streamable-http
Auth
Authorization: Bearer <API_KEY>(可选,用于提高速率限制)
使用条件与限制
- 是否需要部署
- 服务入口见官方资料,客户端与认证要求见正文
- 是否需要注册
- 账号和认证要求见正文;未明确说明的项目仍待核验
- 是否需要 API Key
- 待核验
- 费用与额度
- 费用边界见正文,项目许可不代表模型或托管服务免费
- 所需权限
- 待核验
- 许可证与服务条款
- 待核验
权限费用与限制
README 建议在 context7.com 仪表盘获取免费 API Key 以提高速率限制,这仅说明存在免费 Key 与速率限制机制,是否提供付费档位、具体额度与价格资料未说明,需向官方核验。API Key 属于凭据,应妥善保管,不要写入公开仓库或截图。
服务需访问远程地址 mcp.context7.com 与 context7.com 仪表盘,国内网络可达性与延迟资料未说明,需自行核验。README 声明无法保证社区贡献文档的准确性、完整性或安全性,使用风险由用户自行承担。仓库未说明是否支持国内模型或特定国产客户端,需待核验。
国内使用情况
网友核验 用户经验分享
与站长实测独立,不代表官方认证或本站已实测。
最近核验:暂无有效核验。参与人数按当前项目有效身份去重;不同核验项分别统计,不合并成用户总结果。仅统计审核通过且未过期的记录。
分项统计、有效期与样本量
| 核验项目 | 有效人数 | 成功 / 部分 / 失败 / 无法判断 | 成功率 | 最近核验 / 有效期 |
|---|---|---|---|---|
| 官方网站访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| GitHub 仓库访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 安装与运行 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 官方服务国内连接 / MCP 连接 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 国内网络情况 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 国内模型兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 自定义 API | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外服务依赖 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外账号要求 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 中文界面 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 客户端兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 账号及费用信息 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
成功率 = 成功 ÷(成功 + 部分成功 + 失败);无法判断不计入分母。至少 5 份可判断结果才显示成功率。账号、费用、海外依赖与语言等事实项,成功表示核查结论与资料吻合,具体观察另行统计;不表示免费或没有海外依赖。不同网络、客户端和版本的结果不能直接等同。
最近有效核验
暂无审核通过且未过期的网友核验。欢迎提交真实使用记录。
查看全部有效核验 →国内实测状态:国内可用性待核验。协议兼容和官方资料说明不等于国内网络可用。
- 官方网站访问
- 尚未实测 待核验
- GitHub 仓库访问
- 尚未实测 待核验
- 官方服务国内连接
- 尚未实测 待核验
- 国内网络情况
- 尚未实测 待核验
- 国内模型兼容性
- 尚未实测 待核验
- 自定义 API
- 尚未实测 待核验
- 海外服务依赖
- 尚未实测 待核验
- 海外账号要求
- 尚未实测 待核验
- 中文界面
- 尚未实测 待核验
- 国内最后核验时间
- 尚未实测
许可与国内使用
仓库代码采用 MIT 许可证(Copyright (c) 2021 Upstash, Inc.),可复制、修改、分发,但须保留版权与许可声明。该许可仅覆盖本仓库源码;README 说明 API 后端、解析引擎与抓取引擎为私有组件,托管服务、第三方库文档及模型服务不在 MIT 授权范围内。公开仓库与免费 API Key 不代表全部功能或托管服务永久免费。国内使用涉及境外域名访问,合规与网络条件需按自身环境核验。
项目资料与来源
字段依据与待核验事项
access:来源确认 · npx ctx7 setup
project_type:来源确认 · registers a Context7 MCP server so your agent can call documentation tools natively
原始 README(折叠技术参考)
 [](https://claude.ai/directory/37153cd7-b17c-470e-8b46-007e2859e0f3) [](https://chatgpt.com/plugins/plugin_asdk_app_69ef18c674308191a2f952431f91ea61) [](https://cursor.com/marketplace/upstash/context7) [](https://marketplace.visualstudio.com/items?itemName=Upstash.context7-mcp) # Context7 - Up-to-date Docs for AI Agents [](https://context7.com) [](https://www.npmjs.com/package/@upstash/context7-mcp) [](./LICENSE) [](./i18n/README.zh-TW.md) [](./i18n/README.zh-CN.md) [](./i18n/README.ja.md) [](./i18n/README.ko.md) [](./i18n/README.es.md) [](./i18n/README.fr.md) [-purple>)](./i18n/README.pt-BR.md) [](./i18n/README.it.md) [](./i18n/README.id-ID.md) [](./i18n/README.de.md) [](./i18n/README.ru.md) [](./i18n/README.uk.md) [](./i18n/README.tr.md) [](./i18n/README.ar.md) [](./i18n/README.vi.md) ## ❌ Without Context7 LLMs rely on outdated or generic information about the libraries you use. You get: - ❌ Code examples are outdated and based on year-old training data - ❌ Hallucinated APIs that don't even exist - ❌ Generic answers for old package versions ## ✅ With Context7 Context7 pulls up-to-date, version-specific documentation and code examples straight from the source — and gives them to your coding agent. ```txt Create a Next.js proxy that checks for a valid JWT in cookies and redirects unauthenticated users to `/login`. use context7 ``` ```txt Configure a Cloudflare Worker script to cache JSON API responses for five minutes. use context7 ``` ```txt Show me the Supabase auth API for email/password sign-up. ``` Context7 fetches up-to-date code examples and documentation right into your coding agent's context. No tab-switching, no hallucinated APIs that don't exist, no outdated code generation. Works in two modes: - **CLI + Skills** — installs a skill that guides your agent to fetch docs using `ctx7` CLI commands (no MCP required) - **MCP** — registers a Context7 MCP server so your agent can call documentation tools natively ## Installation > [!NOTE] > **API Key Recommended**: Get a free API key at [context7.com/dashboard](https://context7.com/dashboard?tab=settings) for higher rate limits. Set up Context7 for your coding agents with a single command. The `ctx7` CLI requires Node.js 22.13 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 <API_KEY>` header. See the link below for client-specific setup instructions. **[Manual Installation / Other Clients →](https://context7.com/docs/resources/all-clients)** ## Important Tips ### Use Library Id If you already know exactly which library you want to use, add its Context7 ID to your prompt. That way, Context7 can skip the library-matching step and directly retrieve docs. ```txt Implement basic authentication with Supabase. use library /supabase/supabase for API and docs. ``` The slash syntax tells Context7 exactly which library to load docs for. ### Specify a Version To get documentation for a specific library version, just mention the version in your prompt: ```txt How do I set up a Next.js 16 proxy? use context7 ``` Context7 will automatically match the appropriate version. ### Add a Rule If you installed via `ctx7 setup`, a skill is configured automatically that triggers Context7 for library-related questions. To set up a rule manually instead, add one to your coding agent: - **Cursor**: `Cursor Settings > Rules` - **Claude Code**: `CLAUDE.md` - Or the equivalent in your coding agent **Example rule:** ```txt Always use Context7 when I need library/API documentation, code generation, setup or configuration steps without me having to explicitly ask. ``` ## Available Tools ### CLI Commands - `ctx7 library <name> <query>`: Searches the Context7 index by library name and returns matching libraries with their IDs. - `ctx7 docs <libraryId> <query>`: Retrieves documentation for a library using a Context7-compatible library ID (e.g., `/mongodb/docs`, `/vercel/next.js`). ### MCP Tools - `resolve-library-id`: Resolves a general library name into a Context7-compatible library ID. - `query` (required): The user's question or task (used to rank results by relevance) - `libraryName` (required): The name of the library to search for - `query-docs`: Retrieves documentation for a library using a Context7-compatible library ID. - `libraryId` (required): Exact Context7-compatible library ID (e.g., `/mongodb/docs`, `/vercel/next.js`) - `query` (required): The question or task to get relevant documentation for - `language` (optional): The programming language you write in, used to rank code examples in that language first ## More Documentation - [CLI Reference](https://context7.com/docs/clients/cli) - Full CLI documentation - [MCP Clients](https://context7.com/docs/resources/all-clients) - Manual MCP installation for 30+ clients - [Adding Libraries](https://context7.com/docs/adding-libraries) - Submit your library to Context7 - [Troubleshooting](https://context7.com/docs/resources/troubleshooting) - Common issues and solutions - [API Reference](https://context7.com/docs/api-guide) - REST API documentation - [Developer Guide](https://context7.com/docs/resources/developer) - Run Context7 MCP locally ## Packages - [`@upstash/context7-mcp`](https://www.npmjs.com/package/@upstash/context7-mcp) - MCP server - [`ctx7`](https://www.npmjs.com/package/ctx7) - CLI - [`@upstash/context7-sdk`](https://www.npmjs.com/package/@upstash/context7-sdk) - TypeScript SDK - [`@upstash/context7-tools-ai-sdk`](https://www.npmjs.com/package/@upstash/context7-tools-ai-sdk) - Vercel AI SDK tools - [`@upstash/context7-pi`](https://www.npmjs.com/package/@upstash/context7-pi) - pi.dev extension ## Disclaimer 1- Context7 projects are community-contributed and while we strive to maintain high quality, we cannot guarantee the accuracy, completeness, or security of all library documentation. Projects listed in Context7 are developed and maintained by their respective owners, not by Context7. If you encounter any suspicious, inappropriate, or potentially harmful content, please use the "Report" button on the project page to notify us immediately. We take all reports seriously and will review flagged content promptly to maintain the integrity and safety of our platform. By using Context7, you acknowledge that you do so at your own discretion and risk. 2- This repository hosts the MCP server’s source code. The supporting components — API backend, parsing engine, and crawling engine — are private and not part of this repository. ## 🤝 Connect with Us Stay updated and join our community: - 📢 Follow us on [X](https://x.com/context7ai) for the latest news and updates - 🌐 Visit our [Website](https://context7.com) - 💬 Join our [Discord Community](https://upstash.com/discord) ## 📺 Context7 In Media - [Better Stack: "Free Tool Makes Cursor 10x Smarter"](https://youtu.be/52FC3qObp9E) - [Cole Medin: "This is Hands Down the BEST MCP Server for AI Coding Assistants"](https://www.youtube.com/watch?v=G7gK8H6u7Rs) - [Income Stream Surfers: "Context7 + SequentialThinking MCPs: Is This AGI?"](https://www.youtube.com/watch?v=-ggvzyLpK6o) - [Julian Goldie SEO: "Context7: New MCP AI Agent Update"](https://www.youtube.com/watch?v=CTZm6fBYisc) - [JeredBlu: "Context 7 MCP: Get Documentation Instantly + VS Code Setup"](https://www.youtube.com/watch?v=-ls0D-rtET4) - [Income Stream Surfers: "Context7: The New MCP Server That Will CHANGE AI Coding"](https://www.youtube.com/watch?v=PS-2Azb-C3M) - [AICodeKing: "Context7 + Cline & RooCode: This MCP Server Makes CLINE 100X MORE EFFECTIVE!"](https://www.youtube.com/watch?v=qZfENAPMnyo) - [Sean Kochel: "5 MCP Servers For Vibe Coding Glory (Just Plug-In & Go)"](https://www.youtube.com/watch?v=LqTQi8qexJM) ## 📄 License MIT
历史前置条件说明(补充参考)
Node.js 22.13 或更高版本(用于 npx ctx7 setup);可选 Context7 API Key(README 建议获取免费 Key 以提高速率限制);访问 mcp.context7.com 与 context7.com 的网络条件;国内网络可达性、付费档位、价格与额度待核验。
项目来源与清单版权许可
https://github.com/upstash/context7
整理来源:https://github.com/slavakurilyak/awesome-ai-agents
清单版权与许可:
MIT License
Copyright (c) 2024 Slava Kurilyak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.