Context7Context7

Install guide · Claude Code, Cursor, VS Code

Context7 MCP Server: a complete install guide

Context7 MCP is a documentation server for AI coding tools. It fetches current, version-specific library docs instead of relying on the model's training cutoff. Install it in Claude Code with claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp then restart and run claude mcp list. Client JSON lives on mcpcontext7.com.

This is the Context7 MCP install guide for Claude Code, Cursor, VS Code, Claude Desktop, and Windsurf. Guides and JSON stay on mcpcontext7.com. The MCP server you add is the remote HTTP endpoint at mcp.context7.com.

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

What is Context7 MCP Server?

Context7 MCP is a documentation server for AI coding tools. You add it to Claude Code, Cursor, VS Code, Claude Desktop, or Windsurf as an MCP server. When the model needs library docs, Context7 fetches the current pages instead of guessing from training data. To add it in Claude Code, run claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp

The problem Context7 MCP solves

Language models freeze their knowledge at a training cutoff. That is fine for old APIs. It is a mess for a library that shipped a new major last month. You ask for Next.js middleware, React 19 data fetching, or a Prisma call, and the answer looks confident while using helpers that no longer exist. Context7 MCP fixes that gap by pulling the current official docs into the prompt, for the version you are actually on.

How Context7 MCP works

After you install it, you write a normal prompt and add use context7 when you want live docs. The client can also call the tools on its own. Context7 then resolves the library name, fetches current documentation, and injects that text before the model answers. The two tools are resolve-library-id and get-library-docs. get-library-docs can take a topic filter and a token limit so you are not dumping an entire manual into the context window.

  1. resolve-library-id maps a name like Next.js to a Context7 library id.
  2. get-library-docs fetches current docs for that id, with optional topic and token limits.
  3. The fetched text is injected into the model context, then the model answers.

How to install Context7 MCP in Claude Code

The install is one command. --scope user puts it in every project. Leave that flag off if you only want the current repo. After it writes config, quit Claude Code and open it again so the running session picks the server up. Then run claude mcp list and confirm context7 is there. The command is claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp

claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp
  1. Run claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp
  2. Quit Claude Code and open it again.
  3. Run claude mcp list. You want context7 in that list.
  4. On a prompt that needs current library docs, add use context7.

Restart, then check

The add command writes config. A session that is already running will not see it. Quit Claude Code, open it again, then run claude mcp list. You want context7 in that list. After that, stick use context7 on a prompt when you want current library docs.

Ask Claude Code for Next.js middleware that checks a JWT cookie. Without Context7 it often invents a helper from an older major. After the add command and a restart, the same prompt with use context7 attached matches the Next.js you actually have installed.

Optional API key

You can try it without one. For rate limits or private repos, make a key at context7.com/dashboard and add --header "Authorization: Bearer YOUR_API_KEY" right after --scope user. Drop --scope user entirely if you only want the current project.

Cursor, VS Code, Claude Desktop, and Windsurf

Those clients do not use claude mcp add, and no two of them agree on the format. Cursor and Windsurf take JSON under mcpServers with url https://mcp.context7.com/mcp. VS Code uses a servers key instead, plus type http, in .vscode/mcp.json. Claude Desktop cannot take a remote URL from its config file at all and uses a custom connector under Settings. Copy from the page for your editor rather than adapting another one: /cursor, /vscode, /claude, /windsurf.

ClientConfigGuide
Claude Codeclaude mcp add, remote HTTPOpen
Cursormcp.json urlOpen
VS Codeservers key, type httpOpen
Claude Desktopcustom connectorOpen
WindsurfmcpServers urlOpen

When this is worth installing

Reach for Context7 when the library is moving faster than the model's cutoff, or when the first answer already smells like last year's API. Typical cases: a new major of Next.js or React, a library you have not used, or a method the model insists does not exist. After the install, add use context7 to that prompt.

If it will not connect

claude mcp list is the only check that matters. Missing means the add did not stick, or you skipped the restart. Listed but dead usually means a leftover entry from an old endpoint, two servers named context7, or angle brackets leftover from a copy. spawn context7-mcp ENOENT is a local stdio install that cannot find a binary. Use the remote command on this page instead: claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp

Works in these editors

Same remote URL in each one: https://mcp.context7.com/mcp. Claude Code uses the command at the top of this page. The rest use JSON on mcpcontext7.com.

Questions

What is Context7 MCP Server?

Context7 MCP is a documentation server for AI coding tools. It pulls current library docs into Claude Code, Cursor, VS Code, Claude Desktop, and Windsurf so the model is not stuck on training-cutoff APIs. To add it in Claude Code, run claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp

How do I install the Context7 MCP server in Claude Code?

Run claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp. Restart Claude Code. Check with claude mcp list. You want context7 in that list. Same steps: mcpcontext7.com/install

How do I install Context7 MCP in Cursor, VS Code, or Windsurf?

Cursor and Windsurf take mcpServers.context7 with url https://mcp.context7.com/mcp. VS Code is different: the top-level key is servers, not mcpServers, and it also wants type http, in .vscode/mcp.json. Claude Desktop cannot take a remote URL from its config file and uses a custom connector instead. JSON for each client is on mcpcontext7.com.

What is the Context7 MCP JSON config for Claude Desktop?

There is no remote JSON entry for Claude Desktop. claude_desktop_config.json runs local stdio servers and takes command and args, not a type and url pair. Add the remote server under Settings, Connectors, Add custom connector with https://mcp.context7.com/mcp, or bridge it with mcp-remote. Walkthrough: mcpcontext7.com/claude

What is the Context7 MCP remote server URL?

https://mcp.context7.com/mcp

How do I use Context7 after it is installed?

Once claude mcp list shows context7, add use context7 to a prompt when you want current library docs. The client can also call resolve-library-id and get-library-docs on its own. Restart the editor if the server is missing from the list.

Is Context7 MCP Server free to use?

You can try it without paying. An API key from context7.com/dashboard is optional and helps with rate limits.

Which AI coding assistants does Context7 support?

Any MCP-compatible client. This guide covers Claude Code, Cursor, VS Code, Claude Desktop, and Windsurf. Claude Code uses claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp. The others take JSON with that same URL. Client pages live on mcpcontext7.com.

How many libraries does Context7 support?

Context7 indexes documentation for a large catalog of libraries and frameworks. It is meant for public library docs, not your private repo.

How often is the documentation updated?

Context7 fetches from its current index rather than from the model's training cutoff. When a library ships a new version, that version is what the tools return once it is in the index.

Can Context7 access my private code?

No. Context7 fetches publicly available library documentation. It does not need access to your repository. An API key is for rate limits and private library docs you have been granted, not for reading your source tree.

Does Context7 work offline?

The remote HTTP install on this page needs a network connection. That is the tradeoff for not running a local Node process. A local npx path exists if you want a process on your machine.

Context7 MCP remote vs local npx install?

This page is the remote HTTP add against https://mcp.context7.com/mcp. npx ctx7 setup and npx -y @upstash/context7-mcp are the local/stdio path. Use the remote command if you do not want another Node process. spawn context7-mcp ENOENT means the local binary was missing.

Do I need a Context7 API key?

Not to try it. For higher rate limits and private repos, get a key at context7.com/dashboard and pass --header "Authorization: Bearer YOUR_API_KEY" after --scope user.

How do I add Context7 to the Claude Code plugin marketplace?

You do not need a marketplace plugin for the remote server. Run claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp, then restart Claude Code. Full steps: mcpcontext7.com/install

context7 mcp not connecting in Claude Code. What now?

Run claude mcp list. If context7 is missing, run the add command again and restart. If it is listed but dead, you likely have two servers with the same name, leftover config from an old endpoint, or extra characters in the URL. spawn context7-mcp ENOENT means a local stdio install cannot find a binary. Use the remote HTTP command against https://mcp.context7.com/mcp instead.