A Model Context Protocol (MCP) server that integrates Google Gemini CLI with Claude Code for AI-powered development assistance.
Key Features:
- No API key required - uses your existing Google Cloud authentication
- Works with Claude Code and Claude Desktop
- Includes CLI for testing and standalone use
# 1. Install prerequisites
npm install -g @google/gemini-cli
gcloud auth login
# 2. Clone and install
git clone https://github.com/YOUR-USERNAME/gemini-code-assist-mcp.git
cd gemini-code-assist-mcp
uv sync
# 3. Verify installation
uv run gemini-mcp-cli status check
# 4. Install in Claude Code
uv run mcp install src/main.py --name "Gemini Assistant"| Tool | Description |
|---|---|
gemini_review_code |
Analyze code quality, security, performance, and style |
gemini_proofread_feature_plan |
Review and improve feature specifications |
gemini_analyze_bug |
Analyze bugs with root cause identification and fix suggestions |
gemini_explain_code |
Explain code functionality at varying detail levels |
-
Google Gemini CLI - Installation guide
npm install -g @google/gemini-cli
-
Google Cloud authentication
gcloud auth login
-
Python 3.11+ with UV
curl -LsSf https://astral.sh/uv/install.sh | sh
Option 1: MCP Install Command (Recommended)
uv run mcp install src/main.py --name "Gemini Assistant"Option 2: Manual Configuration
Add to ~/.claude/settings.json:
{
"mcp": {
"servers": {
"gemini-code-assist": {
"command": "uv",
"args": ["run", "python", "src/main.py"],
"cwd": "/absolute/path/to/gemini-code-assist-mcp"
}
}
}
}Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"gemini-code-assist": {
"command": "uv",
"args": ["run", "python", "/absolute/path/to/gemini-code-assist-mcp/src/main.py"]
}
}
}Test functionality without MCP:
# Check status
uv run gemini-mcp-cli status check
# Code review
uv run gemini-mcp-cli review file --file code.py --focus security
uv run gemini-mcp-cli --show-prompts review file --file code.py # See prompts
# Bug analysis
uv run gemini-mcp-cli bug analyze --description "App crashes" --code-file main.py
# Code explanation
uv run gemini-mcp-cli explain file --file complex.py --level intermediate
# Feature plan review
uv run gemini-mcp-cli feature review --file plan.mdGlobal options: --json, --verbose, --debug, --show-prompts, --model <model>
from src.core.config import ServerConfig, GeminiOptions
config = ServerConfig(
gemini_options=GeminiOptions(
model="gemini-3-pro-preview",
sandbox=False,
debug=False
),
enable_caching=True,
max_file_size_mb=10.0
)gemini://config- Current configurationgemini://templates- Available prompt templatesgemini://status- CLI status and authentication
# Install with dev dependencies
make install
# Run quality checks
make check # lint + typecheck + test
# Individual commands
make lint # ruff check
make fmt # ruff format
make typecheck # mypy
make test # pytest
make test-cov # pytest with coverage
# Run server
make servesrc/
├── main.py # Entry point (exposes mcp/server/app)
├── server/
│ └── gemini_server.py # MCP tools and resources
├── core/
│ ├── gemini_client.py # Gemini CLI wrapper
│ └── config.py # Configuration and templates
├── cli/
│ ├── main.py # CLI entry point
│ └── commands/ # CLI commands
└── features/ # Feature modules
"Gemini CLI not found"
npm install -g @google/gemini-cli
gemini --help # Verify installationAuthentication errors
gcloud auth login
gcloud auth list # Verify active account
gemini -p "test" # Test directlyMCP server not appearing
- Verify JSON syntax in config file
- Use absolute paths, not relative
- Restart Claude after config changes
Debug mode
uv run gemini-mcp-cli --debug status check- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Run quality checks (
make check) - Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
MIT License - see LICENSE for details.