context7
by upstash·★ 55,436·Score 65
Context7 provides up-to-date code documentation and API references through MCP.
Overview
Context7 is an MCP server that delivers real-time, version-specific code documentation and examples directly to LLM contexts. It eliminates outdated information and API hallucinations by pulling documentation directly from source repositories. The server supports both CLI + Skills and MCP modes, making it compatible with various AI coding assistants.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose Context7 when working with LLM code assistants that need access to up-to-date library documentation, especially when you frequently encounter outdated information or hallucinated API calls.
When NOT to choose this
Avoid Context7 if you need offline access to documentation, as it requires an internet connection to fetch real-time documentation from its service.
Tools this server exposes
2 tools extracted from the READMEresolve-library-idresolve-library-id(query: string, libraryName: string)Resolves a general library name into a Context7-compatible library ID
query-docsquery-docs(libraryId: string, query: string)Retrieves documentation for a library using a Context7-compatible library ID
Comparable tools
Installation
Install Context7 with a single command:
npx ctx7 setupFor manual MCP installation, use the server URL https://mcp.context7.com/mcp with your MCP client and pass your API key via the CONTEXT7_API_KEY header. For Claude Desktop, add this to your claude_desktop_config.json:
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}FAQ
- What libraries does Context7 support?
- Context7 supports thousands of popular libraries across various programming languages. You can find supported libraries through the CLI command `ctx7 library <name> <query>`.
- How do I get documentation for a specific library version?
- Simply mention the version in your prompt (e.g., "How do I set up Next.js 14 middleware? use context7"). Context7 will automatically match the appropriate version.
On Hacker News
Recent discussion from the developer community.
- Story by ida-silver · 2025-04-22
Compare context7 with
Last updated · Auto-generated from public README + GitHub signals.