Context7
π§MCP Server2511319/context7
Dynamically retrieves and injects up-to-date, version-specific documentation and code examples directly into AI prompts to improve the accuracy and relevance of generated code
Overview
An MCP server that dynamically retrieves up-to-date, version-specific documentation and code examples and injects them directly into AI prompts. It solves the problem of LLMs relying on outdated training data by fetching current documentation from the source, eliminating hallucinated APIs and outdated code patterns.
Key Features
- On-Demand Documentation Retrieval β Simply add "use context7" to any prompt to fetch current documentation and code examples for the libraries you're working with
- Intelligent Context Management β Uses MCP sessions to track search trajectory, filters repeated results across searches, and returns only the most relevant 5k tokens from documentation pages to minimize context rot
- Version-Specific Accuracy β Pulls documentation straight from the source, ensuring code examples match the actual version of libraries being used rather than outdated training data
Who is this for?
Developers using AI coding assistants who are tired of getting outdated code suggestions and hallucinated APIs. Especially useful for those working with rapidly evolving libraries where training data quickly becomes stale, such as frontend frameworks, cloud services, and API integrations.
Installation
claude mcp add --transport http context7 https://mcp.context7.com/mcpclaude mcp add --transport sse context7 https://mcp.context7.com/sseclaude mcp add context7 -- npx -y @upstash/context7-mcp{
"mcpServers": {
"context7": {
"url": "https://mcp.context7.com/mcp...