Context7 MCP 远程 MCP 服务器 – 官方端点、工具列表与一键连接指南

🧑‍💻 Community✓ VerifiedStreamable HTTPPublic · No Auth🛡️ A+~1256 tok2 tools·Online288ms·30 天在线率: 100%·上次拨测 12 分钟前

Upstash Context7 免费免登录 MCP 服务器。实时拉取指定版本的库文档,直接注入 AI 上下文,避免过期 API。

本页收录其官方远程端点、传输协议、认证方式、全部工具 Schema、实时可用性拨测与安全审计结果,并为 Cursor、Claude Code、VS Code、ChatGPT 等 10 大客户端提供一键接入指引。

https://mcp.context7.com/mcp
提供方
Upstash ↗
分类
🔍 搜索与文档🛠️ 开发者工具与 Git
Streamable HTTPhttps://mcp.context7.com/mcp
Install in Cursor →

Or add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "context7": {
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

🧰 Context7 MCP 工具与 Schema(2)

ToolSafetyDescriptionParameters
resolve-library-id
~724 tok
🟢 Readidempotentopen-worldResolves a package/product name to a Context7-compatible library ID and returns matching libraries. You MUST call this function before 'Query Documentation' tool to obtain a valid Context7-compatible library ID UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query. Each result includes: - Library ID: Context7-compatible identifier (format: /org/project) - Name: Library or package name - Description: Short summary - Code Snippets: Number of available code examples - Source Reputation: Authority indicator (High, Medium, Low, or Unknown) - Benchmark Score: Quality indicator (100 is the highest score) - Versions: List of versions if available. Use one of those versions if the user provides a version in their query. The format of the version is /org/project/version. For best results, select libraries based on name match, source reputation, snippet coverage, benchmark score, and relevance to your use case. Selection Process: 1. Analyze the query to understand what library/package the user is looking for 2. Return the most relevant match based on: - Name similarity to the query (exact matches prioritized) - Description relevance to the query's intent - Documentation coverage (prioritize libraries with higher Code Snippet counts) - Source reputation (consider libraries with High or Medium reputation more authoritative) - Benchmark Score: Quality indicator (100 is the highest score) Response Format: - Return the selected library ID in a clearly marked section - Provide a brief explanation for why this library was chosen - If multiple good matches exist, acknowledge this but proceed with the most relevant one - If no good matches exist, clearly state this and suggest query refinements For ambiguous queries, request clarification before proceeding with a best-guess match. IMPORTANT: Do not call this tool more than 3 times per question. If you cannot find what you need after 3 calls, use the best result you have.query*: stringlibraryName*: string
query-docs
~512 tok
🟢 Readidempotentopen-worldRetrieves and queries up-to-date documentation and code examples from Context7 for any programming library or framework. You must call 'Resolve Context7 Library ID' tool first to obtain the exact Context7-compatible library ID required to use this tool, UNLESS the user explicitly provides a library ID in the format '/org/project' or '/org/project/version' in their query. Do not call this tool more than 3 times per question. If you know the programming language the user is working in, pass it as `language` so the results match their setup.libraryId*: stringquery*: stringlanguage: string

🛡️ 安全评级、质量与上下文 Token 审计

🛡️ 安全评级 A+上下文 Token 开销: ~1256 tokens(该服务端 2 个工具定义注入每次系统提示词)

估算单次调用 Token 成本 →

  • No prompt-injection or hidden-character anomalies detected in tool descriptions
  • Streamable HTTP primary endpoint (current 2025-03-26 transport)
  • Public read-only-friendly endpoint — no credentials stored client-side
  • Community-operated endpoint
  • Manually verified by RemoteMCP.net

🔐 OAuth 2.1 与安全

认证方式
免密公开
动态客户端注册(DCR)
—
PKCE S256
—
受保护资源元数据
https://mcp.context7.com/.well-known/oauth-protected-resource
审计 OAuth 2.1 配置 →

📡 官方远程端点与传输协议

远程端点 https://mcp.context7.com/mcp 采用 Streamable HTTP(流式 HTTP,2025-03-26 规范)。Streamable HTTP 在单一 POST 端点上完成 JSON-RPC 双向交互,是当前 MCP 规范推荐的传输方式,可直接被 Claude、Cursor、VS Code 等客户端以 URL 形式接入,无需 npx mcp-remote 桥接。

接入前可将端点粘贴至本站 在线 MCP Inspector 实测 initialize / tools/list 握手,确认真实协议行为。

🔐 认证与权限机制

认证方式为 免密公开(None)。完全免密公开,直接粘贴 URL 即可使用——适合文档检索与公开数据查询类场景。

🛡️ 上下文开销与安全审计

该服务端当前登记 2 个工具,全部定义合计约 1256 tokens,会在每次请求时注入模型系统提示词。安全评级为 A+,社区维护来源。工具名与 Schema 越精简,对上下文窗口的"税"越低;可用 feecalculator.app 估算每次调用的边际成本。

🧩 主流客户端快速接入

本站为 Context7 MCP 生成了 Cursor / Claude Code / VS Code / ChatGPT / Windsurf / Kiro / Codex / Cline / Gemini 等 10 大客户端的专属配置——包括一键 deeplink、claude mcp add 命令与 JSON/TOML 片段。下方选择你的客户端即可查看 1 分钟接入步骤。代表性工具包括 resolve-library-id、query-docs 等。

📖 Context7 详解

Context7 MCP — Remote MCP Server

Context7's trick is fetching the documentation for the exact version of a library you are using — 'use context7' in a prompt is now a common incantation in Cursor and Claude Code workflows. The hosted endpoint at mcp.context7.com is free and unauthenticated, with a two-step flow: resolve the library id, then pull the docs.

Official Context7 MCP Endpoint & Transport Architecture

  • Endpoint URL: https://mcp.context7.com/mcp
  • Transport: Streamable HTTP

Streamable HTTP is the current MCP transport (2025-03-26 spec): a single URL accepts JSON-RPC POSTs and may stream responses over SSE, so one endpoint serves both simple and streaming workloads. Context7 MCP does not publish a separate legacy SSE endpoint, so your client must speak Streamable HTTP.

Authentication, Scopes & Permission Boundaries

Context7 MCP is public and unauthenticated — no OAuth, no API key, no headers. Any MCP client can connect and call its tools directly, which also makes it a great endpoint for smoke-testing your own MCP client or proxy.

All 2 cataloged tools are read-only — Context7 MCP cannot mutate your account data, which makes it safe to connect broadly.

Common Troubleshooting & Connection Tips

  • "Session expired" / stale Mcp-Session-Id — just re-send initialize; stateless clients can ignore session headers entirely.
  • No authentication — rate limits apply per IP.
  • Two-tool flow: call resolve-library-id first, then get-library-docs with the returned id.

🚀 如何接入 Context7 MCP 远程 MCP

  1. 获取远程端点 — 复制官方端点 https://mcp.context7.com/mcp。
  2. 写入客户端配置 — 在 Cursor 的 mcp.json / Claude Code CLI / 其他客户端中添加该 URL(见下方分客户端指南)。
  3. 授权并验证 — 保存配置后,在本站 Inspector 中运行 initialize 与 tools/list 验证连通性。

🔌 Context7 × 各客户端连接指南

❓ 常见问题

Context7 MCP 远程 MCP 服务器是官方提供的吗?

本条目标记为「社区维护」。端点由第三方社区运营,并非 Upstash 直营,所有收录端点均经过真实 MCP initialize 握手验证。

如何在 Claude / Cursor 中连接 Context7 MCP?

复制远程端点 https://mcp.context7.com/mcp:Claude Code 执行 claude mcp add --transport http context7 https://mcp.context7.com/mcp;Cursor 可直接使用本页的一键 deeplink 或在 ~/.cursor/mcp.json 中添加 { "mcpServers": { "context7": { "url": "https://mcp.context7.com/mcp" } } }。

连接时返回 401 或需要密钥怎么办?

该端点免密公开;若仍返回 401 请确认 URL 未拼写错误,并在 Inspector 中重试。

本地 stdio MCP 和这个远程 MCP 有什么区别?

本地 MCP 通过 npx/uvx 在你的机器上启动 stdio 子进程,依赖本地运行时且密钥以明文写入配置文件;远程 MCP 是 Upstash 托管的 HTTPS 端点,免安装、支持 OAuth 2.1 授权流,且同一端点可跨桌面与移动端复用。详见 本地 vs 远程 MCP 对比。

🔗 同类远程 MCP 服务端