MCP Directory

Context7 MCP Server

Official

Up-to-date, version-specific library documentation injected into your coding agent.

Verified
stdio (local)
API key
TypeScript

Add to your client

Copy the config for your MCP client and paste it into its config file.

Install / run
npx -y @upstash/context7-mcp

Paste into ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "context7-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@upstash/context7-mcp"
      ],
      "env": {
        "CONTEXT7_API_KEY": "<optional-your-context7-api-key>"
      }
    }
  }
}

Before you start

  • Node.js 18 or newer (for the local stdio server via npx)
  • An MCP-capable client (Cursor, Claude Code, Claude Desktop, VS Code, Windsurf, OpenCode, and 30+ others)
  • A free Context7 API key from https://context7.com/dashboard for higher rate limits (optional but recommended; passed via the CONTEXT7_API_KEY header or --api-key)

About Context7 MCP Server

Context7, by Upstash, is an MCP server that injects up-to-date, version-specific library documentation and real code examples directly into your coding agent's context. It exists to stop LLMs from generating APIs that don't exist or that match an old version, by pulling docs from a continuously indexed source rather than the model's training data.

The typical flow is two calls: resolve-library-id turns a plain name like "next.js" into a Context7 ID such as /vercel/next.js, and the docs tool fetches the relevant, version-pinned documentation chunks for a topic you specify. If you already know the ID (format /org/project or /org/project/version), you can pass it directly and skip resolution.

It runs as a local stdio server via the @upstash/context7-mcp npm package, or you can use the hosted remote endpoint at https://mcp.context7.com/mcp. A free Context7 API key (from context7.com/dashboard) raises rate limits and is passed via the CONTEXT7_API_KEY header or --api-key flag. A guided npx ctx7 setup flow can authenticate via OAuth and wire the server into supported clients automatically.

Tools & capabilities (2)

resolve-library-id

Resolves a plain library name into a Context7-compatible ID (e.g. next.js -> /vercel/next.js), ranking matches by trust score and doc coverage.

query-docs

Fetches up-to-date, version-specific documentation and code examples for a given Context7 library ID and topic/query (current upstream tool name; some clients/mirrors expose it as get-library-docs).

When to use it

  • Use it when your agent writes code against an outdated version of a framework and you need version-pinned docs.
  • Use it when a library released breaking changes after the model's training cutoff.
  • Use it when you want real, copy-pasteable code examples pulled from current docs instead of invented snippets.
  • Use it when you can name the exact library/version (e.g. /vercel/next.js/v15) and want docs injected with no guesswork.
  • Use it across many editors — it documents 30+ clients and a hosted remote endpoint for setups where you can't run Node locally.

Quick setup

  1. 1Run `npx ctx7 setup` for guided OAuth + client wiring, or configure manually.
  2. 2For local stdio: add a server running `npx -y @upstash/context7-mcp` to your client's MCP config.
  3. 3For remote: point the client at `https://mcp.context7.com/mcp` and pass your key via the CONTEXT7_API_KEY header.
  4. 4Optionally create a free API key at context7.com/dashboard and supply it (CONTEXT7_API_KEY env/header or --api-key) to lift rate limits.
  5. 5Restart/reload the client so the resolve-library-id and docs tools register.
  6. 6Ask about a specific library and confirm version-specific docs are returned.

Security notes

Basic use needs no credentials; an optional CONTEXT7_API_KEY only raises rate limits and should be kept secret. The server fetches third-party documentation, so treat returned content as untrusted input.

Context7 MCP Server FAQ

Do I need an API key?

You can use Context7 without one, but a free key from context7.com/dashboard raises rate limits and is recommended; pass it via the CONTEXT7_API_KEY header or --api-key flag.

Can I run it remotely instead of installing it?

Yes. Point your client at the hosted endpoint https://mcp.context7.com/mcp and supply your API key in the header, no local Node required.

What's the resolve-library-id step for?

It maps a human library name to a precise Context7 ID. You must call it before fetching docs unless you already pass an ID in /org/project or /org/project/version form.

Which clients are supported?

30+, including Cursor, Claude Code, Claude Desktop, VS Code, Windsurf, and OpenCode; see context7.com/docs for per-client instructions.

Is it official?

Yes, it is built and maintained by Upstash, and the package is published as @upstash/context7-mcp under the MIT license.

Alternatives to Context7 MCP Server

Microsoft's official browser-automation MCP using Playwright's accessibility tree (no vision model).

Featured
Verified
stdio (local)
No auth
TypeScript
12 tools
Updated 9 days agoRepo

LSP-powered coding agent toolkit: semantic symbol search, references and structural edits.

Verified
stdio (local)
No auth
Python
11 tools
Updated 11 days agoRepo

Connect MCP clients to a running JetBrains IDE (IntelliJ, PyCharm, WebStorm, Android Studio).

Verified
stdio (local)
No auth
TypeScript
10 tools
Updated 4 months agoRepo