Context7 MCP
An MCP server by Upstash that fetches current, version-pinned library documentation into the agent's context when needed. Eliminates the stale-training-data problem for fast-moving libraries: Claude answers with the real API as it exists today. Ships two integration modes — MCP (native tool calls) and CLI+Skills (ctx7 CLI commands, more token-efficient). Works with Claude Code, Cursor, and others.
View on GitHubWhat it does
- npx ctx7 setup --claude
Interactive setup: authenticates via OAuth, generates an API key, and installs Context7 for Claude Code in either MCP or CLI+Skills mode.
- claude mcp add --transport http context7 https://mcp.context7.com/mcp
Manually register the hosted Context7 MCP HTTP endpoint in Claude Code — no local install needed.
- resolve-library-id
MCP tool that resolves a general library name (e.g. "next.js") to a Context7-compatible library ID for use in query-docs.
- query-docs
MCP tool that fetches up-to-date documentation for a library by its Context7 ID, filtered to a specific query.
- ctx7 docs <libraryId> <query>
CLI command (Skills mode) that retrieves documentation for a library ID, called by the installed skill instead of MCP tools.