Context7
A Model Context Protocol server that fetches up-to-date, version-specific documentation and code examples from libraries directly into LLM prompts, helping developers get accurate answers without outdated or hallucinated information.
What is Context7?
Context7 is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol server that fetches up-to-date, version-specific documentation and code examples from libraries directly into llm prompts, helping developers get accurate answers without outdat...
A Model Context Protocol server that fetches up-to-date, version-specific documentation and code examples from libraries directly into LLM prompts, helping developers get accurate answers without outdated or hallucinated information.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Model Context Protocol server that fetches up-to-date, ver
Use Cases
Maintainer
Works with
Installation
NPM
npx -y @upstash/context7-mcpManual Installation
npx -y @upstash/context7-mcpConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Context7
Context7 is an MCP server that injects live, version-specific library documentation directly into your AI coding assistant's context window, solving the fundamental problem of LLMs giving outdated or hallucinated API answers. Instead of relying on training data that may be months or years old, Context7 fetches current documentation for the exact library version you are using. It exposes two focused tools — one to resolve library IDs and one to retrieve targeted documentation — making it useful for any developer working with rapidly evolving frameworks like Next.js, Supabase, Tailwind, or Prisma.
Prerequisites
- Node.js 18+ and npx available on your system
- An MCP client such as Claude Desktop, Cursor, or Windsurf
- A free Context7 API key (obtain at context7.com/dashboard) for higher rate limits
- Internet access so the server can fetch documentation from context7.com
Authenticate and set up Context7 automatically
The quickest setup uses the ctx7 CLI, which handles OAuth authentication, API key generation, and MCP client registration in one command.
npx ctx7 setupObtain your API key for manual setup
If you prefer manual configuration, visit context7.com/dashboard to create a free account and generate a CONTEXT7_API_KEY. This key enables higher request rate limits.
Add Context7 to your MCP client configuration
For Claude Desktop, edit claude_desktop_config.json. The server runs via npx with no local install needed; pass your API key as an environment variable.
Restart your MCP client
After saving the configuration file, fully quit and reopen Claude Desktop (or your chosen client) so it picks up the new MCP server. You should see Context7 appear in the available tools list.
Use 'use context7' in your prompts
Append 'use context7' to any coding question to trigger documentation lookup, or reference a specific library ID directly. The server will call resolve-library-id then query-docs automatically.
npx ctx7 library react "how does useEffect work"
npx ctx7 docs /vercel/next.js "app router middleware"Context7 Examples
Client configuration
Add Context7 to claude_desktop_config.json. Set CONTEXT7_API_KEY for higher rate limits; the key is optional but recommended for production use.
{
"mcpServers": {
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"],
"env": {
"CONTEXT7_API_KEY": "your-context7-api-key"
}
}
}
}Prompts to try
Add 'use context7' to any library question to pull in up-to-date docs. You can also reference specific library IDs for precision.
- "How do I configure middleware in Next.js 14? use context7"
- "Show me how to use Supabase Row Level Security with the JS client. use library /supabase/supabase"
- "What are the available options for Prisma's findMany? use context7"
- "How do I set up authentication in Clerk with Next.js App Router? use context7"
- "Explain Tailwind CSS v4 configuration changes compared to v3. use context7"Troubleshooting Context7
Context7 tools do not appear in Claude Desktop after configuration
Ensure you fully quit and restart Claude Desktop — not just close the window. Verify the JSON in claude_desktop_config.json is valid with no trailing commas. Run 'npx -y @upstash/context7-mcp' in a terminal to confirm the package downloads without errors.
Rate limit errors when fetching documentation
Without a CONTEXT7_API_KEY the server uses anonymous rate limits which are lower. Generate a free key at context7.com/dashboard and add it to the env section of your config.
resolve-library-id returns no results for a library
Try alternate names or the npm package name (e.g. '@tanstack/react-query' instead of 'React Query'). You can also browse available libraries at context7.com to find the exact Context7 library ID.
Frequently Asked Questions about Context7
What is Context7?
Context7 is a Model Context Protocol (MCP) server that model context protocol server that fetches up-to-date, version-specific documentation and code examples from libraries directly into llm prompts, helping developers get accurate answers without outdated or hallucinated information. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Context7?
Install via npm with the command: npx -y @upstash/context7-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with Context7?
Context7 works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Context7 free to use?
Yes, Context7 is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Context7 Alternatives — Similar Developer Tools Servers
Looking for alternatives to Context7? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Context7 in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Context7?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.