About this project

Context7 Platform provides fresh, version-specific code documentation and examples from open-source libraries directly into LLM contexts. It operates via an MCP server or a CLI with skills, working with AI coding assistants such as Cursor, Claude Code, and OpenCode. Without Context7, LLMs rely on stale training data, producing outdated code examples, hallucinated APIs, and generic answers for old package versions. Context7 resolves this by fetching live documentation from source repositories at the exact library version requested. Installation is done via `npx ctx7 setup`, which guides OAuth authentication, generates an API key (free tier available at context7.com/dashboard), and installs either CLI skills or an MCP server. Users can target specific agents with flags like `--cursor`, `--claude`, or `--opencode`. To remove setup later, run `npx ctx7 remove`. Key features include: - **Library ID support**: Prefix a known library ID (e.g., `/supabase/supabase`) in prompts to skip library-matching and fetch docs directly. - **Version specification**: Mention a version in your prompt (e.g., "Next.js 14") and Context7 matches the appropriate release automatically. - **CLI commands**: `ctx7 library <name> <query>` searches the index; `ctx7 docs <libraryId> <query>` retrieves relevant documentation snippets. - **MCP tools**: `resolve-library-id` maps a general name to a Context7-compatible ID; `query-docs` fetches documentation using that ID. The platform offers multiple integration packages: - `@upstash/context7-mcp` — MCP server for agent integration - `ctx7` — standalone CLI - `@upstash/context7-sdk` — TypeScript SDK - `@upstash/context7-tools-ai-sdk` — Vercel AI SDK tools - `@upstash/context7-pi` — pi.dev extension Manual configuration uses the MCP endpoint `https://mcp.context7.com/mcp` with a Bearer API key. Over 30 client platforms are supported with documented setup guides. Community libraries are contributed by their maintainers. Context7 includes a reporting mechanism for problematic content and notes that the API backend, parsing engine, and crawling engine behind the service are private components not included in the public repository. The project is MIT licensed.