# Context7 Context7 is a platform that provides up-to-date, version-specific library documentation directly into AI coding assistant prompts. Built by Upstash. It solves the problem of [[Large Language Models (LLMs)]] generating code based on outdated training data, hallucinating APIs that don't exist, or producing answers for old package versions. 49.6k+ GitHub stars. MIT licensed. ## How it works 1. Write a prompt naturally 2. Add `use context7` to trigger documentation retrieval 3. Context7 fetches current docs from the source and injects them into the LLM's context The platform indexes community-contributed library documentation and serves it on demand. The backend (API, parsing engine, crawling engine) is proprietary; only the MCP server source is open. ## Two modes **CLI + Skills** — installs an [[AI Agent Skills|agent skill]] that guides the coding agent to fetch docs using `ctx7` CLI commands. No MCP required. **MCP** — registers a Context7 [[Model Context Protocol (MCP)|MCP]] server so the agent can call documentation tools natively. Setup: `npx ctx7 setup` (handles OAuth, API key generation, and skill installation). ## Tools | Tool | Description | |---|---| | `resolve-library-id` / `ctx7 library` | Resolves a library name to a Context7-compatible ID (e.g., `/mongodb/docs`, `/vercel/next.js`) | | `query-docs` / `ctx7 docs` | Retrieves documentation for a library by ID, filtered by a query | ## Supported clients Works with 30+ AI coding assistants including [[Claude Code]], Cursor, Windsurf, OpenCode, and others. One-command setup for most clients. ## Pricing Free tier with rate limits. Paid plans unlock higher limits and private repository support. Enterprise plans available. ## References - https://context7.com - https://github.com/upstash/context7 ## Related - [[Model Context Protocol (MCP)]] - [[AI Agent Skills]] - [[Large Language Models (LLMs)]] - [[Claude Code]] - [[RAG Pipelines]] - [[Context Engineering]]