▌BestMCPTools.org
Context7 MCP logo

Context7 MCP

Up-to-date, version-specific library docs for AI coding assistants

Developer ToolsFreeClaudeCursorWindsurfGitHub CopilotVS CodeClaude CodeEasy✓ Verified

Last verified: September 30, 2026

Own Context7 MCP? Boost it to the top.✦ Upgrade to Featured

Maintenance status

Active
Last code update: September 26, 2026License: MITChecked September 28, 2026

How to Install Context7 MCP

$npx -y @upstash/context7-mcp@latest

Requires Claude Desktop, Cursor, Windsurf, or another MCP-compatible client.

Setup by client

Claude Desktop (claude_desktop_config.json)

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

Cursor (~/.cursor/mcp.json)

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

VS Code (.vscode/mcp.json)

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

Claude Code (terminal)

claude mcp add context7-mcp -- npx -y @upstash/context7-mcp@latest

Add any API keys or environment variables the server's README lists.

About Context7 MCP

Context7 is a documentation service from Upstash that feeds up-to-date, version-specific library documentation and code examples into your AI coding assistant. Instead of writing code from year-old training data, the assistant looks up the current docs for the library and version you name. You reach it through an MCP server or through a command line tool with agent skills.

Quick facts (as of September 30, 2026)

Context7
MakerUpstash
TypeDocumentation lookup service, reached through an MCP server or the ctx7 CLI
MCP toolsTwo: resolve-library-id and query-docs
Remote endpointhttps://mcp.context7.com/mcp
Local (stdio) optionnpx -y @upstash/context7-mcp@latest (npm package 4.1.1, published September 14, 2026; needs Node.js 20.18.1 or newer)
Guided setupnpx ctx7 setup (needs Node.js 18 or newer); signs in with OAuth, creates an API key and installs the skill or MCP entry
AuthenticationAn API key is optional but recommended, sent as Authorization: Bearer YOUR_API_KEY for the remote server or as --api-key for the local one. Free keys come from context7.com/dashboard
PriceFree key available. The README says a key gives higher rate limits and access to private repositories; it does not state the limits
LicenseMIT (the server source in the GitHub repository)

What it does

Context7 retrieves current documentation and code examples straight from the source and places them in your prompt. The README describes two modes:

  • CLI + Skills. npx ctx7 setup installs a skill that guides your agent to fetch docs with ctx7 commands. No MCP server is needed.
  • MCP. Registers the Context7 MCP server so your agent calls the documentation tools directly.

The two MCP tools

ToolInputsWhat it does
resolve-library-idlibraryName (required), query (required)Turns a general library name into a Context7 library ID and ranks matches by your question
query-docslibraryId (required), query (required)Returns documentation for a library, using an exact ID such as /vercel/next.js or /supabase/supabase

The CLI has matching commands: ctx7 library <name> <query> and ctx7 docs <libraryId> <query>.

Using it well

  • Add use context7 to a prompt, or add a standing rule in your agent's rules file (for example CLAUDE.md or Cursor rules) so the assistant consults it without being asked.
  • If you know the library, give its ID in the prompt (for example /supabase/supabase). That skips the matching step.
  • Mention the version you need ("Next.js 14 middleware") and Context7 matches the appropriate version.

Setup

  1. Fastest: run npx ctx7 setup and choose CLI + Skills or MCP. Use --cursor, --claude or --opencode to target one agent. npx ctx7 remove undoes it.
  2. Remote server by hand: point your client at https://mcp.context7.com/mcp and send your key as a bearer token in the Authorization header.
  3. Local server: add npx -y @upstash/context7-mcp@latest as a stdio server, with --api-key YOUR_API_KEY or a CONTEXT7_API_KEY environment variable if you have a key. Client-specific instructions for more than 30 clients are on the Context7 docs site.

Limitations and things to watch

  • It only retrieves documentation. Context7 has no tools for Git, pull requests, builds, package inspection or running code. It will not read your repository.
  • Documentation quality is not guaranteed. The README says the indexed projects are community-contributed and that Context7 cannot guarantee the accuracy, completeness or security of all library documentation. It provides a Report button for suspicious or harmful content.
  • Part of the system is closed. The GitHub repository holds the MCP server source. The API backend, parsing engine and crawling engine are private, so retrieval quality cannot be audited from the repository.
  • Retrieved text goes into your model's context. Treat documentation from any indexed project as untrusted input, as you would any fetched web content.
  • Rate limits. Without an API key you get lower limits. The exact numbers are not published in the README.

Pros and cons

Pros

  • Directly targets a common failure: invented or outdated API calls, by pulling current docs at prompt time.
  • Two small tools and a clear workflow (resolve the library, then query it).
  • Choice of remote server, local server, or CLI with skills.
  • MIT-licensed server source, and a free API key is available.

Cons

  • Only as good as the documentation indexed for your library and version.
  • Backend is closed and hosted by Upstash, so it needs network access to their service.
  • Without a skill or a standing rule, your assistant may only use it when you ask (the README suggests adding a rule).
  • Free-tier limits are not stated in the README.

Who it is for

A good fit if:

  • You write code with an AI assistant against fast-changing libraries and frameworks.
  • You want assistants to cite the docs for the exact version you use.

Not the right tool if:

  • You need repository, pull request or CI actions. See the GitHub MCP server.
  • You need to search the general web. See Exa MCP or Fetch MCP.
  • Your library is not indexed by Context7 (the docs site explains how to add one; we did not test that).

What we could not verify

  • Free-tier rate limits and any paid plans. Not stated in the README we read; check context7.com.
  • Which clients are officially supported. The README refers to more than 30 clients on its docs site, which we did not read. The list on this page comes from the listing and the README examples.
  • How well any given library is indexed. We did not test queries.

How this page was put together

We read the Context7 README on GitHub and the npm entry for @upstash/context7-mcp (version, Node requirement, README) on September 30, 2026. We did not run Context7 against a live account.

Sources

Pricing

Free: from Free (API key recommended for higher rate limits)

Our Take on Context7 MCP

Worth adding if you code with an assistant against fast-changing libraries: it pulls the docs for the version you name instead of trusting training data. It only retrieves documentation, so pair it with a repository server for Git and pull request work, and check important details against the official docs.

Alternatives to Context7 MCP

Exa MCPSearch

AI-native semantic web search for agents

View Exa MCP →
Fetch MCPAPIs & Data

Fetch any URL or web content from AI

View Fetch MCP →

Frequently Asked Questions

Tags