What Is Context7 MCP? Up-to-Date Library Docs for Your Coding Assistant: Setup, API Key and Pricing
Coding assistants know libraries as they were when the model was trained. Context7 is an MCP server: once installed, the assistant reads the current, version-specific docs and code examples of the library you use before writing code; you just add "use context7" to the end of your request. This lowers the chance of it suggesting code from an old version or code that doesn't exist. It installs as a remote server, so you don't need Node.js on your computer.
- What it does
- Brings current library docs to the assistant
- Type
- MCP server (remote or local)
- Where
- Claude Code, Claude Desktop, Cursor, VS Code, Codex
- API key
- Recommended, not required
- What leaves
- The assistant's search query; your code doesn't
- Turkish
- Not stated in the official documentation
- Cost
- Free plan: 1,000 calls per month
What Is Context7 For?
AI coding assistants usually know libraries from their training data, which can lead them to produce code for an old version or functions that don't exist at all. Context7 aims to reduce this problem: before writing code, the assistant pulls the current docs and code examples for the relevant library from Context7. MCP is the standard for connecting AI programs to external tools.
The server provides two tools: one converts a library name into a Context7 ID, the other fetches docs and code examples with that ID. No write or delete tool is listed in the documentation.
Who it helps: developers who write code with Claude Code, Cursor or VS Code and work with frequently updated libraries (for example web frameworks). If you don't write code, it isn't useful to you.
What Does MCP Mean? A Bridge
MCP is a common connection format that lets an assistant connect to a service outside itself. Context7 is the service on the other end of that bridge: the assistant asks it the question, and it sends back the library's docs.
What's sent: the search query the assistant builds and the library name. Your code and chat aren't sent.
Without Context7 and With It
How Do You Install Context7?
There are two routes: the remote server hosted by Context7 (no Node.js needed on your computer) or the local package that runs on your computer. The commands are taken verbatim from the official docs; replace YOUR_API_KEY with your own key.
› npx ctx7 setupThe command has you sign in in the browser, generates an API key and installs the right skill; you choose "CLI + Skills" or "MCP" mode. For a specific agent, add --claude, --cursor or --opencode. To undo it, npx ctx7 remove.
› claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp› npx ctx7 setup --claudeContext7 also has a Claude Code plugin (/plugin marketplace add upstash/context7, then /plugin install context7@context7-marketplace); the docs say this route needs no API key and sign-in happens in the browser via /mcp. For the local server: claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY.
- Remote route: Settings then Connectors then Add Custom Connector. Enter Context7 as the name and
https://mcp.context7.com/mcpas the URL (the path in the Context7 docs). Claude's own docs describe custom connectors under Customize then Connectors; free Claude users can add one custom connector. - Local route: in the claude_desktop_config.json file in the developer settings, add an entry under mcpServers with command: npx and args: -y @upstash/context7-mcp --api-key YOUR_API_KEY.
- Cursor Settings then Tools & MCP › New MCP Server; or write url:
https://mcp.context7.com/mcpand the Authorization header into ~/.cursor/mcp.json. - Restart Cursor after changing the configuration.
› npx ctx7 setup --cursor- Install the "Context7 MCP Server" extension from the Marketplace (Upstash.context7-mcp, VS Code 1.101 or later). To verify, run the MCP: List Servers command.
- For the API key, use the "Context7: Api Key" field in the settings or the
context7.apiKeyvalue in settings.json. - Manual setup: write type: http, url:
https://mcp.context7.com/mcpinto .vscode/mcp.json.
› npx ctx7 setup --codexFor Gemini CLI, the docs describe adding an mcpServers entry to ~/.gemini/settings.json (httpUrl and the Authorization header); for ChatGPT, creating an app with Developer Mode (beta) (URL https://mcp.context7.com/mcp/oauth); according to the docs, the ChatGPT route is available on the Pro, Plus, Team, Enterprise and Edu plans.
On Windows, for the local npx server, the docs recommend running the command through cmd (command: cmd, args: /c npx -y @upstash/context7-mcp). The local package requires Node.js 20.18.1 or later.
You get an API key for free at context7.com/dashboard; the key starts with "ctx7sk" and is shown only once when it's created, so save it right away. Don't write the key into a shared configuration file.
How Do You Use Context7?
After installing, you add "use context7" to the end of your request; the assistant pulls the docs. If you write the library ID (for example /supabase/supabase) or the version, the matching step is skipped and you get the docs for the version you want.
› npx ctx7 library react "how does useEffect work"If the library you use isn't in the index, you can have its public GitHub repository added at context7.com/add-library; an account is required. Private or internal docs require the Pro or Enterprise plan.
Which Programs Does Context7 Work With?
| Claude CodeYes | The Context7 docs have a dedicated section (command, plugin or manual). |
|---|---|
| Claude DesktopYes | A remote custom connector, a local configuration file and a .mcpb desktop extension are described. |
| claude.ai (web)Unclear | The Context7 docs have no separate web section. Claude's own docs support custom connectors on the web too; the URL and steps are the same as in Claude Desktop. |
| ChatGPTBeta | With Developer Mode (beta); according to the Context7 docs, on the Pro, Plus, Team, Enterprise and Edu plans. |
| Codex, Cursor, VS Code, Gemini CLIYes | The docs have setup steps for each. |
| WindsurfUnclear | Not named in the docs; the general MCP instructions may apply, but this is not clear in the official sources. |
"Not in the docs" doesn't mean it doesn't work. The list was compiled from the client pages in the Context7 docs.
What Does Context7 Access, and What Data Leaves?
No tool that reads the files on your computer, your code or your chat history is listed in the docs. There are only two tools, and both fetch docs.
The search query the assistant builds and the library name, your API key (if any), and the client name and version are sent; on the hosted server, encrypted IP information is also added for rate limiting. It states that your full prompt, source code and chat history aren't sent.
Context7 doesn't store your source files; it stores docs, code examples and the queries the assistant builds. API logs are kept for 30 days. Queries may be passed to OpenAI, Google Gemini and Anthropic models to rank the docs; on Enterprise, query retention can be turned off.
The content in the index is community-contributed; the README says it gives no guarantee of accuracy, completeness or security. Context7 offers a "Report" button for suspicious content and says it runs a classifier for prompt injection in the content.
!The docs response goes straight into the assistant's context. Reported by users On GitHub in May 2026, it was reported that a non-documentation "system notice" had been added to a response; the developer said it was an official test for sign-in redirection and closed it (issue #2663). Read any install commands the assistant brings back before running them. This isn't a security certification.
Is Context7 Free? Plans and API Key
Yes, there's a free plan. The docs describe the API key as "recommended"; it isn't required. Without a key, the rate limit is lower. Prices are published only in dollars; Turkish lira pricing and tax information aren't on the official page.
- Public repositories
- 1,000 API calls per month
- Community support
- Private repositories
- Team collaboration
- Private repositories, team collaboration
- 2,000 calls per seat per month included
- Then $5 per 1,000 calls
- SSO, self-hosting
- Everything in Pro
- SSO, SOC-2, self-hosting
- Support with an SLA
On the Free plan, calls are blocked when you hit the monthly limit; the page says 20 bonus calls per day are given on blocked days. You can see your usage at context7.com/dashboard › Overview.
- The MCP server's source code is MIT licensed: using, modifying and distributing it are allowed
- The API backend, parsing and crawling engine are closed source; use of the service is subject to Context7's terms of use
Source: the Context7 Plans page and README. For commercial use, read Context7's official terms of use and privacy policy yourself. This is not legal advice.
Common Problems and Fixes
| What's happening | What to do |
|---|---|
| Rate limit error (429, "rate limit") | Get a free API key at context7.com/dashboard and add it to the configuration with an Authorization: Bearer header. |
| 401 Unauthorized | Check that the key starts with "ctx7sk" and that the header is in the form "Authorization: Bearer …" (the --api-key argument on the local server). |
| The local npx server times out or shows "module not found" | Official fixes: switch to the remote server (no Node.js needed), use cmd /c npx on Windows, add @latest to the command; in Codex, set startup_timeout_ms to 40000. |
| Reported by users The Claude Code plugin returns 401 without a key | The developer said it was fixed after an older version of the plugin; update the plugin. The plugin doesn't read the key from an environment variable; sign-in happens in the browser via /mcp. |
Reported by users npx ctx7 setup shows "couldn't download skill, GitHub API error" | Users reported that the GITHUB_TOKEN or GH_TOKEN value in their environment had expired; it worked with a new token. |
How Do You Uninstall Context7?
- Undo the quick setup:
npx ctx7 remove(if you installed it globally, alsonpm uninstall -g ctx7). - In Claude Code:
claude mcp remove context7. - In Claude Desktop: Remove the connector under Customize then Connectors. In ChatGPT, delete the app you created.
- Revoke the API key: Delete it from the context7.com/dashboard › API Keys card; the key stops working immediately and this can't be undone.
Frequently asked questions
What is Context7 and what is it for?
An MCP server that brings AI coding assistants the current, version-specific docs and code examples of the library you use. Its goal is to reduce code the assistant writes from outdated knowledge. It's developed by Upstash.
Do I need an API key for Context7?
No. The README describes the key as "recommended for higher rate limits". Without a key, the limits are lower. You get a key for free at context7.com/dashboard.
Is Context7 free, and what's the limit?
There's a free plan: 1,000 API calls per month. When you hit the limit, calls are blocked and 20 bonus calls per day are given. Pro is $10 per seat per month (2,000 calls included).
How do I use Context7 in Claude Code?
After installing, add "use context7" to the end of your request. To install, add the remote server with the claude mcp add command or run npx ctx7 setup --claude.
What data does Context7 send out? Does my code leave?
The search query the assistant builds and the library name are sent. It states that your full prompt, source code and chat history aren't sent. Queries may be passed to OpenAI, Google Gemini and Anthropic models to rank the docs.
Should I install it remotely or locally?
The remote server doesn't require Node.js on your computer and is easy to set up. The local package (npx) requires Node.js 20.18.1 or later, and timeout problems have been reported on Windows and macOS; the docs recommend switching to the remote server if you run into trouble.
Tasks and setup kits that use Context7
Related guides
Sources
- Context7 README
- Context7 docs: introduction
- Context7 docs: clients
- Context7 docs: CLI
- Context7 docs: Claude Code
- Context7 docs: API guide
- Context7 plans and pricing
- Context7 docs: data privacy
- Context7 docs: data security
- Adding a library
- npm: @upstash/context7-mcp
Not clear in the official sources: The numeric limit for keyless use (not stated in the official documentation) · the full content of Context7's terms of use and privacy policy · Turkish lira pricing and tax · whether it works in Windsurf · recorded security advisory status. Each is covered in the relevant section along with what you can do.




