← back

Context7: Up-to-Date Documentation for AI Code Editors

Dec 7, 2025

mcpai-toolsdocumentationupstash

Context7 is an MCP server by Upstash that delivers current, version-specific documentation directly into your AI coding assistant’s context. Instead of relying on stale LLM training data, Context7 fetches real documentation from the source.

The Problem It Solves

LLMs are trained on snapshots of documentation that become outdated. When you ask for help with a library, you might get:

Context7 fixes this by injecting live documentation into the prompt.

How It Works

The pipeline: Parse (extract code snippets) → Enrich (add metadata via LLM) → Vectorize (embed for semantic search) → Rerank (score relevance) → Cache (serve from Redis).

Two MCP tools are exposed:

  1. resolve-library-id - matches “react” to a specific documentation ID
  2. get-library-docs - fetches the actual docs

Supported Libraries

Over 33,000 libraries indexed, with community contributions for more. You can also add support for niche libraries not yet included.

Editor Integration

Works with Cursor, VS Code (Copilot), Claude Code, Windsurf, and other MCP-compatible clients.

Claude Code setup (remote):

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

Claude Code setup (local):

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

Usage

Add “use context7” to your prompts:

“Create a Next.js middleware that checks for a valid JWT in cookies. use context7”

Or configure auto-invocation rules in your editor to trigger it automatically.

Pricing

Free and open source. An optional API key provides higher rate limits and private repository access.

Security Note

Since documentation is community-contributed, there’s a potential vector for “poisoned” documentation submissions. Backslash Security flagged this as a consideration when using the service.


Sources: