Up-to-date documentation for LLMs
## Context7 MCP Server: AI Context Management Platform The **Context7 MCP Server** provides intelligent context management for AI-assisted development within Google Antigravity, optimizing how code context is gathered, organized, and presented to AI models for better results. ### Why Context7 MCP? - **Smart Context Selection**: Automatically identify and include relevant code context for AI queries - **Token Optimization**: Efficiently use context window space by prioritizing important information - **Dependency Awareness**: Understand and include related files, imports, and dependencies - **History Tracking**: Maintain conversation context across multiple interactions - **Project Understanding**: Build comprehensive project knowledge for more accurate AI assistance ### Key Features #### 1. Context Gathering ```python from anthropic import Anthropic client = Anthropic() response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Gather relevant context for refactoring the authentication module" }] ) ``` #### 2. Smart Selection ```python # Optimize context response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Select the most relevant files for understanding the payment processing flow" }] ) ``` #### 3. Project Indexing ```python # Index project response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Index the project structure and create a semantic map of components" }] ) ``` #### 4. Context Optimization ```python # Optimize token usage response = client.messages.create( model="claude-sonnet-4-20250514", max_tokens=1024, messages=[{ "role": "user", "content": "Compress context to fit within token limits while preserving essential information" }] ) ``` ### Configuration ```json { "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@anthropic/mcp-server-context7"], "env": { "CONTEXT7_INDEX_PATH": ".context7", "CONTEXT7_MAX_TOKENS": "100000" } } } } ``` ### Use Cases **Large Codebase Navigation**: Efficiently work with large codebases by surfacing relevant context. **Complex Refactoring**: Gather all related code for comprehensive understanding before refactoring. **Cross-File Changes**: Understand dependencies when making changes that span multiple files. **AI Query Optimization**: Improve AI response quality by providing better-structured context. The Context7 MCP Server enhances AI-assisted development by ensuring models have the right context to provide accurate, relevant assistance.
{
"mcpServers": {
"context7": {
"mcpServers": {
"context7": {
"args": [
"-y",
"@upstash/context7-mcp"
],
"command": "npx"
}
}
}
}
}