MCP/Context7
Context7 logo

Context7

Verified Golden (1000+ GitHub stars)

Pulls up-to-date, version-specific documentation and code examples straight from official sources directly into your coding agents.

developer-tools•Documentation & Code Context
GitHub63.6k
License:MIT
VERIFIED

About this Server

Context7 is an open-source documentation MCP server and platform created by Upstash that pulls up-to-date, version-specific developer documentation and code examples straight from official sources directly into your coding agent. By dynamically resolving library IDs and querying indexed documentation, Context7 eliminates LLM hallucinations, outdated syntax, and deprecated API calls across modern web and cloud development frameworks.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

Official Source Grounding: Fetches documentation directly from verified repositories and authoritative documentation hubs to prevent hallucinated code.
Read-Only Operation: Only queries public documentation indexes without reading private local repository files or executing arbitrary scripts.
Safe Credential Handling: Optional Context7 API keys for elevated rate limits are stored in local editor configurations without cloud telemetry exposure.
Token-Efficient Retrieval: Intelligently excerpts and filters relevant documentation sections to conserve LLM context window space.

When to Use (and When Not To)

Best For
  • •Querying the latest, version-specific APIs and SDK documentation that postdate model training cutoffs
  • •Retrieving accurate code examples and usage patterns for modern frameworks (e.g., Next.js, Supabase, Tailwind, MongoDB)
  • •Eliminating hallucinated function signatures, deprecated options, and breaking API changes
  • •Finding verified library IDs across the open-source ecosystem using natural language task queries
Not For / Limitations
  • •Local workspace file editing or file system operations (use workspace file editing tools or Repomix instead)
  • •Automating live browser sessions or clicking DOM elements (use Playwright or Browser MCP instead)
  • •Executing database queries or schema migrations against private databases (use Neon, Supabase, or Postgres MCP instead)

Install & Setup

terminal command
$claude mcp add context7 -- npx -y @upstash/context7-mcp

Exposed Tools & Endpoints

2 tools

Functions your AI agent can invoke via this Model Context Protocol server

resolve-library-id

Resolves a general library name into a Context7-compatible library ID (e.g., /mongodb/docs, /vercel/next.js) ranked by relevance to the query.

query-docs

Retrieves version-specific documentation, API references, and relevant code examples for a library using its Context7-compatible library ID.