---
title: "Context7 MCP: Current Library Docs Inside Your Prompt"
url: "https://mcpshelf.co/servers/context7"
description: "Context7 feeds version-specific docs for thousands of libraries to your assistant, so it stops guessing at APIs. Local and hosted setup, and API keys."
updated: "2026-10-27"
site: "MCP Shelf"
---

# Context7

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

Source: https://mcpshelf.co/servers/context7  
Markdown: https://mcpshelf.co/servers/context7.md  
Generated: 2026-11-25T10:11:00.543Z

## Facts

- **Name:** Context7
- **Tagline:** Pulls current, version-specific library docs into the conversation.
- **Description:** Context7 is an MCP server from Upstash that pulls current, version-specific library documentation and code examples into an AI assistant's context.
- **Repository:** https://github.com/upstash/context7
- **Package:** @upstash/context7-mcp 4.4.4 (npm)
- **Install:** `npx ctx7 setup`
- **Server URL:** https://mcp.context7.com/mcp
- **Transport:** stdio (local), or HTTP via the hosted server
- **Auth:** No required keys or settings listed
- **Tools exposed:** 2: `resolve-library-id`, `query-docs`
- **Category:** Developer tools (https://mcpshelf.co/categories/developer-tools)
- **Stats:** 63.8K GitHub stars, 440.9K downloads a week, last commit 28 Oct 2026, 1 upvote on MCP Shelf
- **Install check:** Started in our test
- **Listed:** 2026-10-26
- **Page updated:** 2026-10-27

## Full description

### 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.**

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 |
| GitHub | https://github.com/upstash/context7 |
| Licence | MIT |
| npm package | [@upstash/context7-mcp](https://www.npmjs.com/package/@upstash/context7-mcp) 4.4.4 (19 Oct 2026) |
| GitHub stars | 63.8K |
| Downloads | 440.9K a week |
| Last commit | 28 Oct 2026 |
| Tools | 2 |
| Runs on | Your computer or hosted |
| Install check | Started in our test |
| Category | [Developer tools](https://mcpshelf.co/categories/developer-tools) |
| Works with | Claude Code, Cursor, Claude Desktop, VS Code, Codex, Windsurf, ChatGPT |
| Setup checked | 27 Oct 2026 |
| Page updated | 27 Oct 2026 |

**Our check:** We ran this exact config on 26 Oct 2026: it started and answered with 2 tools.

#### Try asking Context7

- "Using the current Next.js docs, show me how to add a route handler that streams a response. use context7"
- "What changed in the Prisma client API between versions 5 and 6? use context7"
- "Write a Tailwind v4 config for dark mode, checking the latest docs first. use context7"

#### 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 sits 3rd of 27 in its category on our shelf by GitHub stars (63.8K, with 440.9K downloads a week).

— MCP Shelf tests (numbers from our own runs), tested on 26 Oct 2026

### What tools does Context7 have?

We listed 2 tools on 26 Oct 2026. Every one of them only reads.

| Tool | Kind | What it is for |
| --- | --- | --- |
| `resolve-library-id` | reads | Turns a plain library name like "next.js" into the Context7 id that query-docs needs. |
| `query-docs` | reads | Pulls the current docs and code samples for one library, ranked against your question and, if you say, your language. |

#### How clearly it describes its tools

2 of 2 tools have a description and 2 of 2 say whether they change things. The tool list takes at least ~700 tokens of context. Every tool says whether it only reads or can change things, so a client can ask before the risky ones.

### How do I install Context7?

#### Install steps from the Context7 README

Copied from the project's [README on GitHub](https://github.com/upstash/context7#readme) on 10 Nov 2026 under its MIT licence.

##### Installation

> **Note:** **API Key Recommended**: Get a free API key at [context7.com/dashboard](https://context7.com/dashboard?tab=settings) 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 →](https://context7.com/docs/resources/all-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)

#### Fastest way: one command

```bash
npx ctx7 setup
```

This is the route Context7's README leads with. It signs you in with OAuth, creates an API key and sets up Cursor, Claude Code or OpenCode for you (add --cursor, --claude or --opencode to pick one). It asks whether you want MCP mode or CLI plus skills. It needs Node.js 22.13 or newer, and npx ctx7 remove undoes it.

#### Claude Code

Where: Your terminal

```bash
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

#### Cursor

Where: ~/.cursor/mcp.json, or .cursor/mcp.json in a project

```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ]
    }
  }
}
```

To use the hosted server instead, replace the entry with "url": "https://mcp.context7.com/mcp" and an Authorization: Bearer header carrying your key. Cursor Settings → Tools & MCP → New MCP Server opens the same file.

#### Claude Desktop

Where: claude_desktop_config.json (Settings → Developer → Edit Config)

```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ]
    }
  }
}
```

Or skip Node.js: add https://mcp.context7.com/mcp/oauth under Settings → Connectors → Add custom connector and sign in.

#### VS Code

Where: .vscode/mcp.json in your project

```json
{
  "servers": {
    "context7": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ]
    }
  }
}
```

#### Codex

Where: ~/.codex/config.toml, shared by the Codex CLI, IDE extension and ChatGPT desktop app

```
[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]
```

Or run: `codex mcp add context7 -- npx -y @upstash/context7-mcp`

#### Windsurf

Where: ~/.codeium/windsurf/mcp_config.json

```json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ]
    }
  }
}
```

#### ChatGPT

Where: chatgpt.com/plugins → + → Add custom MCP server

```
https://mcp.context7.com/mcp/oauth
```

Use the hosted server with OAuth as the authentication, create it as a plugin and install it. In a chat, type @ and pick Context7.

#### 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.

```
https://mcp.context7.com/mcp
```

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

### How do I configure Context7?

| Setting | Kind | Required | What it does |
| --- | --- | --- | --- |
| `https://mcp.context7.com/mcp` | config | no | The hosted server address. Point any client that supports remote servers here and nothing runs on your machine. |
| `Authorization: Bearer` | config | no | Header carrying your Context7 API key when you use the hosted address. Optional, but it lifts the rate limit. Example: `Authorization: Bearer ctx7sk-xxxx` |
| `--api-key` | flag | no | Your API key when you run the npm package locally instead. Example: `--api-key ctx7sk-xxxx` |
| `CONTEXT7_API_KEY` | env | no | The same key set through the environment for the local package. |

### 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.

### 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

### 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.

### What are the alternatives to Context7?

| Server | What it does | Tools | Runs on | Licence | Stars |
| --- | --- | --- | --- | --- | --- |
| [Context7](https://mcpshelf.co/servers/context7) | Pulls current, version-specific library docs into the conversation. | 2 | Your computer or hosted | MIT | 63.8K |
| [Ref MCP](https://mcpshelf.co/servers/ref) | Docs search for coding agents that returns only the part of the page that matters. | 2 | Your computer or hosted | MIT | 1.2K |
| [Grounded Docs (docs-mcp-server)](https://mcpshelf.co/servers/grounded-docs) | Your own index of library docs, by version, that an assistant searches before it answers. | 12 | Your computer | MIT | 1.8K |
| [GitMCP](https://mcpshelf.co/servers/gitmcp) | A hosted server that reads any public GitHub repo's docs and code on request. | 5 | Hosted | Apache-2.0 | 8.5K |
| [shadcn/ui MCP](https://mcpshelf.co/servers/shadcn-ui) | Real shadcn/ui component source, demos and blocks, so the model stops guessing. | 10 | Your computer | MIT | 3.1K |
| [Microsoft Learn MCP](https://mcpshelf.co/servers/microsoft-learn) | Official Microsoft docs and code samples for your assistant, free and with no sign-in. | 3 | Hosted | CC-BY-4.0 | 2K |

### 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.

#### Can I use Context7 in VS Code?

Yes, through GitHub Copilot. In .vscode/mcp.json, add a server named context7 with type stdio that runs npx -y @upstash/context7-mcp. Then switch Copilot Chat to Agent mode to use its tools.

#### Does Context7 work with Codex?

Yes. Run codex mcp add context7 -- npx -y @upstash/context7-mcp in a terminal, or add an [mcp_servers.context7] table to ~/.codex/config.toml, which the Codex CLI and IDE extension share.

Full docs on GitHub: https://github.com/upstash/context7

## Notes for agents

Fetch these instead of parsing the HTML page:

- llms.txt: https://mcpshelf.co/llms.txt
- llms-full.txt: https://mcpshelf.co/llms-full.txt
- ai.txt: https://mcpshelf.co/ai.txt
- Full catalog (.md): https://mcpshelf.co/catalog.md
- API spec: https://mcpshelf.co/openapi.json
- MCP server: https://mcpshelf.co/mcp
- MCP manifest: https://mcpshelf.co/.well-known/mcp.json
- Developer docs: https://mcpshelf.co/developers

MCP endpoint (Streamable HTTP, no key): https://mcpshelf.co/mcp. REST API: https://mcpshelf.co/api/v1.

