Skip to content
MCP Shelf

Context7 MCP Server

Pulls current, version-specific library docs into the conversation.

View on GitHub
  • Started in our test
  • ★ 63.8K GitHub stars
  • 440.9K downloads a week
  • Last commit 28 Oct 2026

What is Context7?

Context7 is an MCP server from Upstash that pulls current, version-specific library documentation and code examples into an AI assistant's context.

Tools
2
Runs on
Your computer or hosted
Licence
MIT
GitHub stars
63.8K

Good for

  • Fast-moving frameworks (Next.js, Tailwind, the AI SDKs) where training data is stale
  • Asking for code against a specific version
  • Cutting down on invented function names

You'll need

  • Node.js 22.13 or newer for the ctx7 setup command, or Node.js 18 or newer for the local server alone
  • A free Context7 API key from context7.com/dashboard for higher rate limits (recommended)

Started in our testWe ran this exact config on 26 Oct 2026: it started and answered with 2 tools.

MCP Shelf take

We started Context7 on our own test machine on 26 Oct 2026 and it answered with 2 tools. Both only read, so it cannot change anything on its own. Every tool comes with a useful description, all of them say whether they change things, and the tool list costs about 700 tokens of context before you ask a thing. It is the most-starred of the 21 servers in its category on our shelf (63.8K stars, with 440.9K downloads a week).
MCP Shelf tests: numbers from our own runs, not the README · tested on 26 Oct 2026

What can Context7 read and change?

It can read

  • Context7's public index of library docs, fetched over the internet
  • Only the question text you send, not your code

It can change

  • Nothing on your machine or in your project

Safer setup: It is read-only already. If you prefer not to send queries to a third party, keep it out of projects that discuss private code names.

Context7 in more detail

Models learn a library at one moment in time and then keep using that version. Context7 looks up the library you are working with and returns current documentation and examples, so the code you get matches the version you have installed.

It has two tools: one turns a library name into a Context7 ID, the other fetches docs for that ID, optionally narrowed to a topic.

Made by
Upstash
Latest version
4.4.4 (19 Oct 2026)
Downloads
440.9K a week
Last commit
28 Oct 2026
Setup checked
27 Oct 2026
Page updated
27 Oct 2026

What's in the pod

What tools does Context7 have?

We found 2 tools when we started it on 26 Oct 2026. Every one of them only reads, so nothing changes unless you act on what it finds.

Only reads2 tools · Looks things up and changes nothing.

ToolWhat it is for
query-docsPulls the current docs and code samples for one library, ranked against your question and, if you say, your language.
resolve-library-idTurns a plain library name like "next.js" into the Context7 id that query-docs needs.

Grouped and described by us. The README on GitHub lists the inputs each tool takes.

How clearly it describes its tools to your assistant

Tools with a description
2 of 2
Say if they change things
2 of 2
Context it takes, at least
~700 tokens

Every tool says whether it only reads or can change things, so a client can ask before the risky ones.

From the tool list it sent us. The token figure counts names, descriptions and input names; the full schemas your client loads add more.

How do I install Context7?

Install steps from the Context7 README

The project's own instructions, copied from its README on GitHub on 27 Oct 2026 under its MIT licence. They are the source of truth; the ready-made configs further down are built from them. The rest of the README is in the README tab.

Installation

Note: API Key Recommended: Get a free API key at context7.com/dashboard for higher rate limits.

Set up Context7 for your coding agents with a single command. The ctx7 CLI requires Node.js 22.13 or newer.

npx ctx7 setup

Authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI + Skills or MCP mode. Use --cursor, --claude, or --opencode to target a specific agent.

To remove the generated setup later, run npx ctx7 remove. If you globally installed the CLI with npm install -g ctx7, remove that package separately with npm uninstall -g ctx7.

To configure manually, use the Context7 server URL https://mcp.context7.com/mcp with your MCP client and pass your API key via the Authorization: Bearer YOUR_API_KEY header. See the link below for client-specific setup instructions.

Manual Installation / Other Clients →

What you need first

  • Node.js 22.13 or newer for the ctx7 setup command, or Node.js 18 or newer for the local server alone
  • A free Context7 API key from context7.com/dashboard for higher rate limits (recommended)

Add Context7 to your app

Pick your app for a ready-to-paste snippet and where it goes, built from the steps above.

Where it goes: Your terminal

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

The key is optional but lifts the rate limits; get a free one at context7.com/dashboard. For the hosted server instead: claude mcp add --scope user --header "Authorization: Bearer YOUR_API_KEY" --transport http context7 https://mcp.context7.com/mcp

Remote option

Upstash also runs it as a remote server, which is the easy route for ChatGPT and other clients that only take a URL.

Server URL
https://mcp.context7.com/mcp

Checked against the project's own install docs on 27 Oct 2026: upstash/context7 README, context7.com/docs/resources/all-clients.

Did this work for you?

Projects change their install steps often. If Context7 did not install, or something here no longer matches the project, tell us and we will check it against the README and fix the page.

New to this? See the setup guides for Claude Code, Cursor, Claude Desktop, VS Code, Codex and ChatGPT. If it will not start, test it in MCP Inspector and look up the error in Fixing MCP server errors.

Context7 not working? Common fixes

Rate limit or 429 errors
Get a free key from the Context7 dashboard and add it as the Bearer header or --api-key.
The agent never calls Context7
Add "use context7" to your prompt, or add a standing rule in CLAUDE.md or Cursor rules telling it to fetch docs for any library question.
It picks the wrong library
Name the id yourself with slash syntax, for example /vercel/next.js, so the lookup step is skipped.
npx ctx7 setup fails
The CLI needs Node.js 22.13 or newer. Check node --version and upgrade.

How do I configure Context7?

Names are exactly as the project spells them. Required ones are marked.

SettingWhat it does
https://mcp.context7.com/mcpConfigThe hosted server address. Point any client that supports remote servers here and nothing runs on your machine.
Authorization: BearerConfigHeader carrying your Context7 API key when you use the hosted address. Optional, but it lifts the rate limit.Authorization: Bearer ctx7sk-xxxx
--api-keyCommand line flagYour API key when you run the npm package locally instead.--api-key ctx7sk-xxxx
CONTEXT7_API_KEYEnvironment variableThe same key set through the environment for the local package.

Context7 FAQ

How do I install Context7 in Claude Code?

The quickest way is npx ctx7 setup --claude, which signs you in, creates an API key and adds Context7 for you. By hand, run claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp --api-key YOUR_API_KEY, or use the hosted server at https://mcp.context7.com/mcp.

How do I add Context7 to Cursor?

Open Cursor Settings → Tools & MCP → New MCP Server and paste either the npx config or the hosted one, {"url": "https://mcp.context7.com/mcp"} with an Authorization header for your key. npx ctx7 setup --cursor does it for you.

Does Context7 work with ChatGPT?

Yes. Add https://mcp.context7.com/mcp/oauth as a custom MCP server on chatgpt.com/plugins with OAuth sign-in, install the plugin, then type @ in a chat and choose Context7. Workspace admins can block custom servers.

Is Context7 free?

Yes. The MCP server is MIT licensed and the hosted service answers without a key. A free API key from the Context7 dashboard raises the rate limits, which matters if you hit 429 errors.

Do I need a Context7 API key?

No, but it is recommended. Without one you share anonymous rate limits. Pass the key with --api-key for the local server, as an Authorization: Bearer header for the hosted one, or use the /mcp/oauth address and sign in instead.

Why does my assistant not use Context7?

Most agents only call it when asked, so add use context7 to the prompt or a rule that says to fetch library docs through it. Naming the library and version, such as Next.js 14, also helps it pick the right entry.

Is Context7 safe?

Its two tools only read: one finds a library's ID and the other fetches docs for it. Your questions go to Upstash's service, though, so leave it out of chats that mention private project names you would not want sent to a third party.

Can Context7 fetch docs for an older version?

Yes, where the index has it. Put the version in the question and Context7 matches it. If a library is missing altogether you can submit it on the Context7 website, since the index is built from public repositories and docs sites.

Context7 README

This is the project's own README from upstash/context7, written by Upstash, and shared under its MIT licence. We copied it on 27 Oct 2026, so the version on GitHub may be newer.

Cover

Context7 - Up-to-date Docs for AI Agents

❌ Without Context7

LLMs rely on outdated or generic information about the libraries you use. You get:

  • ❌ Code examples are outdated and based on year-old training data
  • ❌ Hallucinated APIs that don't even exist
  • ❌ Generic answers for old package versions

✅ With Context7

Context7 pulls up-to-date, version-specific documentation and code examples straight from the source — and gives them to your coding agent.

Create a Next.js proxy that checks for a valid JWT in cookies
and redirects unauthenticated users to `/login`. use context7
Configure a Cloudflare Worker script to cache
JSON API responses for five minutes. use context7
Show me the Supabase auth API for email/password sign-up.

Context7 fetches up-to-date code examples and documentation right into your coding agent's context. No tab-switching, no hallucinated APIs that don't exist, no outdated code generation.

Works in two modes:

  • CLI + Skills — installs a skill that guides your agent to fetch docs using ctx7 CLI commands (no MCP required)
  • MCP — registers a Context7 MCP server so your agent can call documentation tools natively

Installation

Note: API Key Recommended: Get a free API key at context7.com/dashboard for higher rate limits.

Set up Context7 for your coding agents with a single command. The ctx7 CLI requires Node.js 22.13 or newer.

npx ctx7 setup

Authenticates via OAuth, generates an API key, and installs the appropriate skill. You can choose between CLI + Skills or MCP mode. Use --cursor, --claude, or --opencode to target a specific agent.

To remove the generated setup later, run npx ctx7 remove. If you globally installed the CLI with npm install -g ctx7, remove that package separately with npm uninstall -g ctx7.

To configure manually, use the Context7 server URL https://mcp.context7.com/mcp with your MCP client and pass your API key via the Authorization: Bearer YOUR_API_KEY header. See the link below for client-specific setup instructions.

Manual Installation / Other Clients →

Important Tips

Use Library Id

If you already know exactly which library you want to use, add its Context7 ID to your prompt. That way, Context7 can skip the library-matching step and directly retrieve docs.

Implement basic authentication with Supabase. use library /supabase/supabase for API and docs.

The slash syntax tells Context7 exactly which library to load docs for.

Specify a Version

To get documentation for a specific library version, just mention the version in your prompt:

How do I set up a Next.js 16 proxy? use context7

Context7 will automatically match the appropriate version.

Add a Rule

If you installed via ctx7 setup, a skill is configured automatically that triggers Context7 for library-related questions. To set up a rule manually instead, add one to your coding agent:

  • Cursor: Cursor Settings > Rules
  • Claude Code: CLAUDE.md
  • Or the equivalent in your coding agent

Example rule:

Always use Context7 when I need library/API documentation, code generation, setup or configuration steps without me having to explicitly ask.

Available Tools

CLI Commands
  • ctx7 library <name> <query>: Searches the Context7 index by library name and returns matching libraries with their IDs.
  • ctx7 docs <libraryId> <query>: Retrieves documentation for a library using a Context7-compatible library ID (e.g., /mongodb/docs, /vercel/next.js).
MCP Tools
  • resolve-library-id: Resolves a general library name into a Context7-compatible library ID.
    • query (required): The user's question or task (used to rank results by relevance)
    • libraryName (required): The name of the library to search for
  • query-docs: Retrieves documentation for a library using a Context7-compatible library ID.
    • libraryId (required): Exact Context7-compatible library ID (e.g., /mongodb/docs, /vercel/next.js)
    • query (required): The question or task to get relevant documentation for
    • language (optional): The programming language you write in, used to rank code examples in that language first

More Documentation

Packages

Disclaimer

1- Context7 projects are community-contributed and while we strive to maintain high quality, we cannot guarantee the accuracy, completeness, or security of all library documentation. Projects listed in Context7 are developed and maintained by their respective owners, not by Context7. If you encounter any suspicious, inappropriate, or potentially harmful content, please use the "Report" button on the project page to notify us immediately. We take all reports seriously and will review flagged content promptly to maintain the integrity and safety of our platform. By using Context7, you acknowledge that you do so at your own discretion and risk.

2- This repository hosts the MCP server’s source code. The supporting components — API backend, parsing engine, and crawling engine — are private and not part of this repository.

🤝 Connect with Us

Stay updated and join our community:

📺 Context7 In Media

📄 License

MIT

Two peas, one chat

Chat with AI about Context7

Opens a chat primed with Context7’s README and setup docs from this page, or add it in Cursor to use its tools.

The Cursor button opens Cursor and asks before it adds the server. Fill in any keys it needs in Cursor’s MCP settings.

Peas in a pod

What are the alternatives to Context7?

How Context7 lines up against its neighbours on the shelf. See every developer tools server.

  • Context7This pea

    Pulls current, version-specific library docs into the conversation.

    Tools
    2
    Runs on
    Your computer or hosted
    Licence
    MIT
    Stars
    63.8K
  • GitHub

    GitHub's own server for repos, issues, pull requests and Actions.

    Tools
    46
    Runs on
    Hosted or your computer
    Licence
    MIT
    Stars
    34K
  • MCP Inspector

    The official debugging UI for MCP servers. Not a server you add to a client.

    Tools
    Test client
    Runs on
    Your computer
    Licence
    MIT / Apache-2.0
    Stars
    11.2K
  • XcodeBuildMCP

    Build, run and test iOS and macOS apps, and drive simulators, from an agent.

    Tools
    24
    Runs on
    Your computer
    Licence
    MIT
    Stars
    6.5K
  • Peekaboo

    Screenshots of any Mac app or screen, with optional questions about what is on it.

    Tools
    4 groups
    Runs on
    Your computer
    Licence
    MIT
    Stars
    5.4K
  • Kubernetes MCP Server

    Pods, logs, events and resources from your current kubeconfig context.

    Tools
    14
    Runs on
    Your computer
    Licence
    Apache-2.0
    Stars
    2.2K
Full docs on GitHubupstash/context7

Something wrong on this page? Tell us.

For bots & AI agents

Machine-readable versions of Context7 and MCP Shelf. Fetch these instead of parsing this page.

This listing (.md)llms.txtllms-full.txtai.txtFull catalog (.md)API specMCP serverMCP manifestDeveloper docs