Pulls current docs and code examples into agent context via MCP tools or a ctx7 CLI skill, reducing stale API answers.
Overview
Context7 is a documentation platform that supplies up-to-date, version-specific library docs and examples to AI coding agents. Instead of relying on model training cutoffs, it retrieves material from indexed sources and injects it into the agent workflow through either MCP tools or CLI-driven skills.
Installation uses the ctx7 CLI with Node.js, OAuth authentication, and optional API keys from the Context7 dashboard for higher rate limits. Agents can resolve library names to Context7 IDs, query docs with natural-language tasks, and target specific versions mentioned in prompts. Manual MCP setup passes bearer tokens to a hosted server URL documented for many clients.
Indexed libraries appear with snippet counts and update cadence. The MCP server implementation is published separately from crawling, parsing, and API backend components that remain private. Users can submit libraries for indexing and consult troubleshooting and REST API references.
A developer guide covers running the MCP server locally for advanced setups, while most users integrate against the hosted service. Community-contributed library entries include a reporting path for quality or safety concerns.
Key features
- MCP resolve-library-id and query-docs tools
- ctx7 library and docs CLI commands
- Version-specific doc retrieval
- Slash syntax for known library IDs
- Agent setup for Cursor and Claude Code
- Optional API key for rate limits
- Indexed public library catalog
- Rules and skills for automatic doc fetch
Use cases
- Grounding agent answers in current APIs
- Fetching framework docs during implementation
- Targeting a specific library release in prompts
- Reducing hallucinated method names
- MCP integration in multiple coding clients