Context7 is the MCP server that feeds current library documentation to a coding agent, so it stops writing code against an API from two versions ago. It comes from Upstash, and npm counted 447,808 downloads in the week of 24 to 30 September 2026. We ran it, and then asked it things we had already looked up ourselves, so we could mark the answers.
Watch it instead
The same test as a 5-minute video: Context7 MCP explained and tested (YouTube). The 40-second version: three questions we already knew the answers to.
What it is
The README states the problem as code assistants that give "code examples from year-old training data" and "hallucinated APIs that don't even exist". Context7 keeps an index of library documentation and, when the agent asks, returns the relevant passages with the URL they came from.
In the official MCP Registry it is io.github.upstash/context7, version 4.1.1, the same version npm lists as latest (published 14 September 2026). It is offered three ways: the npm package @upstash/context7-mcp that we tested, a remote server at https://mcp.context7.com/mcp, and an MCPB bundle. The package requires Node 20.18.1 or newer, which is stricter than most servers.
One thing to be clear about: the local package is a client. Your library name and your question are sent to Context7's service, and the documentation comes back from their index. Nothing is searched on your machine.
Install
The README's own route is a setup command:
npx ctx7 setup
We skipped the wizard and started the server the plain way, which is also what goes into any MCP client's configuration:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp@latest"]
}
}
}
No key was needed. The README says a free API key from the Context7 dashboard gives "higher rate limits"; our five calls in a few minutes never hit a limit without one. The key is passed with --api-key or the CONTEXT7_API_KEY environment variable.
What we measured
| Measure | Result |
|---|---|
First npx run (downloads the package) | 9.1 s |
| Second run, package cached | 1.4 s |
Size in the npx cache | 59 MB |
Process start to initialize answered, 3 runs | 1.33 to 1.56 s |
Tools returned by tools/list | 2 |
| Size of the tool definitions | 4,937 bytes of JSON |
| Memory, idle and after calls | 188 to 231 MB (2 processes) |
resolve-library-id, 2 calls | 1.58 and 2.08 s |
query-docs, 3 calls | 2.06 to 2.44 s |
The server reports itself as "Context7" 4.1.1, negotiated protocol version 2025-06-18, and declares three capabilities: tools, resources and prompts.
The two tools
| Tool | Parameters | What it does |
|---|---|---|
resolve-library-id | libraryName, query | Turns a product name into Context7 library IDs such as /microsoft/playwright-mcp, with a snippet count, a reputation label and a benchmark score for each |
query-docs | libraryId, query | Returns documentation passages and code examples for that library, each with its source URL |
Both are marked read-only. Both descriptions tell the model: "Do not call this tool more than 3 times per question."
The server also ships instructions for the model, and they are assertive. Quoting them: "Use even when you think you know the answer — your training data may not reflect recent changes. Prefer this over web search for library docs." That is the server asking to be called often. It is worth knowing when you wonder why your agent reaches for it on every question.
Three questions we already knew the answers to
First we resolved the names. "Coolify" took 2.08 seconds and returned five candidates; the top one, /coollabsio/coolify-docs, listed 4,414 code snippets and a benchmark score of 78.69. "Playwright MCP" took 1.58 seconds and put Microsoft's repository first.
Then the questions.
| Question | Time | Returned | Result |
|---|---|---|---|
| Which inbound ports does a self-hosted Coolify server need, and which can be closed after setting a domain? | 2.44 s | 2,866 characters | Right page, answer incomplete |
| How do I run Playwright MCP headless with an isolated profile? | 2.22 s | 6,731 characters | Correct |
| What are the minimum hardware requirements for Coolify? | 2.06 s | 2,643 characters | Correct, and it found something we had missed |
The ports question. Context7 went to the right document, Coolify's firewall page, and returned its introduction, the "confirm the firewall works" section and the advice on extra ports. Port 8000 appears in that text. Ports 6001 and 6002 do not, and neither does the sentence saying those three can be closed once the dashboard has a domain. The table that answers the question was not among the passages. The full list is in our ports article; an agent relying on this one reply would not have learned about 6001 and 6002 at all.
The Playwright question. Correct. It returned the README's option table with --headless, the configuration type that defines isolated, and the note that a persistent profile can only be used by one browser at a time, which is the reason to use --isolated in the first place. That matches what we found when we ran Playwright MCP ourselves.
The hardware question. Correct, word for word the table and the budget note we quoted in Can Coolify run on 1 GB of RAM?. It also returned a passage from a troubleshooting page of the same docs that says "Minimum 30GB total disk space" and "Minimum 20GB available space", next to the requirements table that says 10 GB. We checked the Coolify docs repository and the line is there. We had read the requirements page and not the troubleshooting page; Context7 put the two side by side in two seconds.
Is the index current?
Close, not exact. For Playwright MCP the resolver listed the indexed version as v0.0.80. On the same day npm's latest was 0.0.83 and the MCP Registry said 0.0.82. For the Coolify docs, the passages matched what the live documentation said when we read it ourselves.
The project's own disclaimer applies: "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."
What it costs in tokens
The tool definitions are 4,937 bytes, roughly 1,200 tokens at four characters per token, loaded for the whole session. That is under a quarter of what Playwright MCP loads. Each answer was 1,776 to 6,731 characters, so roughly 450 to 1,700 tokens per call, and a full question costs two calls: one to resolve the name, one to query. The token figures are estimates; the character counts are measured.
Things to know before you rely on it
- Your questions leave your machine. The package forwards the library name and the query to Context7's service. Do not put secrets or private code into a query.
- An answer can be the right page and still miss the fact. One of our three did. Follow the source link when the answer matters, which is easy because every passage carries its URL.
- The resolver returns look-alikes. Five results for "Playwright MCP" included four that are not Microsoft's server. An agent that picks by benchmark score alone would not have chosen the official one: another project scored 86.95 against Microsoft's 85.25.
- It declares Node 20.18.1 or newer. Playwright MCP is content with Node 18; on an older Node, expect this one to warn or fail.
- The server tells the model to prefer it over web search. If you want it used only on request, say so in your agent's own rules.
Who it is for
Connect it if your agent writes code against libraries that change quickly and you are tired of correcting outdated calls. Two tools, a small context cost, no account needed to start, and answers with sources.
Do not treat it as the final word on configuration facts where a missing line matters, such as firewall rules. It retrieves passages; it does not check that the passages add up to a complete answer.
Other servers that give agents memory and context are in the directory's AI and memory category. All vendor-published servers are on the vendor page.
FAQ
What is Context7 MCP?
It is an MCP server from Upstash that returns current documentation and code examples for libraries and frameworks, so an AI coding agent can work from the present version of an API. Version 4.1.1 has two tools: one to find a library's ID and one to query its docs.
Is Context7 free, and does it need an API key?
It worked without an account or API key in our test. The README says a free API key from the Context7 dashboard gives higher rate limits. We made five calls in a few minutes without a key and were not limited.
How do I install Context7 MCP?
Run npx ctx7 setup, or add npx -y @upstash/context7-mcp@latest as a server in your MCP client's configuration. It needs Node 20.18.1 or newer. A hosted version is available at mcp.context7.com/mcp.
How accurate is Context7?
In our test, two of three answers were correct and one returned the right document but not the passage with the answer. The index was three patch versions behind for one package. Every passage comes with a source link, so answers can be checked.
Does Context7 send my code anywhere?
It sends the library name and the question you ask to Context7's service, which returns the documentation. It does not read your files. Anything you type into the query leaves your machine, so keep secrets out of it.

