Docs MCP serverOfficialRemoteLocal

Context7 MCP Server

Context7's MCP server gives your AI agent current, version-specific library docs and code examples, so it stops inventing APIs that do not exist.

By Upstash · Last updated

Set up

Terminal
claude mcp add --transport http context7 https://mcp.context7.com/mcp

Adds it for you in this project. Add --scope user to have it in every project.

Or share it with your team in .mcp.json

.mcp.json
{
  "mcpServers": {
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp"
    }
  }
}

This file is meant to be committed, so secrets are ${NAME}: Claude Code fills them in from each person's environment.

Claude Code MCP docs

What it can do

Reads only look. Writes change something on your account, and read-only mode turns them off.

Docs

Reads

  • Find a library's Context7 ID from its name, like /vercel/next.js
  • Look up that library's docs and code examples for one question, for a given version if you name one

What it can touch

Official
Yes. Published by Upstash, who make the product it connects to.
Sign-in
None. It needs no account.
Read-only mode
No. It can do anything your credentials allow.
What leaves your machine
Each lookup sends a library name and a short question your agent writes to Context7's API. Your code is not sent, but check the question does not quote anything private.
Pinned version
@upstash/context7-mcp@4.1.1 when you run it locally. The remote server is whatever version the publisher is running.
Licence
MIT
Last reviewed
How we check an MCP server is safe
Check it yourself

MCP servers checklist

0 of 11 checked

Who made it

Before reading a line of it, know whose code you are about to run.

What's inside

The part people skip. Read what your agent will read.

What it can reach

Give it the least access that still does the job.

Keeping it that way

What you checked today is only what runs tomorrow if you pin it.

Your ticks are saved in this browser only.

Context7 gives your AI agent up-to-date documentation for the libraries you use. Models learn APIs at training time and then guess, which is how you get code calling functions that were renamed two versions ago. With Context7, the agent looks the library up first and writes code from the current docs and examples, for the version you name. It has two tools, both read-only, and needs no account.

Prompts to try

  • "How do I protect a group of routes in Next.js 16? use context7"
  • "Write a Drizzle migration that adds a unique index. Check the Drizzle docs first."
  • "Implement email login with Supabase. use library /supabase/supabase"
  • "What changed in the React Router data APIs in the latest major version?"

Gotchas

  • Your question leaves your machine. Each lookup sends the library name and a short query your agent writes to Context7's API. The tool's own description tells the agent to keep secrets and proprietary code out of it. Keep an eye on what it sends when you work on private code.
  • Only the MCP server is open source. The repository holds the server; the API backend, parsing and crawling engines behind it are private.
  • Rate limits without a key. Anonymous use works but is limited. If lookups start failing, get a free key.
  • It can crowd out other tools. Its instructions ask the agent to use it for any library question, "even when you think you know the answer". That is the point, but it costs a call or two per question.

When not to use it

For a library your agent already knows well and that has not changed in years, it adds calls for nothing. For Cloudflare's own products, the Cloudflare Docs MCP server searches the source directly.

FAQ

Is Context7 free?

Yes to start. The server works without an account, with lower rate limits. An API key, free from context7.com/dashboard, raises the limits and is what gives access to private repositories.

How do I add my Context7 API key?

Remotely, send it as an Authorization: Bearer header. Locally, set CONTEXT7_API_KEY in the server's env, or add --api-key and your key after the package in the args. Keep the key out of any config file you commit.

How do I make my agent use it?

Ask for it: add "use context7" to a prompt, or name the library ID, like "use library /supabase/supabase", which skips the lookup step. Its instructions also ask your agent to use it for any library question, and Context7 suggests a rule in your agent's settings to make that reliable.

Where do the docs come from?

Context7 indexes public documentation and repositories. Its own disclaimer says the projects are community-contributed and it cannot guarantee their accuracy, so check anything that looks off against the library's own site.

See all MCP servers