Suggest a server AI tools directory →

Context7 MCP server

Last verified: 2026-09

Up-to-date library docs pulled into the prompt.

Community Developer tools Needs a secret Claude Desktop, Cursor, Windsurf, Claude Code, VS Code

What it does

Upstash Context7: resolve a library name to an id, then pull current docs. Use it when the model is about to invent an old API. Optional CONTEXT7_API_KEY raises rate limits.

It sits in Developer tools: Split this category in two.

Good for

  • resolve-library-id for 'next.js', then query-docs for the version you are on.
  • Stop the model from inventing a React API that died two majors ago.
  • Pin a version in the query so v3 and v4 docs do not mix.
  • Prefer this before installing five framework-specific generators.

Tools

  • resolve-library-id — Map 'next.js' → a Context7 library id.
  • query-docs — Fetch docs for that id (pin a version when you can).

Config (Claude Desktop / Cursor / Windsurf)

Paste the JSON below. Same mcpServers shape. Replace placeholder paths and secrets. Windows paths look like C:\\Users\\you\\project, not /path/to. Host-side steps →

Claude Desktop

OSConfig file
macOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json (usually C:\Users\<you>\AppData\Roaming\Claude\)
Linux~/.config/Claude/claude_desktop_config.json

Cursor

ScopemacOS / LinuxWindows
This project.cursor/mcp.json in the repo root
This user~/.cursor/mcp.json %USERPROFILE%\.cursor\mcp.json

Windsurf

OSConfig file
macOS / Linux~/.codeium/windsurf/mcp_config.json
Windows%USERPROFILE%\.codeium\windsurf\mcp_config.json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ],
      "env": {
        "CONTEXT7_API_KEY": "optional"
      }
    }
  }
}

Windsurf remote MCP: use serverUrl instead of url if the block below is HTTP.

One-liner: npx -y @upstash/context7-mcp

Secrets it wants: optional CONTEXT7_API_KEY

Source repo →

How to get started

  1. npx -y @upstash/context7-mcp. Key is optional.
  2. In the host, tell it to use Context7 and pass a library id when you know it.
  3. Pin versions in the query so it does not mix v3 and v4 docs.

Access risk

Low. It reads public docs. The key is a quota token, not your cloud account.

When to skip it

Skip it for your own repo (Filesystem) or for a single README URL (Fetch).

Instead: Fetch, GitHub, shadcn/ui.

Vs alternatives

ServerOfficial?Needs a secret?Best for
Context7NoYesUp-to-date library docs pulled into the prompt.
FetchYesYesFetch a URL and turn the page into readable text.
GitHubYesYesRepos, issues, PRs, and file contents on GitHub.
shadcn/uiNoNoAdd shadcn components from the registry.

More in Developer tools

All 18 in this category →

FAQ

Do I need a key?

Optional CONTEXT7_API_KEY raises rate limits. Public docs work without it.

Context7 or Fetch on the docs URL?

Context7 if you do not have the URL. Fetch if you already know the page.

Does it read my repo?

No. Public library docs only.

Official Upstash?

Yes — @upstash/context7-mcp. Community relative to Anthropic's reference list.