Skip to content
MCP Shelf

Pod to App: Claude Code

How to install Context7 in Claude Code

By Sophie Filer · Updated 10 Nov 2026 · Steps checked against Context7's own docs on 10 Nov 2026

The short answer

Run npx ctx7 setup --claude and follow the prompts. It signs you in, makes a free API key and connects Claude Code for you. Then add "use context7" to a prompt, or a rule in CLAUDE.md, and Claude Code looks up current docs before it writes code.

Terminal (Node.js 22.13 or newer)
npx ctx7 setup --claude
Needs
Node.js 22.13+ for setup
Sign-in
Free API key
Runs on
Hosted, or local via npx
Tools
2: find library, get docs

What the setup command does

  1. Step 1: Run npx ctx7 setup --claude in your terminal. Without --claude it asks which agent to set up.
  2. Step 2: Sign in in the browser when asked. The tool creates an API key for you.
  3. Step 3: Choose a mode. MCP adds the Context7 server to Claude Code. CLI + Skills instead installs a skill that has Claude Code call the ctx7 command, with no MCP server at all.
  4. Step 4: Restart Claude Code and run /mcp (MCP mode) to see context7 and its two tools.
  5. Step 5: Ask a version-sensitive question: "How do I set up a Next.js 16 proxy? use context7".

Changed your mind? npx ctx7 remove undoes what setup added.

Or add the server yourself

Get a free key from your Context7 dashboard, then pick one of these. The key is optional, but it raises your rate limits.

Terminal: hosted server
claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp
Terminal: local server through npx
claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY

--scope user makes it available in every project, which suits a docs tool. The hosted version needs nothing running locally; the local one needs Node.js.

Make Claude Code actually use it

Context7 only helps when it is called. Four habits make that reliable:

HabitExample
Say it in the prompt"...use context7"
Name the library ID to skip the search step"use library /supabase/supabase for the auth part"
Mention the version"for Next.js 16", so it pulls docs for that release
Add a rule to CLAUDE.md"Always use Context7 when I need library or API documentation, setup or configuration steps, without me asking."

Setup in MCP or skills mode adds a skill that triggers on library questions, so the rule is mainly for manual installs.

The two tools

  • resolve-library-id turns a name like "next.js" into a Context7 ID such as /vercel/next.js.
  • query-docs fetches the relevant part of that library's docs for your question.

Because there are only two, Context7 adds very little to the tool list, unlike servers with dozens of tools.

If it does not work

What you seeWhat to do
npx ctx7 setup fails at onceIt needs Node.js 22.13 or newer. Check node --version, or use a manual command above.
Rate limit or 429 errorsYou are using it without a key, or the key is wrong. Add one from the dashboard.
context7 is connected but never calledAdd "use context7" to the prompt or the rule to CLAUDE.md.
It picks the wrong libraryGive the exact library ID, which you can find with npx ctx7 library <name> <question>.

MCP Shelf take

Is Context7 worth adding to Claude Code?

Context7 fixes a narrow but daily problem: Claude Code writing code for last year's version of a library. For fast-moving tools such as Next.js, Supabase or Tailwind it is worth the minute it takes to set up, and its two tools barely touch your context. Use ctx7 setup and let it add the skill, or add the CLAUDE.md rule, otherwise you will forget to ask for it. If you mostly work with stable, well-known libraries, you will notice it less.

Sophie Filer

Questions

Is Context7 free in Claude Code?

Yes, you can use it for free. An API key from the Context7 dashboard costs nothing and gives you higher rate limits than using it without one.

Should I pick MCP or CLI + Skills during setup?

Both give Claude Code the same docs. MCP adds a server with two tools; CLI + Skills has Claude Code run the ctx7 command instead, with no server. Pick MCP if you want it to show up in /mcp like your other servers.

Do I have to type "use context7" every time?

Not if you add a rule to CLAUDE.md asking Claude Code to use Context7 for library docs, or install with ctx7 setup, which adds a skill that triggers on library questions.

How do I remove Context7 from Claude Code?

Run npx ctx7 remove if you used setup, or claude mcp remove --scope user context7 if you added it by hand.

Sources: the steps on this page are written in our own words from Context7's own install docs, the README. If they disagree with this page, the project's docs win; please tell us from the server page.