The Gemini MCP Tool is a Windows-compatible Model Context Protocol (MCP) server that enables AI assistants to interact with Google's Gemini CLI. This fixed version is specifically designed to work seamlessly on Windows environments with PowerShell support, resolving compatibility issues found in the original version.
Before installing the tool, ensure you have:
Node.js (v16.0.0 or higher)
node --version # Should be v16+
Google Gemini CLI installed and configured
npm install -g @google/generative-ai-cli
# Verify installation
gemini --version
API Key from Google AI Studio
# Use latest version
npx [email protected]
# Install latest version
npm install -g [email protected]
# Run the tool
gemini-mcp-tool-windows-fixed
# Uninstall old version and install latest
npm uninstall -g gemini-mcp-tool-windows-fixed
npm cache clean --force
npm install -g [email protected]
# One-command setup for Claude Code
claude mcp add gemini-cli -- npx -y [email protected]
Verify Installation:
Type /mcp
inside Claude Code to verify the gemini-cli
MCP is active.
%APPDATA%\Trae\User\mcp.json
{
"mcpServers": {
"gemini-cli": {
"name": "gemini-cli",
"description": "Windows-compatible Gemini MCP Tool",
"baseUrl": "",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GEMINI_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
},
"isActive": true,
"providerUrl": "https://github.com/orzcls/gemini-mcp-tool-windows-fixed"
}
}
}
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": ["-y", "[email protected]"],
"env": {
"GEMINI_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
}
}
}
}
Replace YOUR_ACTUAL_API_KEY_HERE
in the configuration above with your actual API key.
# Temporary (current session)
$env:GEMINI_API_KEY = "your-actual-api-key"
# Permanent (user level)
[Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "your-actual-api-key", "User")
# Verify
echo $env:GEMINI_API_KEY
The MCP server provides several tools for AI assistants:
Interact with Google Gemini for analysis and questions.
Parameters:
prompt
(required): The analysis request. Use @
syntax for file referencesmodel
(optional): Gemini model to use (default: gemini-2.5-pro
)sandbox
(optional): Enable sandbox mode for safe code executionchangeMode
(optional): Enable structured change modechunkIndex
(optional): Chunk index for continuationchunkCacheKey
(optional): Cache key for continuationGenerate creative ideas using various brainstorming frameworks.
Parameters:
prompt
(required): Brainstorming challenge or questionmodel
(optional): Gemini model to usemethodology
(optional): Framework (divergent
, convergent
, scamper
, etc.)domain
(optional): Domain context (software
, business
, creative
, etc.)constraints
(optional): Known limitations or requirementsexistingContext
(optional): Background informationideaCount
(optional): Number of ideas to generate (default: 12)includeAnalysis
(optional): Include feasibility analysis (default: true)Retrieve cached chunks from changeMode responses.
Parameters:
cacheKey
(required): Cache key from initial responsechunkIndex
(required): Chunk index to retrieve (1-based)timeout-test
: Test timeout prevention mechanismsping
: Test connection to the serverHelp
: Display help information about available toolsWith File References (using @ syntax):
General Questions:
Using Sandbox Mode:
npm install -g @google/generative-ai-cli
# Check if API key is set
echo $env:GEMINI_API_KEY
# Set if empty
$env:GEMINI_API_KEY = "your-api-key"
# Check execution policy
Get-ExecutionPolicy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
gemini -p "Hello, how are you?"
npx -y gemini-mcp-tool-windows-fixed
# Should show: [GMCPT] Gemini CLI MCP Server (Fixed) started
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "gemini-cli" '{"name":"gemini-cli","description":"Windows-compatible Gemini MCP Tool","baseUrl":"","command":"npx","args":["-y","[email protected]"],"env":{"GEMINI_API_KEY":"YOUR_ACTUAL_API_KEY_HERE"},"isActive":true,"providerUrl":"https://github.com/orzcls/gemini-mcp-tool-windows-fixed"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"gemini-cli": {
"name": "gemini-cli",
"description": "Windows-compatible Gemini MCP Tool",
"baseUrl": "",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GEMINI_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
},
"isActive": true,
"providerUrl": "https://github.com/orzcls/gemini-mcp-tool-windows-fixed"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"gemini-cli": {
"name": "gemini-cli",
"description": "Windows-compatible Gemini MCP Tool",
"baseUrl": "",
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"GEMINI_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
},
"isActive": true,
"providerUrl": "https://github.com/orzcls/gemini-mcp-tool-windows-fixed"
}
}
}
3. Restart Claude Desktop for the changes to take effect