GitHub Stars
1
User Rating
Not Rated
Forks
0
Issues
0
Views
0
Favorites
0
README
Claude Code + Gemini MCP Server
Connect Claude Code with Google's Gemini AI for powerful AI collaboration. Ask Gemini questions with persistent chat sessions, get code reviews, and brainstorm ideas - all within Claude Code!
🚀 Quick Start (2 minutes)
Prerequisites
- Python 3.8+ installed
- Claude Code CLI installed (
npm install -g @anthropic-ai/claude-code
) - Google Gemini API key (Get one free)
One-Line Install
Option 1: With API key in environment (Recommended)
export GEMINI_API_KEY='your-api-key-here'
curl -sSL https://raw.githubusercontent.com/notlostdream/claude_code-gemini-mcp/main/install.sh | bash
Option 2: Interactive setup
curl -sSL https://raw.githubusercontent.com/notlostdream/claude_code-gemini-mcp/main/install.sh | bash
# Follow the prompts to enter your API key
Manual Install
- Clone this repo:
git clone https://github.com/notlostdream/claude_code-gemini-mcp.git
cd claude_code-gemini-mcp
- Run setup:
# With API key
./setup.sh YOUR_GEMINI_API_KEY
# Or use environment variable
export GEMINI_API_KEY='your-api-key-here'
./setup.sh
That's it! 🎉
📖 Usage
Start Claude Code anywhere and use these commands:
Chat Sessions (NEW!)
claude
# Ask Gemini (maintains conversation context)
mcp__gemini-collab__ask_gemini
prompt: "Hi! I'm working on a Python web app"
# Continue the conversation
mcp__gemini-collab__ask_gemini
prompt: "What security measures should I implement?"
# Create a new chat session for a different topic
mcp__gemini-collab__new_chat_session
name: "React Project"
# List all active sessions
mcp__gemini-collab__list_sessions
# Switch between sessions
mcp__gemini-collab__switch_session
session_id: "abcd1234"
# Delete a session
mcp__gemini-collab__delete_session
session_id: "abcd1234"
Other Features
# Get code reviews (stateless)
mcp__gemini-collab__gemini_code_review
code: "def auth(u): return u.pwd == 'admin'"
focus: "security"
# Brainstorm ideas (stateless)
mcp__gemini-collab__gemini_brainstorm
topic: "How to scale a web app to 1M users"
Or simply ask claude code to correlate with Gemini, it is not a rocket sciene... (Author's note)
🛠️ What This Does
- Installs the Google Gemini Python SDK
- Sets up an MCP server that bridges Claude Code and Gemini
- Configures it globally (works in any directory)
- Provides tools for collaboration between Claude and Gemini
🔧 Available Tools
- ask_gemini - Ask Gemini any question
- gemini_code_review - Get security/performance code reviews
- gemini_brainstorm - Brainstorm ideas and solutions
📁 Installation Location
The server is installed at: ~/.claude-mcp-servers/gemini-collab/
🐛 Troubleshooting
MCP not showing up?
# Check if it's installed
claude mcp list
# Reinstall with global scope
claude mcp remove gemini-collab
claude mcp add --scope user gemini-collab python3 ~/.claude-mcp-servers/gemini-collab/server.py
Connection errors?
- Check your API key is valid
- Ensure Python has
google-generativeai
installed:pip install google-generativeai
🔑 Update API Key
Edit ~/.claude-mcp-servers/gemini-collab/server.py
and replace the API key.
🤝 Contributing
Pull requests welcome! Please keep it simple and beginner-friendly.
📜 License
MIT - Use freely!
Made with ❤️ for the Claude Code community
Author Information
Threads