Context7Context7
远程托管的文档服务 —— 为 Agent 提供版本感知的库文档,MIT 开源但核心服务在 Upstash 侧。
A remotely hosted documentation service — version-aware library documentation for agents; MIT-licensed, but the core service lives on Upstash's side.
适合与不适合When to use it, when not to
需要查当前版本库文档的场景:库升级后的 API 变更、 新版本引入的配置项、模型不确定的第三方库用法。
不适合涉密场景——查询内容会发送到 Upstash 服务器,需先评估数据出境。 也不适合查内部代码或私有库。
Scenarios needing current-version library documentation: API changes after an upgrade, configuration options introduced in a new version, usage of third-party libraries the model is unsure about.
Not a fit for confidential material — queries are sent to Upstash servers, so assess data leaving your machine first.
中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-10-20
- 出品属地Origin
- 国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
- 国内使用Direct access
- 大陆可直连direct OK 官网仓库在 GitHub,大陆直连波动(同日实测 200/000 混合);npm / PyPI 安装源实测稳定可达。Hosted on GitHub — direct reachability from mainland fluctuates (200/000 mixed on the same day); npm / PyPI install routes measured stable.
- 备案状态CAC filing
- 未见于备案名单not in filing list:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.
备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.
固定坐标系Fixed coordinate system
11 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.
- 模型与开放条件Model & openness
本身不调用模型,是被客户端调用的接口实现。 为 Agent 提供版本感知的库与 API 文档, 解决模型训练数据滞后导致的使用错误。
It calls no model itself; it is an interface implementation called by clients. It gives agents version-aware library and API documentation, solving usage errors caused by stale model training data.
- 运行位置Where it runs
远程托管 HTTP 服务(
https://mcp.context7.com/mcp),由 Upstash 运营。这是本分区唯一默认走远程的条目, 其余 reference server 均为本地 stdio 进程。
A remotely hosted HTTP service (
https://mcp.context7.com/mcp), operated by Upstash. This is the only entry in this section that defaults to remote; all other reference servers are local stdio processes.- 本地文件Local files
无任何本地文件访问能力。纯文档检索服务。
No local file access at all. A pure documentation-retrieval service.
- 关机后的任务Tasks after shutdown
作为远程托管服务始终可用,与客户端进程生命周期无关—— 这是本分区唯一不受本机开关影响的条目。
但服务可用性取决于 Upstash 侧的服务状态, 本仓库的 releases 不能保证服务端可用性,两者需分开判断。
Always available as a remotely hosted service, independent of the client process lifecycle — the only entry in this section unaffected by your machine's switch.
But service availability depends on Upstash's service status; this repository's releases cannot guarantee the server side — the two must be judged separately.
- 工具与扩展Tools & extensions
提供 MCP 工具用于检索库文档。
README 强调正确用法:使用 Library Id、指定版本(Specify a Version)、 以及通过 rule 声明「需要库文档时总是使用 Context7」。 输出为结构化文档内容。
It provides MCP tools for retrieving library documentation.
The README stresses correct usage: use Library Ids, specify a version ("Specify a Version"), and declare via a rule that Context7 should always be used when library docs are needed. Output is structured documentation content.
- 上下文与记忆Context & memory
无跨会话记忆,但文档检索本身是"外部记忆"—— 弥补模型训练数据滞后,这是它的核心定位。
No cross-session memory, but documentation retrieval is itself "external memory" — compensating for stale model training data; that is its core positioning.
- 权限与限制Permissions & limits
权限风险与本地 server 完全不同: 不碰本地文件,但要把查询内容发送到 Upstash 服务器。
传入 Library Id 与具体问题即产生网络请求。 认证用 API Key(
Authorization: Bearer YOUR_API_KEY)。 无独立审批机制。The permission risk profile is completely different from local servers: it touches no local files, but your query content is sent to Upstash servers.
Passing a Library Id and a question produces a network request. Authentication uses an API key (
Authorization: Bearer YOUR_API_KEY). There is no separate approval mechanism.- 适合什么任务Best for
需要查当前版本库文档的场景:库升级后的 API 变更、 新版本引入的配置项、模型不确定的第三方库用法。 不适合查内部代码或私有库。
Scenarios where you need current-version library docs: API changes after a library upgrade, config options introduced by new versions, third-party library usage the model is unsure about. Not a fit for internal code or private libraries.
- 传输方式Transport
远程 Streamable HTTP,服务端点为
https://mcp.context7.com/mcp。本分区唯一以远程服务为默认形态的条目—— 其余官方 reference server 均为本地 stdio 进程。
Remote Streamable HTTP, server endpoint
https://mcp.context7.com/mcp.The only entry in this section whose default form is a remote service — all other official reference servers are local stdio processes.
- 认证机制Authentication
需 API Key,通过
Authorization: Bearer YOUR_API_KEY头传递。 README 说明可经 OAuth 流程由安装器自动生成 key。额度档位已核验(2026-10-23 滚动复验,官方 plans 页): Free 1,000 次/月(Search API + Context API 合计),
Pro 2,000 次/席位/月、超出不阻塞(超量单价按本站的报价记录约定不存,见官方 plans 页)。
另Free 档本身就用 OAuth 2.0(官方对比表把 OAuth 2.0 列为 Free 的能力)。 ⚠ Free 超出额度后的确切行为官方页面未给答案正文,只列了问题标题。
An API key is required, passed via the
Authorization: Bearer YOUR_API_KEYheader. The README says installers can generate the key automatically through an OAuth flow.Quota tiers verified (rolling re-check 2026-10-23, official plans page): Free 1,000 calls/month (Search API + Context API combined),
Pro 2,000 calls/seat/month, overage does not block (overage unit price not stored per our price-recording policy; see the official plans page).
Also, the Free tier itself already uses OAuth 2.0 (the official comparison table lists OAuth 2.0 under Free). ⚠ The exact behaviour after Free exceeds its quota: the official page gives no answer body, only the question title.
- 权限范围Permission scope
无本地权限风险,但有数据出境风险: 查询内容会发送到 Upstash 服务器。 传入的库名与问题文本属于对外传输内容, 涉密场景需评估。
已核到一条官方对隐私的明确承诺(官方 FAQ 标题即 "How do you keep the privacy of my queries?"):
查询只发文档问题与库名/ID, 不发完整 prompt、源代码与对话历史; 且官方要求agent 不要在查询里带凭据、个人数据或专有代码。
服务端自身的文档索引范围由 Upstash 掌握,客户端不可见。
No local permission risk, but there is a data-egress risk: query content is sent to Upstash servers. The library names and question text you pass are outbound content; sensitive scenarios need an assessment.
The 2026-10-08 check adds one explicit official privacy commitment (the official FAQ title is "How do you keep the privacy of my queries?"):
Queries send only the documentation question and the library name/ID, not full prompts, source code or conversation history; and the official docs require agents not to include credentials, personal data or proprietary code in queries.
The document-index scope on the server side is Upstash's; it is not visible to clients.
头号误解Top misconception
- 以为是纯本地工具,实际查询会发到 Upstash 的远程服务器Assuming it is a purely local tool — queries actually go to Upstash's remote servers
- 不指定版本号会拿到不匹配的文档,README 专门强调Specify a VersionOmitting a version number gets you mismatched docs — the README calls out "Specify a Version" specifically
- 以为开源就等于全部本地,代码 MIT 但核心是托管服务Assuming open source means fully local — the code is MIT but the core is a hosted service
未知项清单Known unknowns
- Free 档超出 1,000 次/月后的确切行为(官方页面只列了问题标题,未给答案正文;不做推测)
- Enterprise 档的具体内容(报价按本站的报价记录约定本站不采)
- 文档索引的覆盖范围与更新频率(官方有「Keeping Libraries Fresh」专题,未取正文)
- 服务端 SLA
- 官方隐私声明(只发查询与库名、不发源码与对话历史)未做实测验证
- The exact behaviour after the Free tier exceeds 1,000 calls/month (the official page lists only the question title, no answer body; no speculation)
- What the Enterprise tier includes (prices not collected per our price-recording policy)
- Document-index coverage and refresh frequency (the official docs have a "Keeping Libraries Fresh" topic; its body was not captured the 2026-10-08 check)
- Server-side SLA
- The official privacy statement (queries and library names only; no source code or conversation history) is not verified by measurement
证据来源Evidence sources
判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-23,内容更新日content updated on 2026-10-01。
| 类型Type | 名称Name | 链接Link |
|---|---|---|
| docs | Upstash · Context7 README(API Key 与远程端点说明、「本仓只托管 MCP server 源码,API 后端/解析/爬虫为私有」的自述)Upstash · Context7 README (API-key and remote-endpoint notes, and the self-description that "this repo hosts only the MCP server source; the API backend/parsing/crawlers are private") | https://github.com/upstash/context7 |
| pricing | 官方 Pricing & Plans(滚动核验 2026-10-23:Free 1,000 次每月、Pro 2,000 次每席位每月且超出不阻塞、Private Repo Parsing 是独立计费项、Enterprise Custom 含 SOC-2/SSO/Self-Hosted;报价按本站的报价记录约定不存;与第三方「Pro 5,000 次」冲突,按官方 2,000)Official Pricing & Plans (rolling verification 2026-10-23: Free 1,000 calls/month, Pro 2,000 calls per seat per month with no blocking on overage, Private Repo Parsing as a separate billing item, Enterprise Custom including SOC-2/SSO/Self-Hosted; prices not stored per our price-recording policy; conflicts with a third-party "Pro 5,000 calls" claim — official 2,000 adopted) | https://context7.com/docs/plans-pricing.md |
| changelog | Upstash · Context7 Releases([email protected])Upstash · Context7 Releases ([email protected]) | https://github.com/upstash/context7/releases |
| changelog | Upstash · Context7 CommitsUpstash · Context7 Commits | https://github.com/upstash/context7/commits/main |
| docs | Model Context Protocol · 规范Model Context Protocol · specification | https://modelcontextprotocol.io/specification |
实测记录Measured runs
本档未在真实客户端逐项跑通;工具清单与权限来自官方 README。
实测建议:这个 server 的实测重点与其他条目不同—— 要测的是文档准确度(给定库与版本,返回的文档是否匹配当前 API), 而非能否调用成功。
This site has not completed measured runs. The test protocol is at protocols/mcp/_protocol.md.
Suggested measurement: the focus for this server differs from the other entries — what to test is documentation accuracy (given a library and version, do the returned docs match the current API), not whether the call succeeds.
为什么它和其他条目不一样Why it is unlike the other entries
| 维度 | 其余 reference server | Context7 |
|---|---|---|
| 运行形态 | 本地进程(stdio) | 远程 HTTP 服务 |
| 数据流向 | 本机内 | 查询发到 Upstash |
| 认证 | 无(靠进程权限) | 需 API Key |
| 额度 | 无 | 有(官方提"更高额度") |
| 开源许可 | 参考实现,无商业形态 | MIT 代码 + 托管服务 |
这带来的是完全不同的一类风险: 其他 server 的风险是「能碰你的什么」, Context7 的风险是「你的查询会发到哪里去」。
| Dimension | Other reference servers | Context7 |
|---|---|---|
| Run form | Local process (stdio) | Remote HTTP service |
| Data flow | Stays on your machine | Queries go to Upstash |
| Authentication | None (relies on process permissions) | API key required |
| Quota | None | Yes (the official docs mention "higher quotas") |
| Open-source licence | Reference implementation, no commercial form | MIT code + hosted service |
This brings a completely different class of risk: for other servers the risk is "what can it touch of yours"; for Context7 the risk is "where do your queries go".
变更记录说明Change-log notes
本对象有独立 releases:
| 版本 | 日期 |
|---|---|
[email protected] | 2026-09-22 |
@upstash/[email protected] | 2026-09-22 |
@upstash/[email protected] | 2026-09-22 |
一个仓库发多个包,版本号不同步,引用时要注意包名。
This object has its own releases:
| Version | Date |
|---|---|
[email protected] | 2026-09-22 |
@upstash/[email protected] | 2026-09-22 |
@upstash/[email protected] | 2026-09-22 |
One repository publishes multiple packages, with unsynchronised version numbers — watch the package name when referencing.
正确用法(README 强调的三点)Correct usage (the three points the README stresses)
这是最有操作价值的信息:
| 要点 | 说明 |
|---|---|
| Use Library Id | 用库 ID 而非模糊名字查询 |
| Specify a Version | 指定版本 —— 不指定会拿到不匹配的文档 |
| Add a Rule | 声明规则:需要库文档时总是使用 Context7 |
「Specify a Version」这一条尤其重要—— 模型训练数据滞后是这类工具要解决的核心问题, 如果不指定版本,很可能拿到的是新版本文档,行为却按老版本写。
This is the most operationally valuable information:
| Point | Explanation |
|---|---|
| Use Library Id | Query by library ID, not fuzzy names |
| Specify a Version | Specify the version — without it you get mismatched docs |
| Add a Rule | Declare a rule: always use Context7 when library docs are needed |
"Specify a Version" matters most — stale model training data is the core problem this class of tool solves; if you do not pin the version, you likely get docs for a newer version while the code behaves per the old one.
认证方式与额度:三档,两处容易看错Authentication and quotas: three tiers, two easy misreadings
手动配置:使用服务端点 https://mcp.context7.com/mcp
并通过 Authorization: Bearer YOUR_API_KEY 头传递 key
安装器支持 OAuth 流程自动生成 key。Free 档本身即支持 OAuth 2.0。
官方原话:API Key Recommended —— 获取免费 key 以获得更高额度。
额度档位(2026-10-01 核验官方 plans 页)
(报价按本站的报价记录约定不存,一律看官方 plans 页;额度是能力边界,照录。)
| 档 | 含额度 | 超出后 |
|---|---|---|
| Free | 1,000 次/月 | 阻塞(具体行为官方未明示) |
| Pro | 2,000 次 / 席位 | 不阻塞(超量按用量另计,单价见官方页) |
| Enterprise | Custom | Custom |
两处最容易看错的地方:
① Pro 的「Unlimited API Calls」不是「不限量免费」,是「不阻塞」。 官方对比表把 Pro 的 Additional API Calls 一栏写成 "Unlimited(超量按用量计费)" —— 前半句是不阻塞,后半句意味着超量要另付钱。
② Private Repo Parsing 是完全独立的计费项。 它与 API 调用额度是两个钱包,Pro 的席位价并不包含它。 要把私有库文档接进来,这笔钱要单独算(单价见官方页)。
第三方数字与官方不一致(已按官方为准)
多个第三方站(2026-09 前后)称 Pro 是「5,000 次/席位」—— 官方页面是 2,000。本档案采官方,第三方数字视为旧制或臆测。
开源的边界要划清
官方 README 自己说明:这个仓只托管 MCP server 的源码, API 后端、解析引擎、爬取引擎都是私有的。 所以「MIT」指的是那部分客户端代码,不是整个服务。
Manual config: use the server endpoint https://mcp.context7.com/mcp
and pass the key via the Authorization: Bearer YOUR_API_KEY header
Installers support an OAuth flow that generates the key automatically. The Free tier itself supports OAuth 2.0.
Official wording: API Key Recommended — get a free key for higher quotas.
Quota tiers (verified against the official plans page, 2026-10-01)
(Price figures are not stored per our price-recording policy — always see the official plans page; quotas are capability boundaries and are recorded as-is.)
| Tier | Included quota | After exceeding |
|---|---|---|
| Free | 1,000 calls/month | Blocking (exact behaviour not stated officially) |
| Pro | 2,000 calls / seat | Does not block (overage billed by usage; unit price on the official page) |
| Enterprise | Custom | Custom |
The two easiest misreadings:
① Pro's "Unlimited API Calls" does not mean "unlimited and free" — it means "does not block". The official comparison table writes Pro's Additional API Calls column as "Unlimited (overage billed by usage)" — the first half means no blocking, the second half means overage costs extra.
② Private Repo Parsing is a completely separate billing item. It is a different wallet from the API-call quota; the Pro seat price does not include it. If you want private-library docs ingested, that cost is calculated separately (unit price on the official page).
Third-party figures disagree with the official page (official prevails)
Several third-party sites (around 2026-09) claim Pro is "5,000 calls/seat" — the official page says 2,000. This entry follows the official figure; the third-party number is treated as outdated or speculative.
Draw the open-source boundary clearly
The official README itself states: this repository hosts only the MCP server's source code; the API backend, parsing engine and crawling engine are proprietary. So "MIT" refers to that client-side code, not the whole service.
风险评估Risk assessment
| 风险类型 | 评价 |
|---|---|
| 本地文件泄露 | 无 — 不碰本地文件 |
| 内网探测 | 无 — 不访问任意 URL |
| 数据出境 | 有,但范围窄 — 只发文档问题 + 库名/ID;不发完整 prompt、源代码、对话历史(官方声明,见下方说明) |
| 凭据风险 | 低 — 只用一个 API Key,无文件权限;官方还要求 agent 不要在查询里带凭据 |
| 服务可用性 | 依赖 Upstash 服务,本仓库无 releases 可保证服务状态 |
| 预算失控 | 有 — Free 超 1,000 次/月后行为不明;Pro 超出不阻塞、按用量另计;私有库解析是独立计费项(单价见官方页) |
涉密场景要评估的部分:如果你查的库名、报错信息、代码片段本身敏感, 这些会离开本机。
但已核到一条官方对隐私的明确承诺(官方 FAQ 设了专题 "How do you keep the privacy of my queries?"):
查询只发送文档问题与库名/ID, 不发送完整 prompt、源代码与对话历史; 官方并要求 agent 不要在查询里携带凭据、个人数据或专有代码。
⚠ 这条声明是官方自述,本站未做端到端实测验证 —— 即没有抓包确认发出去的内容真如所述。
| Risk type | Assessment |
|---|---|
| Local file leakage | None — touches no local files |
| Internal-network probing | None — does not visit arbitrary URLs |
| Data egress | Yes, but narrow in scope — sends only the documentation question + library name/ID; not full prompts, source code or conversation history (official statement, see note below) |
| Credential risk | Low — one API key only, no file permissions; the official docs also require agents not to put credentials in queries |
| Service availability | Depends on the Upstash service; this repository's releases cannot guarantee service status |
| Budget overrun | Yes — behaviour after Free exceeds 1,000 calls/month is unknown; Pro does not block on overage but bills by usage; private-repo parsing is a separate billing item (unit price on the official page) |
The part sensitive scenarios must assess: if the library names, error messages or code snippets you query are themselves sensitive, they leave your machine.
But the 2026-10-08 check adds one explicit official privacy commitment (the official FAQ has a dedicated entry, "How do you keep the privacy of my queries?"):
Queries send only the documentation question and the library name/ID, not full prompts, source code or conversation history; the official docs also require agents not to carry credentials, personal data or proprietary code in queries.
⚠ This statement is the vendor's own account; this site has not verified it by measurement — i.e. no packet capture confirmed the outbound content matches the description.
相关条目Related entries
- Playwright MCP ServerPlaywright MCP Server同为社区维护,权限设计更透明Also community-maintained, with a more transparent permission design
- Fetch MCP ServerFetch MCP Server同为网络访问方向Same network-access direction
- Claude Code CLIClaude Code CLI另一层 · AI 编程Other layer · AI coding
本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0).
方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.