Integrates with the unofficial Google Gemini CLI, allowing file access within configured directories.
A Model Context Protocol (MCP) server that wraps the Gemini CLI, allowing AI assistants like Claude to use Gemini for research and analysis tasks.
Disclaimer: This is an unofficial, community-developed tool that wraps the Google Gemini CLI. It is not affiliated with, endorsed by, or sponsored by Google. All Google and Gemini trademarks, service marks, and logos are the property of Google LLC. This project is licensed under the MIT License.
Important: This tool requires that you have the Gemini CLI installed and authenticated on your system. See the Prerequisites section for details.
# Install from GitHub (latest)
uvx --from git+https://github.com/DiversioTeam/gemini-cli-mcp gemini-mcp
# Or from PyPI (when published)
uvx gemini-mcp
git clone https://github.com/DiversioTeam/gemini-cli-mcp
cd gemini-cli-mcp
uv sync
uv run gemini-mcp
Ensure you have Python 3.10, 3.11, 3.12, or 3.13 installed. The project is tested on all these versions.
This MCP server requires the Gemini CLI to be installed and authenticated:
gemini auth login
and follow the promptsgemini -p "Hello, world!"
If you see an authentication error, make sure you've completed the login process.
You'll need an MCP-compatible client such as:
Before running the server, verify your setup:
# Check if everything is configured correctly
gemini-mcp setup
This will check:
If you see authentication errors, run:
gemini auth login
# Method 1: Run from current directory (for development)
uv run gemini-mcp
# Method 2: Run using uvx from GitHub
uvx --from git+https://github.com/DiversioTeam/gemini-cli-mcp gemini-mcp
# Method 3: Run if installed globally
gemini-mcp
# With debug logging
LOG_LEVEL=DEBUG gemini-mcp
# Install from GitHub (use -- separator for proper argument parsing)
claude mcp add gemini uvx -- --from git+https://github.com/DiversioTeam/gemini-cli-mcp.git gemini-mcp
# Or install from PyPI when published
claude mcp add gemini uvx -- gemini-mcp
Add this to ~/.config/claude-code/mcp-settings.json
:
{
"servers": {
"gemini": {
"command": "uvx",
"args": ["--from", "git+https://github.com/DiversioTeam/gemini-cli-mcp.git", "gemini-mcp"]
}
}
}
Add this to your Claude Desktop configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json
{
"mcpServers": {
"gemini": {
"command": "uvx",
"args": ["--from", "git+https://github.com/DiversioTeam/gemini-cli-mcp.git", "gemini-mcp"],
"env": {
"LOG_LEVEL": "INFO"
}
}
}
}
Send a simple prompt to Gemini.
Parameters:
prompt
(required): The prompt to sendmodel
(optional): The Gemini model to use (default: gemini-2.5-pro)context
(optional): Additional context to prepend to the promptResearch a topic with optional file context.
Parameters:
topic
(required): The research topic or questionfiles
(optional): List of file paths to include as contextmodel
(optional): The Gemini model to useAnalyze code files for various purposes.
Parameters:
files
(required): List of code files to analyzeanalysis_type
(required): Type of analysis - one of:
review
: Code review for issues and improvementsexplain
: Detailed explanation of the codeoptimize
: Performance and maintainability suggestionssecurity
: Security vulnerability analysistest
: Test case suggestionsspecific_question
(optional): Additional specific questionmodel
(optional): The Gemini model to useSummarize content from text or files.
Parameters:
content
(optional): Text content to summarizefiles
(optional): Files to summarize (alternative to content)summary_type
(optional): Type of summary - one of:
brief
: 2-3 sentence summary (default)detailed
: Comprehensive summarybullet_points
: Bullet point formatexecutive
: Executive summary for decision makersmodel
(optional): The Gemini model to useNote: Either content
or files
must be provided.
This MCP server implements several security measures:
GeminiMCPServer(allowed_directories=["/path/to/safe/dir"])
GEMINI_MCP_ALLOWED_DIRS=/path1:/path2:/path3
Clone the repository:
git clone https://github.com/DiversioTeam/gemini-cli-mcp.git
cd gemini-cli-mcp
Install development dependencies:
uv sync --all-extras --dev
Install pre-commit hooks:
uv run pre-commit install
You can add the server for local testing with Claude Code CLI:
# Method 1: Add from local directory (for development)
claude mcp add gemini-local -- uv run gemini-mcp
# Method 2: Add from PyPI (when published)
claude mcp add gemini uvx -- gemini-mcp
# Method 3: Add from GitHub (development version)
claude mcp add gemini uvx -- --from git+https://github.com/DiversioTeam/gemini-cli-mcp.git gemini-mcp
# Then you can test the functionality immediately
# Example: Send prompts, research topics, analyze code, etc.
# Run all tests with coverage
uv run pytest
# Run specific test file
uv run pytest tests/test_tools.py
# Run with verbose output
uv run pytest -v
# Run linting
uv run ruff check .
# Run formatting
uv run ruff format .
# Run type checking
uv run mypy src/
# Run security checks
uv run ruff check --select S .
Run the setup check to diagnose common issues:
gemini-mcp setup
"Gemini CLI not found in PATH"
which gemini
Authentication errors
gemini auth login
to authenticateFile access errors
GEMINI_MCP_ALLOWED_DIRS
for custom directories"Command not found" errors
gemini-mcp setup
to check your installationuv pip install -e .
Enable debug logging to see detailed information:
LOG_LEVEL=DEBUG gemini-mcp
We welcome contributions! Please:
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Check software end-of-life (EOL) dates and support status using the endoflife.date API to provide accurate lifecycle and security information.
A collection of demo files for MCP servers and clients, illustrating various transport protocols and server capabilities using Python.
MCP server for TeamCity, integrates with Claude Desktop and Cursor.
A starter project with setup instructions and example MCP servers, including a weather server.
Enables secure, contextual AI interactions with Jenkins tools via the Model Context Protocol.
Analyzes audio files and extracts metadata, tailored for game audio development workflows.
Retrieves essential network information from devices using gNMI and OpenConfig models.
Provides real-time Flutter/Dart documentation and pub.dev package information to AI assistants, supporting all packages on demand.
A starter project for building Model Context Protocol (MCP) servers with the mcp-framework.
A lightweight Java framework for building MCP servers with TCP transport via mcp-java-bridge.