Context7 MCP
Up-to-date, version-specific library docs for AI coding assistants
BestMCPTools
Context7 MCP
bestmcptools.org
Last verified: October 23, 2026
Maintenance status
ActiveRepository holds the MCP server and CLI source; the API backend, parsing engine and crawling engine are private. npm @upstash/context7-mcp 4.4.4 (October 19, 2026).
How to Install Context7 MCP
$npx -y @upstash/context7-mcp@latestCompatible with: Claude Code, Claude Desktop, Cursor, VS Code, GitHub Copilot CLI, Codex, Gemini CLI, OpenCode, Zed, any MCP client.
Setup by client
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"context7-mcp": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp@latest"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"context7-mcp": {
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp@latest"
]
}
}
}VS Code (.vscode/mcp.json)
{
"servers": {
"context7-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp@latest"
]
}
}
}Claude Code (terminal)
claude mcp add context7-mcp -- npx -y @upstash/context7-mcp@latestAdd any API keys or environment variables the server's README lists.
About Context7 MCP
Context7 is a documentation service from Upstash that feeds up-to-date, version-specific library documentation and code examples into your AI coding assistant. Instead of writing code from year-old training data, the assistant looks up the current docs for the library and version you name. You reach it through an MCP server or through a command line tool with agent skills.
Quick facts (as of October 23, 2026)
| Context7 | |
|---|---|
| Maker | Upstash |
| Type | Documentation lookup service, reached through an MCP server or the ctx7 CLI |
| MCP tools | Two: resolve-library-id and query-docs |
| Remote endpoint | https://mcp.context7.com/mcp |
| Local (stdio) option | npx -y @upstash/context7-mcp@latest (npm package 4.4.4, published October 19, 2026; needs Node.js 20.18.1 or newer) |
| Guided setup | npx ctx7 setup (the ctx7 CLI needs Node.js 22.13 or newer); signs in with OAuth, creates an API key and installs the skill or MCP entry |
| Authentication | An API key, sent as Authorization: Bearer YOUR_API_KEY for the remote server or as --api-key for the local one, or OAuth 2.0 on the remote server at https://mcp.context7.com/mcp/oauth for clients that support MCP OAuth. Keys come from context7.com/dashboard |
| Price (as of October 2026) | Free plan: $0 with 1,000 API calls a month and public repositories only. Pro: $10 per seat per month with 2,000 calls per seat, extra calls at $5 per 1,000 and private repositories. Enterprise: custom |
| License | MIT (the server source in the GitHub repository) |
What it does
Context7 retrieves current documentation and code examples straight from the source and places them in your prompt. The README describes two modes:
- CLI + Skills.
npx ctx7 setupinstalls a skill that guides your agent to fetch docs withctx7commands. No MCP server is needed. - MCP. Registers the Context7 MCP server so your agent calls the documentation tools directly.
The two MCP tools
| Tool | Inputs | What it does |
|---|---|---|
resolve-library-id | libraryName (required), query (required) | Turns a general library name into a Context7 library ID and ranks matches by your question |
query-docs | libraryId (required), query (required), language (optional, added in version 4.3.0 on October 9, 2026) | Returns documentation for a library, using an exact ID such as /vercel/next.js or /supabase/supabase. With language, code examples in that programming language rank first |
The CLI has matching commands: ctx7 library <name> <query> and ctx7 docs <libraryId> <query>, which also takes a --language option. CLI version 0.8.0 (October 16, 2026) removed the deprecated skills and generate commands; ctx7 setup still installs the skills.
Using it well
- Add
use context7to a prompt, or add a standing rule in your agent's rules file (for example CLAUDE.md or Cursor rules) so the assistant consults it without being asked. - If you know the library, give its ID in the prompt (for example
/supabase/supabase). That skips the matching step. - Mention the version you need ("Next.js 14 middleware") and Context7 matches the appropriate version.
Setup
- Fastest: run
npx ctx7 setupand choose CLI + Skills or MCP. Use--cursor,--claudeor--opencodeto target one agent.npx ctx7 removeundoes it. - Remote server by hand: point your client at
https://mcp.context7.com/mcpand send your key as a bearer token in theAuthorizationheader. If your client supports MCP OAuth, Context7's docs say to usehttps://mcp.context7.com/mcp/oauthinstead and sign in. OAuth works only for the remote server. - Local server: add
npx -y @upstash/context7-mcp@latestas a stdio server, with--api-key YOUR_API_KEYor aCONTEXT7_API_KEYenvironment variable if you have a key. Client-specific instructions for more than 30 clients are on the Context7 docs site.
Limitations and things to watch
- It only retrieves documentation. Context7 has no tools for Git, pull requests, builds, package inspection or running code. It will not read your repository.
- Documentation quality is not guaranteed. The README says the indexed projects are community-contributed and that Context7 cannot guarantee the accuracy, completeness or security of all library documentation. It provides a Report button for suspicious or harmful content.
- Part of the system is closed. The GitHub repository holds the MCP server source. The API backend, parsing engine and crawling engine are private, so retrieval quality cannot be audited from the repository.
- Retrieved text goes into your model's context. Treat documentation from any indexed project as untrusted input, as you would any fetched web content.
- Monthly call limits. As of October 2026, Context7's plans page caps the Free plan at 1,000 API calls a month. Once a free account reaches that, it is blocked except for 20 bonus calls a day until the month resets. Pro accounts pay $5 per 1,000 extra calls instead of being blocked. Per-minute rate limits are not published.
Pros and cons
Pros
- Directly targets a common failure: invented or outdated API calls, by pulling current docs at prompt time.
- Two small tools and a clear workflow (resolve the library, then query it).
- Choice of remote server, local server, or CLI with skills.
- MIT-licensed server source, and a free plan is available.
Cons
- Only as good as the documentation indexed for your library and version.
- Backend is closed and hosted by Upstash, so it needs network access to their service.
- Without a skill or a standing rule, your assistant may only use it when you ask (the README suggests adding a rule).
- The Free plan stops at 1,000 API calls a month (plus 20 bonus calls a day), and private repositories need a paid plan.
Who it is for
A good fit if:
- You write code with an AI assistant against fast-changing libraries and frameworks.
- You want assistants to cite the docs for the exact version you use.
Not the right tool if:
- You need repository, pull request or CI actions. See the GitHub MCP server.
- You need to search the general web. See Exa MCP or Fetch MCP.
- Your library is not indexed by Context7 and you cannot submit it (the README links a guide for submitting a library to Context7).
What we could not verify
- Per-minute rate limits. The plans page gives monthly call quotas but no per-minute limits.
- Whether the hosted endpoint still answers calls with no key or OAuth sign-in. Version 4.2.0 of the server package (October 7, 2026) requires credentials on its HTTP
/mcpendpoint by default, while the README still calls an API key recommended rather than required. - Each client's own setup steps. Context7's MCP clients page gives examples for Claude Code, Claude Desktop, Cursor, VS Code, Codex, Gemini CLI, Zed, OpenCode and others; we did not read every client's own documentation.
- How well any given library is indexed. This page does not measure retrieval quality.
How this page was put together
We read the Context7 README on GitHub and the npm entry for @upstash/context7-mcp (version, Node requirement, README) on September 30, 2026. On October 23, 2026 we rechecked the README, the MCP server and CLI changelogs, the npm entries for @upstash/context7-mcp and ctx7, and Context7's plans and MCP clients pages. We did not run Context7 against a live account.
Sources
Pricing
Freemium: from Free plan with 1,000 API calls a month; Pro $10 per seat per month (as of October 2026)
Our Take on Context7 MCP
Worth adding if you code with an assistant against fast-changing libraries: it pulls the docs for the version you name instead of trusting training data. It only retrieves documentation, so pair it with a repository server for Git and pull request work, and check important details against the official docs.
Alternatives to Context7 MCP
Web search, page fetching and a research agent for AI clients, hosted or local
View Exa MCP →