How-to ยท Claude Code
How to install Context7 MCP Server
Run claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp then restart. claude mcp list should show context7. Client JSON for Cursor, VS Code, Claude Desktop, and Windsurf is on mcpcontext7.com.
This is the short how-to. The longer write-up of what Context7 is, and why you would bother, lives on the main guide.
claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcpInstall in Claude Code
That command is the install for Claude Code. --scope user puts it in every project. Leave the flag off for the current repo only. After you run it, quit Claude Code and open it again. Then run claude mcp list. The command is claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp
- Run claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp
- Quit Claude Code and open it again.
- Run claude mcp list and confirm context7 is listed.
- Add use context7 to prompts that need current library docs.
--scope user versus a single project
The flag decides where the entry is written, and getting it wrong is the most common reason a server vanishes when you switch repositories.
With --scope user, context7 is registered once for your account and is present in every project you open. Without it, the entry belongs to the directory you ran the command in, and only that one. Neither is more correct. A documentation server is useful nearly everywhere, so user scope is the sensible default; drop the flag when you are trying it out and do not want it following you around.
If claude mcp list shows context7 in one repository and not another, this is why, and re-running with --scope user fixes it.
- Every project: claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp
- This project only: claude mcp add --transport http context7 https://mcp.context7.com/mcp
Installing without an API key, and adding one later
No key is needed to install or to try it. The command above authenticates nothing and still works, which is the fastest way to find out whether the thing helps you before you sign up for anything.
A key raises rate limits and reaches private library docs you have been granted. Create one at context7.com/dashboard, then pass it as a header on the same endpoint. The header goes immediately after --scope user.
One caution: this writes the key into a config file in plaintext. If that is a problem, see the OAuth endpoint below instead.
- With a key: claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp
The OAuth endpoint
There is an authenticated variant of the endpoint at https://mcp.context7.com/mcp/oauth. Requested without a credential it answers 401 with "Authentication required", which is how you can confirm it is live.
Its appeal is that no API key ends up in a config file: the client negotiates access instead, so nothing sensitive is written to disk. Substitute it for the plain endpoint in any of the commands on this page.
Worth being straight about the status of this one. It is not documented upstream, so it is the less-travelled path and may change without notice. The plain remote endpoint is the one to use if you want the boring, well-trodden option.
Installing without npx, and what ctx7 setup does
Everything above is the remote HTTP path. It downloads nothing, spawns no local process, and needs no Node runtime, because the server runs at https://mcp.context7.com/mcp and your client simply talks to it. If you came looking for how to install this without npx, that is the answer: use the add command on this page and stop there.
There are two local alternatives, and both put a Node process on your machine. npx ctx7 setup is the official CLI installer, which detects your editors and writes their config for you. It is the quickest route if you want several clients configured at once and do not mind the dependency. Running the server locally instead is claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
The local path is also where spawn context7-mcp ENOENT comes from, since it depends on a binary being resolvable. The remote endpoint cannot produce that error because there is no binary. Prefer remote unless you specifically need a local process.
- Remote HTTP: no Node, no install, nothing running locally. Recommended.
- Official CLI installer, configures editors for you: npx ctx7 setup
- Local server over stdio: claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY
Do you need the plugin marketplace?
No. A remote MCP server is added with the command on this page, and the plugin marketplace is a different mechanism for a different kind of extension. There is nothing to browse or install there to make this work.
If you arrived from a guide telling you to find Context7 in a marketplace listing, that guide is describing a route you do not need. Run the add command, restart, and check claude mcp list.
Cursor, VS Code, Claude Desktop, Windsurf
Those clients do not use claude mcp add. Cursor and Windsurf take JSON under mcpServers with url https://mcp.context7.com/mcp. VS Code wants a servers key plus type http in .vscode/mcp.json, which is the most common thing to get wrong. Claude Desktop takes a custom connector under Settings, because its config file is the local stdio path. Client pages: /cursor, /vscode, /claude, /windsurf.
Where to go next
If you landed here from a search, stay on mcpcontext7.com. Claude Code uses the command above. Other editors use the JSON on /cursor, /vscode, /claude, and /windsurf. API keys: context7.com/dashboard. Endpoint: https://mcp.context7.com/mcp
Questions
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 remote server URL?
https://mcp.context7.com/mcp
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.
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