Claude Code knows a lot about popular libraries, but what it knows has a date on it. When a framework renames something (Next.js 16 renamed Middleware to Proxy), Claude can confidently write the old way. Context7 is an MCP server that fetches the current docs for a library, for the version you name, while Claude is answering. Adding it takes one command, and you don't need an account or a key.
Give this to Claude
Claude Code checks your version, makes sure Context7 isn't already set up, adds it for your user account and shows you the line that says it connected. It changes nothing else.
Paste it into Claude Code, opened in any folder.
Connect the Context7 MCP server to Claude Code for my user account, then check it works.
1. Run `claude --version` and tell me the version.
2. Run `claude mcp list`. If a server called context7 is already listed, stop and tell me: don't add a second one.
3. Run this, exactly: claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcp
4. Run `claude mcp list` again and show me the line for context7. It should end in "✔ Connected". If it says "Failed to connect", stop and tell me; that is usually a network or proxy problem, not the command.
5. Tell me to start a new Claude Code session so the new tools load, and give me one prompt to try in it: How do I set up a proxy in Next.js 16? use context7
Don't add an API key and don't change any other setting.Steps
Step 1: Check Claude Code is installed
Open a terminal and run:
Run in your terminalbash claude --versionYou should see a version number, like
2.1.310 (Claude Code). If you see "command not found", install Claude Code first and sign in.Step 2: See what is connected now
Run in your terminalbash claude mcp listOn a new setup this prints
No MCP servers configured.If you already see a line with context7 in it, it is set up: skip to step 5.Step 3: Add Context7
This adds the hosted Context7 server for your user account, so it works in every project on this computer:
Run in your terminalbash claude mcp add --scope user --transport http context7 https://mcp.context7.com/mcpIt answers:
What you should seetext Added HTTP MCP server context7 with URL: https://mcp.context7.com/mcp to user config File modified: /Users/you/.claude.jsonThe
--scope userpart is what makes it work everywhere. Leave it out and Claude Code adds it to the current folder only.Step 4: Check the connection
Run in your terminalbash claude mcp listThe line for Context7 should end in a tick:
What you should seetext context7: https://mcp.context7.com/mcp (HTTP) - ✔ ConnectedStep 5: Check Claude Code uses it
Start a new Claude Code session (the tools load when a session starts) and ask something whose answer changed recently. Add "use context7" so it knows to look:
Paste into a new Claude Code sessiontext How do I set up a proxy in Next.js 16? use context7In the session you'll see two tool calls before the answer:
resolve-library-id(Context7 finding the library) andquery-docs(reading its docs). If both appear, it is working. On the clean run for this page (24 October 2026) the answer opened with "In Next.js 16, Middleware has been renamed to Proxy", which is the current behaviour.
If something goes wrong
"✘ Failed to connect"
The command was right; your computer couldn't reach mcp.context7.com. This is usually a company network, a VPN or a proxy. Try another network to confirm, then ask whoever runs your network to allow the address.
Context7 is already there under another name
claude mcp list may show claude.ai Context7 (a connector from your claude.ai account) or plugin:context7:context7 (from a Claude Code plugin). Either one already gives Claude Code Context7. Don't add a second one; use what you have. The plugin's entry may say "Needs authentication": type /mcp in a session and sign in from there.
"Pending approval" next to other servers
If you run claude mcp list inside a project that has its own .mcp.json, you'll see that project's servers too, marked "Pending approval" until you allow them. They aren't Context7 and don't affect it.
Claude answers without calling Context7
Check you started a new session after adding it, and that your prompt includes "use context7". To make it automatic, add one line to your project's CLAUDE.md: "Use Context7 when you need library or API documentation."
It works, then stops answering for a while
The free, keyless service has rate limits. If you use it heavily, create a free API key at context7.com and add it with the header option in Context7's own instructions. Paste the key into your terminal only, never into a chat.
Common mistakes
- **Leaving out
--scope user.** The server is then added for the folder you were in, and seems to vanish in every other project. - Testing in the same session. Tools load when a session starts. Start a new one after adding it.
- Pasting an API key into Claude. You don't need one to start. If you add one later, type it in your own terminal.
- **Running
claude mcp getfor a screenshot.** It prints the server's settings in full, including any key you added. Useclaude mcp listinstead.
Remove it
One command undoes it:
claude mcp remove --scope user context7
