- Explore MCP Servers
- gemini-claude-code-mcp
Gemini Claude Code Mcp
What is Gemini Claude Code Mcp
Gemini-Claude Code MCP is a server that enables Claude Code to utilize Googleโs Gemini models for processing ultra-large context workloads, allowing for smarter and faster code reasoning with an extended context window of up to 2 million tokens.
Use cases
Use cases include analyzing large repositories of code, generating documentation from extensive codebases, and performing multi-file analysis tasks that exceed Claudeโs native context limits.
How to use
To use Gemini-Claude Code MCP, integrate it with Claude Code via the MCP protocol. This allows Claude to send requests to the MCP server, which then communicates with the Gemini API to handle large context processing.
Key features
Key features include an extended context of 2 million tokens, hybrid intelligence combining Claudeโs reasoning with Geminiโs processing capabilities, improved performance by offloading context-heavy tasks, and seamless integration within Claude Code.
Where to use
Gemini-Claude Code MCP is ideal for software development, data analysis, and any field requiring extensive codebase processing, large documentation handling, or complex multi-file analysis.
Overview
What is Gemini Claude Code Mcp
Gemini-Claude Code MCP is a server that enables Claude Code to utilize Googleโs Gemini models for processing ultra-large context workloads, allowing for smarter and faster code reasoning with an extended context window of up to 2 million tokens.
Use cases
Use cases include analyzing large repositories of code, generating documentation from extensive codebases, and performing multi-file analysis tasks that exceed Claudeโs native context limits.
How to use
To use Gemini-Claude Code MCP, integrate it with Claude Code via the MCP protocol. This allows Claude to send requests to the MCP server, which then communicates with the Gemini API to handle large context processing.
Key features
Key features include an extended context of 2 million tokens, hybrid intelligence combining Claudeโs reasoning with Geminiโs processing capabilities, improved performance by offloading context-heavy tasks, and seamless integration within Claude Code.
Where to use
Gemini-Claude Code MCP is ideal for software development, data analysis, and any field requiring extensive codebase processing, large documentation handling, or complex multi-file analysis.
Content
๐ Gemini-Claude Code MCP Server
๐ฎ Enable Claude Code to Harness Gemini for Ultra-Large Context Workloads ๐ง โก
Let Claude tap into Geminiโs extended context window for smarter, bigger, and faster code reasoning.
๐ฏ Project Overview
This MCP (Model Context Protocol) server bridges Claude Code with Googleโs Gemini models, enabling Claude to leverage Geminiโs massive context window (up to 1M tokens) for processing large codebases, extensive documentation, and complex multi-file analysis tasks that would otherwise exceed Claudeโs native context limits.
Key Benefits
- ๐ Extended Context: Access Geminiโs 2M token context window for massive codebases
- ๐ง Hybrid Intelligence: Combine Claudeโs reasoning with Geminiโs large-scale processing
- โก Performance: Offload context-heavy operations to Gemini while keeping Claude responsive
- ๐ง Seamless Integration: Works directly within Claude Code via MCP protocol
๐๏ธ Architecture
System Components
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ Claude Code โ <-----> โ MCP Server โ <-----> โ Gemini API โ โ โ MCP โ โ HTTP โ โ โ (Reasoning & โ โ (Bridge Layer) โ โ (Large Context โ โ Execution) โ โ โ โ Processing) โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
Core Modules
-
MCP Server (
mcp_server/server.py
)- Handles MCP protocol communication with Claude Code
- Routes requests between Claude and Gemini
- Manages session state and context switching
-
Gemini Service (
services/gemini_manager.py
)- Manages Gemini API connections using the Google AI Python SDK
- Handles context chunking and streaming
- Optimizes token usage and caching
-
Context Tools (
tools/
)analyze_large_context
: Process entire repositories or documentation setssummarize_codebase
: Generate intelligent summaries of large projectscross_file_analysis
: Analyze dependencies and relationships across many filescontext_search
: Search through massive contexts efficientlycode_generation
: Generate code with full project context awareness
๐ ๏ธ Technical Implementation
MCP Tools Available
1. analyze_large_context
Processes large amounts of code or documentation that exceed Claudeโs context window.
2. summarize_codebase
Creates intelligent summaries of entire codebases.
{
"name": "summarize_codebase",
"parameters": {
"path": "/path/to/codebase",
"focus_areas": [
"optional areas of interest"
],
"detail_level": "high|medium|low"
}
}
3. cross_file_analysis
Analyzes relationships and dependencies across multiple files.
{
"name": "cross_file_analysis",
"parameters": {
"files": [
"file patterns"
],
"analysis_type": "dependencies|interfaces|data_flow|security"
}
}
4. context_search
Search through massive contexts using Geminiโs understanding.
5. code_generation
Generate code with full project context awareness.
{
"name": "code_generation",
"parameters": {
"task": "generation task description",
"context_files": [
"relevant files for context"
],
"style_guide": "optional style preferences"
}
}
Context Management Strategy
- Smart Chunking: Automatically splits large contexts into manageable chunks
- Context Caching: Caches processed contexts to avoid redundant API calls
- Progressive Loading: Loads context progressively based on relevance
- Token Optimization: Intelligently manages token usage across both models
๐ฆ Installation
Prerequisites
- Python 3.11+
- Claude Code with MCP support
- Google Cloud account with Gemini API access
- Google AI Python SDK (installed automatically with dependencies)
Setup Steps
-
Clone the repository
git clone https://github.com/yourusername/gemini-claude-code-mpc.git cd gemini-claude-code-mpc
-
Install dependencies
uv sync
-
Configure API credentials
# Set up Gemini API key export GOOGLE_API_KEY="your-gemini-api-key" # Or use Google Cloud authentication export GOOGLE_APPLICATION_CREDENTIALS="/path/to/service-account.json"
-
Configure Claude Code
Add to your Claude Code settings:
๐ Usage Examples
Example 1: Analyzing a Large Codebase
Claude: "Use Gemini to analyze the entire React codebase and identify performance bottlenecks"
The MCP server will:
1. Gather all relevant files from the React codebase
2. Send them to Gemini for analysis
3. Return structured insights about performance issues
Example 2: Cross-Repository Analysis
Claude: "Compare the authentication implementations across our microservices"
The MCP server will:
1. Collect auth-related code from multiple repositories
2. Use Gemini to analyze patterns and differences
3. Provide comprehensive comparison results
Example 3: Documentation Generation
Claude: "Generate comprehensive API documentation for this entire project"
The MCP server will:
1. Scan all code files for API endpoints and interfaces
2. Use Gemini to understand the full context
3. Generate detailed, context-aware documentation
๐ง Configuration
Environment Variables
GOOGLE_API_KEY
: Gemini API keyGEMINI_MODEL
: Model to use (default: gemini-1.5-pro-002)MAX_CONTEXT_SIZE
: Maximum context size in tokens (default: 2000000)CACHE_ENABLED
: Enable context caching (default: true)CACHE_TTL
: Cache time-to-live in seconds (default: 3600)
Advanced Configuration
Create a config.yaml
file:
gemini:
model: gemini-1.5-pro-002
max_tokens: 2000000
temperature: 0.1
cache:
enabled: true
ttl: 3600
max_size: 1GB
processing:
chunk_size: 100000
overlap: 1000
parallel_chunks: 4
๐ SDK Documentation
This project uses the official Google AI Python SDK for Gemini. For detailed information about the SDK:
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Install development dependencies
uv sync
# Run tests
pytest
# Run linting
ruff check .
# Format code
ruff check --fix .
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Built on FastMCP
- Powered by Google Gemini
- Designed for Claude Code