Context7 logo
Search & AIAuth: No authHosting: Hosted or self-hosted

Context7 MCP Server

Give your AI agent up-to-date, version-specific docs for 9,000+ libraries via the Context7 MCP server.

Updated

What is Context7 MCP?

The Context7 MCP server is a Model Context Protocol server that gives AI coding agents up-to-date, version-specific documentation for 9,000+ libraries and frameworks, pulled directly from each project's own source.

Built and maintained by Upstash, Context7 solves a common failure mode: LLMs answer from stale, pre-training knowledge and hallucinate APIs that no longer exist. Instead, your agent resolves a library by name and fetches current docs on demand, so generated code matches the version you actually use.

You connect to the hosted remote server at https://mcp.context7.com/mcp. No authentication is required to get started — it works anonymously with basic rate limits. An optional free API key (from context7.com/dashboard, passed via the CONTEXT7_API_KEY header) raises those limits. The MCP server is open source under the MIT license.

Tools the Context7 MCP server exposes

ToolWhat it does
resolve-library-idResolves a general library or framework name into a Context7-compatible library ID.
query-docsRetrieves up-to-date, version-specific documentation for a library using its Context7-compatible ID.

Connect the Context7 MCP server

Claude Code

  1. 1

    Add the remote server

    Run: claude mcp add --transport http context7 https://mcp.context7.com/mcp

  2. 2

    (Optional) add an API key

    For higher rate limits, get a free key at context7.com/dashboard and pass it as a header: claude mcp add --transport http context7 https://mcp.context7.com/mcp --header "CONTEXT7_API_KEY: <your-key>"

  3. 3

    Verify

    Run /mcp in Claude Code and confirm Context7 is connected, then ask it to use the latest docs for any library.

Cursor

  1. 1

    Open MCP settings

    Go to Cursor Settings > MCP (Tools & Integrations) and choose to add a new MCP server.

  2. 2

    Add the Context7 server

    Add an entry with URL https://mcp.context7.com/mcp (type: http/remote). No auth is required to start.

  3. 3

    (Optional) raise rate limits

    Add a header CONTEXT7_API_KEY with a free key from context7.com/dashboard, then enable the server and add 'use context7' to your prompts.

Security & permissions

Context7 requires no authentication — the hosted server at https://mcp.context7.com/mcp works anonymously with basic rate limits. An optional free API key (passed via the CONTEXT7_API_KEY header) raises those limits. The agent gains read-only access to public library documentation only; Context7 does not read your private code or project files. Because there is no per-user auth on the default connection, treat it as a public, read-only documentation source.

Using Context7 MCP with Gamut

In a Gamut workflow, Context7 is attached as a tool so an event- or schedule-triggered agent can pull current, version-specific library documentation mid-task — for example, when a "dependency updated" event fires, an agent can resolve the affected library and fetch its latest docs before drafting a migration note or code change. Gamut manages the connection to the hosted server (no auth needed), so the agent just calls the documentation tools as part of its run without any manual setup per execution.

Frequently asked questions

What is the Context7 MCP server?

It is a Model Context Protocol server from Upstash that gives AI coding agents up-to-date, version-specific documentation for 9,000+ libraries. The agent resolves a library by name and fetches current docs on demand, instead of relying on stale training data.

Is the Context7 MCP server free?

Yes. It works anonymously at https://mcp.context7.com/mcp with basic rate limits and no API key. An optional free API key from context7.com/dashboard raises those limits. The MCP server itself is open source under the MIT license.

How do I connect Context7 MCP to Claude Code or Cursor?

For Claude Code, run: claude mcp add --transport http context7 https://mcp.context7.com/mcp. For Cursor, add an MCP server in Settings with the same URL. No auth is required; optionally add a CONTEXT7_API_KEY header for higher rate limits.

Is Context7 hosted or self-hosted?

Both. Upstash runs a hosted remote server at https://mcp.context7.com/mcp that most users connect to directly. The MCP server is also open source, so you can run it locally (e.g. via the npx ctx7 setup CLI) if you prefer.