Context7 MCP Server
Real-time library documentation for AI coding assistants via MCP
Context7 fetches up-to-date, version-specific documentation for thousands of libraries and injects it into your AI coding sessions. Instead of hallucinating deprecated APIs, Claude gets real documentation for the exact package version you're using.
Installation & Configuration
Add this block to your claude_desktop_config.json (or your agent framework's MCP config file):
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Available Tools (2)
resolve-library-idget-library-docs
Use Cases
- Accurate code generation — prevent Claude from using deprecated APIs
- Library onboarding — ask for current docs without leaving your IDE
- Version-aware assistance — get docs for the exact library version you use
Source & Documentation
GitHub Repository: https://github.com/upstash/context7
Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io