by cmdaltctr
Lightweight MCP integration bringing Google's Gemini AI capabilities to Claude Code with 1M+ token context window, smart model selection, and powerful code analysis tools
# Add to your Claude Code skills
git clone https://github.com/cmdaltctr/claude-gemini-mcp-slim
🚀 What's Coming Next: I'm building an AI Agent Feedback Loop System that enables intelligent collaboration between Claude Code and Gemini AI. This will create a continuous improvement cycle where both AI agents learn from each other's suggestions, creating smarter code analysis and more contextual development assistance. Starting with Claude Code, then expanding to other IDEs. Stay tuned!
A lightweight integration that brings Google's Gemini AI capabilities to Claude Code through MCP (Model Context Protocol)
This project connects Claude Code (your coding assistant) with Google's Gemini AI models. Think of it as adding a second AI expert to your development team - one that can read and understand massive amounts of code at once (1M+ tokens, which is like reading hundreds of code files simultaneously).
With this integration, you can ask Gemini questions about your code, get security reviews, performance suggestions, and architectural advice - all without leaving your coding environment. It automatically chooses the right AI model for each task: fast responses for quick questions, deeper analysis for complex problems.
No comments yet. Be the first to share your thoughts!
/g, /analyze, /securityClaude Code ←→ MCP Server ←→ Gemini CLI/API ←→ Google Gemini Models
↓
Smart Model Selection
(Flash for speed, Pro for depth)
The Gemini MCP server uses a shared architecture where one installation serves multiple AI clients and projects:
Claude Desktop │ Claude Code │ Cursor IDE │ VS Code + Extensions
│ │ │
└──────────────┼─────────────┘
│
┌─────────────────────────┐
│ MCP Protocol │
│ (Tool Requests) │
└─────────────────────────┘
│
┌─────────────────┐
│ Gemini MCP │
│ Server │
│ (Python/Shell) │
└─────────────────┘
│
┌───────────────┼───────────────┐
│ │ │
┌─────────────────┐ ┌─────────────────┐ │
│ Gemini API │ │ Gemini CLI │ │
│ (Direct HTTP) │ │ (Shell Command)│ │
└─────────────────┘ └─────────────────┘ │
│ │ │
└───────────────┼───────────────┘
│
┌─────────────────────────┐
│ Google Gemini AI │
│ (1M+ Token Context) │
└─────────────────────────┘
~/mcp-servers/ ← Central location for all MCP servers
├── shared-mcp-env/ ← Shared virtual environment
│ ├── bin/python ← Python interpreter for all MCPs
│ └── lib/python3.x/site-packages/ ← Shared dependencies (mcp, google-generativeai, etc.)
└── gemini-mcp/ ← Complete Gemini MCP package
├── gemini_mcp_server.py ← Main MCP server
└── .claude/ ← Complete slash commands system
├── hooks.json ← Hook definitions
├── commands/ ← Native slash commands (10+ commands)
│ ├── gemini.md ← /gemini command
│ ├── analyze.md ← /analyze command
│ └── ... ← Other command definitions
└── scripts/
└── slim_gemini_hook.py ← Hook execution script
your-project/
├── .claude → ~/mcp-servers/gemini-mcp/.claude ← Symlink to shared hooks
├── src/ ← Your project files
├── README.md
└── (no venv or MCP files needed!) ← Clean project structure
The shared MCP architecture supports multiple AI clients simultaneously:
Supported Clients:
Important: Hook functionality (.claude/hooks.json) is exclusive to Claude Code ecosystem (Claude Code standalone + VS Code with Claude Code extension). No other AI client currently supports this automation system.
New to this project? Here's what you need to do:
Installation time: ~5 minutes | Prerequisites: Python 3.10+, Node.js 16+
Use gemini_quick_query for:
- "How do I implement JWT authentication in Node.js?"
- "What's the difference between useEffect and useLayoutEffect?"
- "Best practices for error handling in Python async functions"
Use gemini_analyze_code for:
- Security review of authentication functions
- Performance analysis of database queries
- Architecture review before major refactoring
Use gemini_codebase_analysis for:
- Overall architecture assessment
- Security vulnerability scanning
- Performance bottleneck identification
The hooks system provides intelligent automation that runs at key development moments:
Pre-edit Analysis:
- Automatically analyzes files before Claude Code edits them
- Provides context about security, performance, and architecture concerns
- Helps prevent issues by informing Claude Code before changes are made
Pre-commit Review:
- Analyzes staged changes before git commits
- Reviews code for critical bugs, security vulnerabilities, and quality issues
- Provides final quality check before code enters version control
Session Summary:
- Generates brief recap when Claude Code session ends
- Highlights key changes made and potential next steps
- Maintains development context between sessions
The slash commands provide a much simpler way to access Gemini's powerful analysis without remembering the full MCP