# Context7

> Up-to-date library docs pulled directly into your AI context.

[Canonical HTML page](https://top-mcps.com/mcp/context7) · [server.json](https://top-mcps.com/mcp/context7.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

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

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
claude mcp add context7 -- npx -y @upstash/context7-mcp
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

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

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

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

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

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

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

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

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

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

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.context7]
command = "npx"
args = [
  "-y",
  "@upstash/context7-mcp",
]
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "context7": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@upstash/context7-mcp"
        ]
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Apps directory`

Context7 doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** Upstash
- **Transport:** stdio, Streamable HTTP
- **Auth model:** None
- **Required secrets:** None
- **Supported clients:** Claude, Cursor, Zed, Any MCP-compatible client
- **License:** MIT
- **Language:** TypeScript
- **Latest version:** latest
- **Last verified:** 2026-05-31
- **GitHub stars:** 53,171 (fetched 2026-06-02T11:55:51.530Z)
- **Score:** 84/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/upstash/context7

## Security & scope

- **Access scope:** network
- **Sandbox:** Public Context7 API; no credentials required. Read-only fetch of library documentation.
- **Gotchas:**
  - Library coverage is whatever Context7 has indexed — freshness varies by library.

## Quick answer

**What it does.** Retrieves up-to-date, version-specific documentation for popular libraries and injects it into the model context before answering coding questions.

**Best for:**
- Library API lookup
- Framework usage patterns
- Version-specific code examples
- Reducing AI hallucinations
- Documentation Q&A

**Not for:**
- Internal/private library docs
- General reasoning tasks
- Non-coding questions

## Recipes

### Pull current docs for a specific library API

```
Fetch the current Next.js 15 App Router docs for `generateStaticParams` via Context7 and explain in three sentences how it differs from the pages-router `getStaticPaths`.
```

_Tested with: Claude Desktop, Cursor_

## Description

Context7 fetches current, version-specific documentation for libraries and frameworks directly into your AI context. Instead of hallucinated APIs, the model gets actual docs from the source. A must-have for any developer using AI for coding assistance.

## Why it matters

Models hallucinate outdated APIs constantly. Context7 eliminates this by grounding every answer in real, current documentation.

## Key features

- Real-time documentation fetch
- Version-specific results
- Wide library coverage
- Built for coding workflows
- Reduces API hallucinations

## FAQ

### Which libraries does Context7 support?

Thousands of the most-used open-source libraries — React, Next.js, Supabase, Tailwind, Prisma, Drizzle, FastAPI, and most popular npm/PyPI packages. If a library is missing, Context7 accepts submissions on GitHub and usually indexes new ones within a few days.

### Does it cost money?

No. It is free with no API key for the public version. Upstash offers a paid "Context7 for Teams" tier that adds private doc indexing and analytics; you never need it for individual use.

### How is this different from the model already knowing the library?

Training data is frozen and often a year old — models hallucinate API shapes that have since changed. Context7 injects the *current* docs for the exact version you ask about, which eliminates the "looks right but calls a removed method" failure mode.

### How do I pin a specific version?

Include the version in your prompt: "use context7 for next 15.1". The server resolves the matching docset and returns only relevant snippets, scoped to your topic. Without a version it defaults to the latest stable release.

### Does it work with private or internal libraries?

The free MCP only knows about public packages. For internal libraries you either publish their docs publicly, mirror them into a local Fetch MCP workflow, or use the paid Context7 offering that supports private corpora.

### Why do IDE users rate this higher than plain web search?

Two reasons: the results are already in Markdown chunks sized for the context window, and they are pre-filtered to the library you asked about. A web search returns ten blog posts; Context7 returns the method signature plus one working example.

## Changelog

- **2026-05-31** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-01-10** — Initial directory listing.
