MCP Configs2026年3月31日·1 分钟阅读

Context7 — Up-to-Date Docs MCP for AI Editors

MCP server that provides AI code editors with up-to-date library documentation. Eliminates hallucinations from outdated training data. Supports 1000+ libraries. 51K+ stars.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Established
入口
Context7 — Up-to-Date Docs MCP for AI Editors
安全暂存命令
npx -y tokrepo@latest install 80630bbc-db0f-4254-bed5-8e5b639e5a34 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
Context7 is an MCP server that feeds AI code editors current documentation for 1000+ libraries to prevent outdated hallucinations.
§01

What it is

Context7 is an MCP server that provides AI code editors with up-to-date library documentation. When your AI assistant generates code, Context7 ensures it references current API signatures, not outdated information from training data. It supports over 1000 libraries and integrates with Claude Code, Cursor, and Windsurf.

It targets developers who encounter AI-generated code using deprecated APIs or outdated patterns because the model's training data is stale.

§02

How it saves time or tokens

Without Context7, you spend tokens correcting AI-generated code that uses deprecated APIs. Context7 injects current documentation into the agent's context, so the first response uses correct, up-to-date APIs. This eliminates correction rounds.

§03

How to use

  1. Add Context7 to your MCP configuration:
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@context7/mcp@latest"]
    }
  }
}
  1. Restart your AI editor.
  2. Context7 automatically provides relevant documentation when the agent generates code using supported libraries.
§04

Example

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@context7/mcp@latest"]
    }
  }
}

Once configured, ask your AI to write code using any supported library. Context7 fetches current docs and the AI generates code with the latest API signatures.

§05

Related on TokRepo

Key considerations

When evaluating Context7 for your workflow, consider the following factors. First, assess whether your team has the technical prerequisites to adopt this tool effectively. Second, evaluate the maintenance burden against the productivity gains. Third, check community activity and documentation quality to ensure long-term viability. Integration with your existing toolchain matters more than feature count alone. Start with a small pilot project before rolling out across the organization. Monitor resource usage during the initial adoption phase to identify bottlenecks early. Document your configuration decisions so team members can onboard independently.

§06

Common pitfalls

  • Context7 fetches documentation on demand; slow internet connections may increase response latency.
  • Not all libraries are covered; niche or private libraries may not have documentation indexed.
  • The MCP server runs locally but fetches docs from Context7's servers; it does not work fully offline.

常见问题

How many libraries does Context7 support?+

Context7 supports over 1000 libraries and frameworks. The catalog is continuously updated. Popular frameworks like React, Next.js, FastAPI, and Django are included.

Does Context7 send my code to external servers?+

Context7 sends library queries (not your code) to its servers to fetch current documentation. Your actual source code stays local.

Which AI editors work with Context7?+

Any MCP-compatible editor works, including Claude Code, Cursor, Windsurf, and other editors that support the Model Context Protocol.

How current is the documentation?+

Context7 crawls and indexes library documentation regularly. The docs are typically current within days of official releases. The exact freshness depends on the library.

Is Context7 free?+

Context7 offers a free tier for individual developers. Check the Context7 website for current pricing on team and enterprise usage.

引用来源 (3)
🙏

来源与感谢

Created by Upstash. Licensed under MIT. upstash/context7 — 51,000+ GitHub stars

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产