Omniscio

OmniscioGuidesContext7 MCP

Context7 in Claude Code: documentation that is current

Every model has a date after which the libraries it knows are guesses. Context7 is a documentation service that fills that gap at the moment you ask: it resolves the library, reads the version-specific docs, and hands the result to the agent.

For Claude Code that is the difference between an answer that uses the current API and one that confidently uses a function removed two releases ago. The setup is one line, and most of the page is about the key and the habit that makes it fire.

Sources read November 25, 2026. By the Omniscio team. Updated .

What it gives Claude Code

Context7 describes itself as bringing up-to-date, version-specific library documentation into your AI coding agent, pulled from the source, and supplies that documentation and its code examples to the agent when it asks.

The useful part is version specificity. A library that changed its setup between two major versions has two different answers to the same question, and the one that matches your lockfile is the only one worth reading.

It is not a search engine replacement. It answers questions about libraries it has indexed, so the server's value is highest exactly where a model is weakest: recent releases of a popular package.

The command

The hosted server

The endpoint is https://mcp.context7.com/mcp, and this is the line Context7's own Claude Code instructions give, with the key in a header:

claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp

Without a key, the same command with only the header left out, keeping user scope. The connection works either way and the key is what raises the limits:

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

A key comes from the Context7 dashboard, and the free one takes a minute to create; the auth step below covers what it costs.

The local server

The package is @upstash/context7-mcp, and this is the line Context7 prints for it:

claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY

The double dash matters here, because the line carries a flag of the server's own: everything after the dash is handed to npx, including --api-key.

Or let its setup command write it

Context7 also ships a setup command, npx ctx7 setup --claude, which needs Node.js 22.13 or newer. It authenticates, generates an API key, and installs for the agent you name, with --claude one of the targets. Reach for it if you want its own skill as well as the server; reach for the lines above if you want the server and nothing else.

The .mcp.json equivalent

{
  "mcpServers": {
    "context7": {
      "type": "http",
      "url": "https://mcp.context7.com/mcp",
      "headers": { "Authorization": "Bearer ${CONTEXT7_API_KEY}" }
    }
  }
}

Drop the headers block if you are using it without a key. Claude Code expands ${VAR}, so the key can live in the environment rather than in a committed file.

Which scope to use

User scope is the one to pick, and Context7's own instructions do: documentation is useful in every project, and its value does not depend on which repository you are in. Local scope works too, but you would add it again in each project.

Project scope writes the entry into .mcp.json at the repository root, which means the key goes into a file the team commits unless you keep it in a variable. Do that only if the team shares one key on purpose.

The auth step

Create the key in the Context7 dashboard. Its README calls a key recommended and not required, and its docs give the numbers: a free account includes a thousand API calls a month, and a key raises the rate limits.

The key then goes in one of two places: the Authorization: Bearer header for the hosted server, or the --api-key flag for the local one.

Confirm it connected

claude mcp list
claude mcp get context7

The list prints a status beside the name: ✔ Connected, ! Needs authentication or ✘ Failed to connect. The hosted endpoint works without a key, so a key problem shows up as a limit rather than a failure.

Inside a session, /mcp lists the tools under mcp__context7__<tool>. The real test is one prompt: ask about a library you know changed recently, and watch whether Claude calls the server before answering.

The failure people hit

The server is connected and Claude never uses it, because nothing in the prompt asked for current documentation. Context7's own documentation answers this with a habit: add use context7 to the prompt. It works because the model then has a reason to call the tool instead of answering from memory.

The second is running out of calls. A free account is a thousand calls a month, shared across the MCP server, the CLI, the Search API and the REST API, and when those are used requests stop until the next month with only 20 bonus calls a day to bridge it. That is the moment to move to a paid plan, not to reinstall the server.

The rest of the messages are in the MCP errors guide, and the shared flags and scopes in Add an MCP server to Claude Code.

Sources

Every line on this page rests on one of these. The date beside each one is the day we read it.

  • Context7: all clients, for both Claude Code commands, the hosted URL and the header form. Read November 25, 2026.
  • Context7: plans and pricing, for the shared thousand-call allowance, what happens when it runs out and the daily bonus calls. Read November 25, 2026.
  • Context7 documentation, for what the service does, the free tier's thousand calls a month, the use context7 prompt habit and what a key unlocks. Read November 25, 2026.
  • upstash/context7 README, for the API key being recommended rather than required, the setup command and its Node.js 22.13 requirement. Read November 25, 2026.
  • Anthropic: Connect Claude Code to tools via MCP, for the double dash, the scope table, the health statuses and the tool-name pattern. Read November 25, 2026.

Common questions

What does Context7 give Claude Code?

Up-to-date, version-specific library documentation and code examples taken from the source, so Claude works from the current API instead of from what it remembers.

What is the command to add Context7?

The hosted server line Context7 prints is claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp, and the header is the only part you drop if you have no key yet.

Do I need an API key?

No. Context7's README calls an API key recommended rather than required, and its docs say the free account covers a thousand API calls a month while a key raises the rate limits.

Why does Claude ignore Context7 in a session?

Because nothing in the prompt asked for it. Context7's documentation says to add use context7 to the prompt, which gives the model a reason to call the server instead of answering from memory.

Is there a local Context7 server?

Yes. The package is @upstash/context7-mcp and runs under npx, with the API key passed as a flag instead of a header, which is the local form Context7 documents for Claude Code.

Every session, one window

Omniscio runs several agent sessions side by side in one window, each with its own context and its own diff view. Any model, any harness — Claude Code, Codex, OpenCode, Devin, Pi, and Hermes all supported.