Gemini CLI
Bridges Google's Gemini CLI with MCP-compatible clients and integrates OpenRouter API for access to 400+ AI models. Provides 33 specialized tools enabling multi-AI workflows, collaborations, and debates between Claude, Gemini, and other LLMs.
What is Gemini CLI?
Gemini CLI is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to bridges google's gemini cli with mcp-compatible clients and integrates openrouter api for access to 400+ ai models. provides 33 specialized tools enabling multi-ai workflows, collaborations, and debat...
Bridges Google's Gemini CLI with MCP-compatible clients and integrates OpenRouter API for access to 400+ AI models. Provides 33 specialized tools enabling multi-AI workflows, collaborations, and debates between Claude, Gemini, and other LLMs.
This server falls under the Coding Agents and Developer Tools categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Bridges Google's Gemini CLI with MCP-compatible clients and
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx gemini-cli-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Gemini CLI
Gemini CLI MCP Server bridges Google's Gemini CLI with any MCP-compatible client and integrates OpenRouter to give you access to 400+ AI models from a single server. It exposes 33 specialized tools covering Gemini prompting, multi-file analysis, code review, conversation management, cross-model comparison, and multi-AI collaboration modes including debates between Claude, Gemini, GPT, and other models. This makes it an ideal hub for workflows that require querying multiple AI models, comparing their outputs, or orchestrating complex multi-step AI reasoning chains from within Claude Desktop or Cursor.
Prerequisites
- Python 3.10 or higher with pip and uv
- Google Gemini CLI installed and authenticated (`gemini config set api_key YOUR_KEY`)
- A Google Gemini API key (from Google AI Studio)
- An OpenRouter API key (from openrouter.ai) for accessing 400+ additional models — optional but required for OpenRouter tools
- An MCP-compatible client such as Claude Desktop or Cursor
Clone the repository and set up the Python environment
Clone the gemini-cli-mcp-server repository and create an isolated Python virtual environment using uv.
git clone https://github.com/centminmod/gemini-cli-mcp-server.git
cd gemini-cli-mcp-server
uv venv && source .venv/bin/activate
uv pip install -r requirements.txtConfigure your Gemini API key
Set your Google Gemini API key using the Gemini CLI configuration command. This is required for all core Gemini tools.
gemini config set api_key YOUR_GEMINI_API_KEYSet your OpenRouter API key (optional)
Export your OpenRouter API key as an environment variable to enable access to 400+ models including GPT, Claude via OpenRouter, Llama, Mistral, and others through the OpenRouter tool suite.
export OPENROUTER_API_KEY="sk-or-v1-your-api-key-here"
# Optional: set a daily cost limit
export OPENROUTER_COST_LIMIT_PER_DAY="10.0"Test the server locally
Start the MCP server to verify it launches without errors before wiring it into your MCP client.
python server.pyConfigure your MCP client
Add the Gemini CLI MCP Server to your Claude Desktop configuration, pointing to the Python executable in your virtual environment and passing required API keys as environment variables.
{
"mcpServers": {
"gemini-cli-mcp-server": {
"command": "/path/to/gemini-cli-mcp-server/.venv/bin/python",
"args": ["/path/to/gemini-cli-mcp-server/server.py"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key"
}
}
}
}Gemini CLI Examples
Client configuration (Claude Desktop)
Full claude_desktop_config.json entry for the Gemini CLI MCP Server with both Gemini and OpenRouter keys.
{
"mcpServers": {
"gemini-cli-mcp-server": {
"command": "/path/to/gemini-cli-mcp-server/.venv/bin/python",
"args": ["/path/to/gemini-cli-mcp-server/server.py"],
"env": {
"GEMINI_API_KEY": "your-gemini-api-key",
"OPENROUTER_API_KEY": "sk-or-v1-your-openrouter-key",
"OPENROUTER_COST_LIMIT_PER_DAY": "5.0"
}
}
}
}Prompts to try
Example prompts demonstrating the multi-model and collaboration capabilities of the Gemini CLI MCP Server.
- "Use gemini_prompt to explain quantum entanglement using gemini-2.5-flash."
- "Run a security-focused code review on @src/auth.py using the gemini_review_code tool."
- "Start a debate between gemini-2.5-flash and openai/gpt-4.1-mini about microservices vs monolith architecture — 4 rounds."
- "Compare gemini-2.5-pro and anthropic/claude-3-haiku on summarizing this research paper: @paper.pdf."
- "Use gemini_git_diff_review to review my latest git diff and identify any security issues."
- "Summarize all files in the @./docs/ folder using gemini_summarize_files."Troubleshooting Gemini CLI
gemini_prompt returns authentication errors
Verify your Gemini API key is set correctly by running `gemini config set api_key YOUR_KEY` in the terminal where the server runs. Also ensure the GEMINI_API_KEY environment variable is passed through in your MCP client config env block.
OpenRouter tools fail or return model-not-found errors
Confirm OPENROUTER_API_KEY is set and starts with `sk-or-v1-`. Check your OpenRouter account has credits available. Use the `gemini_openrouter_models` tool to list currently available models before calling other OpenRouter tools.
Rate limiting errors on Gemini API calls
The server has a built-in rate limiter (default 100 requests per 60-second window). Set `GEMINI_RATE_LIMIT_REQUESTS` to a lower value matching your Gemini API tier, or spread requests across multiple tool calls with delays between them.
Frequently Asked Questions about Gemini CLI
What is Gemini CLI?
Gemini CLI is a Model Context Protocol (MCP) server that bridges google's gemini cli with mcp-compatible clients and integrates openrouter api for access to 400+ ai models. provides 33 specialized tools enabling multi-ai workflows, collaborations, and debates between claude, gemini, and other llms. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Gemini CLI?
Follow the installation instructions on the Gemini CLI GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Gemini CLI?
Gemini CLI works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Gemini CLI free to use?
Yes, Gemini CLI is open source and available under the Apache 2.0 license. You can use it freely in both personal and commercial projects.
Gemini CLI Alternatives — Similar Coding Agents Servers
Looking for alternatives to Gemini CLI? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Gemini CLI in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Gemini CLI?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.