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.

On 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

  1. claude.ai or Claude Desktop: Customize > Connectors, click +, find Context7 in the directory, click Connect and sign in.

  2. Claude Code (remote):

    claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp
  3. Claude Code (local):

    claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
  4. Get a free API key at context7.com/dashboard (opens in a new tab) for the Free plan's 1,000 calls a month.

  5. Or run

    npx ctx7 setup --claude

    to 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:

ToolWhat it does
resolve-library-idTurns a name like “Next.js” into a Context7 library ID such as /vercel/next.js
query-docsPulls 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 setup installs a skill that does this for you. Or add a line to your project’s CLAUDE.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

FreeProEnterprise
Price$0$10 per seat a monthCustom
Included API calls1,000 a month2,000 per seat a month2,000 per seat a month
More callsNot available (20 bonus calls a day after you run out)$5 per 1,000$5 per 1,000
Private repositoriesNo$5 per 1M parsed tokens$5 per 1M parsed tokens
Team members1Up to 30Unlimited

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.
Context7Fetch MCP serverClaude’s web search
What you give itA library name (and optionally a version)An exact URLA question
What comes backRanked docs snippets and code examples for that libraryThe page at that URL, as MarkdownResults from many sites
Best for“Which API does this version use?”Reading one page you already foundBlog posts, GitHub issues, news, changelogs
SetupDirectory connector or one commandLocal server (Python, uvx)Built in: Claude searches when it helps (older layouts: + > Web search)
Watch out forCommunity-indexed docs; monthly call limitYou must know the URLResults 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

Facts checked against these sources on . Page updated . How we check facts

  1. github.com/upstash/context7 (opens in a new tab)
  2. raw.githubusercontent.com/upstash/context7/master/README.md (opens in a new tab)
  3. context7.com/docs/overview (opens in a new tab)
  4. context7.com/docs/plans-pricing (opens in a new tab)
  5. context7.com/docs/resources/all-clients (opens in a new tab)
  6. context7.com/dashboard (opens in a new tab)
  7. claude.com/connectors/context7 (opens in a new tab)
  8. npmjs.com/package/@upstash/context7-mcp (opens in a new tab)
  9. npmjs.com/package/ctx7 (opens in a new tab)
  10. registry.modelcontextprotocol.io/v0.1/servers?search=context7 (opens in a new tab)
  11. support.claude.com/en/articles/11176164-use-connectors-to-extend-claude-s-capabilities (opens in a new tab)
  12. support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp (opens in a new tab)
  13. code.claude.com/docs/en/mcp (opens in a new tab)
  14. support.claude.com/en/articles/10684626-enable-and-use-web-search (opens in a new tab)
  15. github.com/modelcontextprotocol/servers/tree/main/src/fetch (opens in a new tab)
  • 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
  • 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