Context7 MCP for Claude: setup, free limits, vs Fetch and search
- MCP server
- Official
- Tested by us
Context7 MCP gives Claude current, version-specific library docs so it stops writing old code. Setup for Claude Code, Desktop and claude.ai, and free limits.
MCP serverContent and docsOn this page12 sections
Best for
- Getting code that matches the library version you actually use
- Setting up a framework you have never used before
- Cutting down on made-up functions in generated code
Quick install
Claude's connector directory, the remote server at https://mcp.context7.com/mcp, or a local server via npx
- claude.ai or Claude Desktop
Customize > Connectors, click +, find Context7 in the directory, click Connect and sign in.
- remote
claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp - local
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY Get a free API key at context7.com/dashboard (opens in a new tab) for the Free plan's 1,000 calls a month.
Or run
npx ctx7 setup --claudeto have Context7's CLI configure Claude Code for you (needs Node.js 22.13+).
claude.ai or Claude Desktop: Customize > Connectors, click +, find Context7 in the directory, click Connect and sign in.
Claude Code (remote):
claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcpClaude Code (local):
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEYGet a free API key at context7.com/dashboard (opens in a new tab) for the Free plan's 1,000 calls a month.
Or run
npx ctx7 setup --claudeto have Context7's CLI configure Claude Code for you (needs Node.js 22.13+).
At a glance
- Type
- MCP server
- Made by
- Upstash (official)
- Tested by us
- Yes
- Works with
- Claude.ai
- Claude Desktop
- Claude Code
- Sign-in needed
- NoThe directory connector asks you to sign in to Context7. The server also answers without a key (our December test worked), but a free account or key gives you the documented 1,000 calls a month.
- Cost
- Free plan: 1,000 API calls a month, then 20 bonus calls a day until the month resets. Pro: $10 per seat a month with 2,000 calls per seat; extra calls $5 per 1,000.
- License
- MIT
- Registry name
io.github.upstash/context7- Facts checked
Context7 MCP is a free server from Upstash that gives Claude the current documentation and code examples for the library you’re using, so it stops suggesting functions that were renamed or removed. In claude.ai or Claude Desktop, add it from Claude’s connector directory (Customize > Connectors); in Claude Code, it’s one claude mcp add command (below).
Repo: github.com/upstash/context7 (MIT licence). Server URL: https://mcp.context7.com/mcp. Claude’s directory lists it as “Anthropic verified”, made by Context7, added February 2026.
What it does (plain English)
Claude learned about programming libraries from training data with a cut-off date. When a library changes after that, Claude can confidently write code that no longer works. Context7 fetches the current docs for the library and version you name and puts them straight into Claude’s context.
It is an MCP server (a plug-in that gives Claude a new ability) with two tools:
| Tool | What it does |
|---|---|
resolve-library-id | Turns a name like “Next.js” into a Context7 library ID such as /vercel/next.js |
query-docs | Pulls the relevant docs and code examples for that ID and your question; an optional language input ranks examples in your language first |
Context7 also works without MCP: its ctx7 command-line tool plus a skill (an instruction pack Claude loads when relevant). The MCP server code is open source (MIT), but the README says the API backend, parsing and crawling engines are private. Searching for “contex7”? Same tool; it’s spelled Context7.
What we tested
On 4 December 2026, with Claude Code 2.1.336 and no API key or sign-in, we connected the remote server and asked Claude for a Next.js redirect-to-login proxy. Claude called resolve-library-id (it picked /vercel/next.js, rated “High” source reputation) and then query-docs, which returned Next.js 16 proxy.ts examples from the official Next.js docs. No errors or quota messages. The ctx7 library next.js command, also without a key, listed /vercel/next.js first too, with its available versions. (In October our keyless test hit “Monthly quota exceeded”, so keyless access can vary.) We did not test the claude.ai directory sign-in, npx ctx7 setup, the API-key commands or the Claude Desktop config below (they come from Context7’s client setup page), or paid plans.
Copy-paste install
claude.ai or Claude Desktop (directory): go to Customize > Connectors, click + next to Connectors, find Context7, click Connect and sign in. On Team and Enterprise plans, an Owner or Primary Owner enables it for the organization first. Context7’s own client page still shows the older route too: Add custom connector with the name Context7 and the URL above. Anthropic says Free plans can add one custom connector.
Claude Code (remote server, with a key):
claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp
Claude Code (local server, runs on your computer):
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
Claude Desktop (config file, with a key):
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_API_KEY"]
}
}
}
One-command option: npx ctx7 setup --claude signs you in with OAuth, creates a key and lets you choose CLI + Skills or MCP mode. It needs Node.js 22.13 or newer. Undo it with npx ctx7 remove.
Not sure it worked? Ask Claude to list its tools. You should see resolve-library-id and query-docs.
Try it: the “use context7” prompt
Add “use context7” to the end of a normal request. The README’s own example:
Create a Next.js proxy that checks for a valid JWT in cookies and redirects unauthenticated users to
/login. use context7
- Skip the lookup: if you know the ID, say it. “Implement basic authentication with Supabase. use library /supabase/supabase for API and docs.”
- Ask for a version: “How do I set up a Next.js 16 proxy? use context7” and it matches the version.
- Make it automatic:
ctx7 setupinstalls a skill that does this for you. Or add a line to your project’sCLAUDE.md: “Always use Context7 when I need library/API documentation, code generation, setup or configuration steps without me having to explicitly ask.”
Is Context7 free? Plans and limits
| Free | Pro | Enterprise | |
|---|---|---|---|
| Price | $0 | $10 per seat a month | Custom |
| Included API calls | 1,000 a month | 2,000 per seat a month | 2,000 per seat a month |
| More calls | Not available (20 bonus calls a day after you run out) | $5 per 1,000 | $5 per 1,000 |
| Private repositories | No | $5 per 1M parsed tokens | $5 per 1M parsed tokens |
| Team members | 1 | Up to 30 | Unlimited |
Source: Context7’s Plans & Pricing page, 4 December 2026. Each call is one search or docs request. If you see a monthly quota error on Free, you get 20 bonus requests the next day and the full allowance back at the start of the next month (UTC). A rate limit error is per minute: wait a minute and retry.
Keep your key out of shared files. If you add it with --scope project, it lands in .mcp.json, which teams often commit to Git.
Is it safe?
- The docs are community-contributed. Context7’s disclaimer says it “cannot guarantee the accuracy, completeness, or security of all library documentation” and asks you to use the Report button on suspicious pages. Prefer libraries with a “High” source reputation, as in our test.
- Fetched text can carry instructions. Claude Code’s MCP docs warn that servers fetching outside content can expose you to prompt injection. Review code and commands before you accept them.
- It sends your question to Context7. The tools’ inputs are a library name, a library ID and your question, and those go to Context7’s API. Context7 says all plans run on SOC 2 Type II infrastructure and offers policies that filter which sources and libraries requests use.
Context7 vs Fetch vs web search
| Context7 | Fetch MCP server | Claude’s web search | |
|---|---|---|---|
| What you give it | A library name (and optionally a version) | An exact URL | A question |
| What comes back | Ranked docs snippets and code examples for that library | The page at that URL, as Markdown | Results from many sites |
| Best for | “Which API does this version use?” | Reading one page you already found | Blog posts, GitHub issues, news, changelogs |
| Setup | Directory connector or one command | Local server (Python, uvx) | Built in: Claude searches when it helps (older layouts: + > Web search) |
| Watch out for | Community-indexed docs; monthly call limit | You must know the URL | Results can be old or off-topic |
Rule of thumb: use Context7 when the answer is in a library’s official docs, Fetch when you already have the link, and web search when you don’t know where the answer lives. They work well together. In claude.ai, web search also includes web fetch, so Claude can read a URL you paste without the Fetch server; Fetch matters mostly in Claude Desktop setups and local tools.
Is it for you?
Pick it if you build with fast-moving tools (Next.js, Astro, Supabase, Tailwind, Cloudflare Workers) and you have ever pasted an error back into Claude only to learn the method it suggested doesn’t exist. For a step-by-step project, see Keep Claude’s code up to date with Context7.
You don’t need it for general writing or non-code work; it answers library questions only, not your business logic or private code (unless you pay for private repositories). Not sure whether you need an MCP server, a skill or a plugin? See Claude skills vs MCP connectors vs plugins. Looking for connectors for everyday apps instead? See the best MCP servers for non-developers.
FAQ
Do I need an API key? Not to start. The directory connector uses a Context7 sign-in, and the server answered without a key in our test. A free key or account gives you the documented 1,000 calls a month.
Is Context7 in Claude’s connector directory? Yes. It is listed as “Anthropic verified”, made by Context7, with the same two tools.
Does it work with Claude Code skills instead of MCP?
Yes. npx ctx7 setup offers a CLI + Skills mode that installs a skill telling Claude to run ctx7 library and ctx7 docs commands, with no MCP server.
What happens when I run out of free calls? Requests stop until the next month, with 20 bonus calls each day in between. Pro accounts are never blocked; extra calls cost $5 per 1,000.
Alternatives
- Cloudflare’s documentation server (
https://docs.mcp.cloudflare.com/mcp) if you only need Cloudflare docs. See Cloudflare MCP. - Vercel MCP and Supabase MCP both include docs-search tools for their own platforms.
- Exa MCP for broader web search when the answer is in a blog post or GitHub issue rather than official docs.
Sources
- github.com/upstash/context7 (opens in a new tab)
- raw.githubusercontent.com/upstash/context7/master/README.md (opens in a new tab)
- context7.com/docs/overview (opens in a new tab)
- context7.com/docs/plans-pricing (opens in a new tab)
- context7.com/docs/resources/all-clients (opens in a new tab)
- context7.com/dashboard (opens in a new tab)
- claude.com/connectors/context7 (opens in a new tab)
- npmjs.com/package/@upstash/context7-mcp (opens in a new tab)
- npmjs.com/package/ctx7 (opens in a new tab)
- registry.modelcontextprotocol.io/v0.1/servers?search=context7 (opens in a new tab)
- support.claude.com/en/articles/11176164-use-connectors-to-extend-claude-s-capabilities (opens in a new tab)
- support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp (opens in a new tab)
- code.claude.com/docs/en/mcp (opens in a new tab)
- support.claude.com/en/articles/10684626-enable-and-use-web-search (opens in a new tab)
- github.com/modelcontextprotocol/servers/tree/main/src/fetch (opens in a new tab)
Related tools
Claude Word documents (docx skill): create, edit and redline
by Anthropic
- Skill
- Official
- Tested by us
Claude can create and edit real Word (.docx) files with Anthropic's docx skill: reports, letters, tracked-change redlines and comments. Setup, plans, limits.
Works with- Claude.ai
- Claude Desktop
- Claude Code
Filesystem MCP server
by Model Context Protocol project
- MCP server
- Official
- Tested by us
The MCP project's reference server that lets Claude read, write, move and search files, but only inside folders you name.
Works with- Claude Desktop
- Claude Code
Google Drive connector for Claude: connect, what it reads, limits
by Google
- Connector
- Official
Google Drive connector for Claude: connect in Customize > Connectors, see which files it reads (Docs, Sheets, PDFs, Office), and the limits to know.
Works with- Claude.ai
- Claude Desktop
- Claude Code
Claude Code official plugin marketplace
by Anthropic
- Plugin
- Official
Anthropic's default Claude Code plugin catalog: 315 plugins from Anthropic and partners, added automatically and installed with one /plugin command.
Works with- Claude Code
- Claude Desktop