Gemini CLI (Windows Fixed) MCP server

Windows-compatible Gemini CLI integration that addresses character encoding and parameter handling issues, providing PowerShell integration with automatic executable detection, multiple model support, sandbox mode for safe code execution, and specialized tools for brainstorming and structured editing.
Back to servers
Setup instructions
Provider
orzcls
Release date
Aug 04, 2025
Language
Go
Stats
1 star

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.

Installation Requirements

Before installing the tool, ensure you have:

  1. Node.js (v16.0.0 or higher)

    node --version  # Should be v16+
    
  2. Google Gemini CLI installed and configured

    npm install -g @google/generative-ai-cli
    
    # Verify installation
    gemini --version
    
  3. API Key from Google AI Studio

Installation Options

Quick Start with NPX (Recommended)

# Use latest version
npx [email protected]

Global Installation

# Install latest version
npm install -g [email protected]

# Run the tool
gemini-mcp-tool-windows-fixed

Updating Existing Installation

# Uninstall old version and install latest
npm uninstall -g gemini-mcp-tool-windows-fixed
npm cache clean --force
npm install -g [email protected]

MCP Client Configuration

Claude Code (One-Line Setup)

# 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.

Trae AI Configuration

  1. Open: %APPDATA%\Trae\User\mcp.json
  2. Add this configuration:
{
  "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"
    }
  }
}

Claude Desktop Configuration

  1. Open: %APPDATA%\Claude\claude_desktop_config.json
  2. Add this configuration:
{
  "mcpServers": {
    "gemini-cli": {
      "command": "npx",
      "args": ["-y", "[email protected]"],
      "env": {
        "GEMINI_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
      }
    }
  }
}

API Key Configuration

Option 1: MCP Configuration (Recommended)

Replace YOUR_ACTUAL_API_KEY_HERE in the configuration above with your actual API key.

Option 2: Environment Variable

# 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

Available Tools

The MCP server provides several tools for AI assistants:

ask-gemini

Interact with Google Gemini for analysis and questions.

Parameters:

  • prompt (required): The analysis request. Use @ syntax for file references
  • model (optional): Gemini model to use (default: gemini-2.5-pro)
  • sandbox (optional): Enable sandbox mode for safe code execution
  • changeMode (optional): Enable structured change mode
  • chunkIndex (optional): Chunk index for continuation
  • chunkCacheKey (optional): Cache key for continuation

brainstorm

Generate creative ideas using various brainstorming frameworks.

Parameters:

  • prompt (required): Brainstorming challenge or question
  • model (optional): Gemini model to use
  • methodology (optional): Framework (divergent, convergent, scamper, etc.)
  • domain (optional): Domain context (software, business, creative, etc.)
  • constraints (optional): Known limitations or requirements
  • existingContext (optional): Background information
  • ideaCount (optional): Number of ideas to generate (default: 12)
  • includeAnalysis (optional): Include feasibility analysis (default: true)

fetch-chunk

Retrieve cached chunks from changeMode responses.

Parameters:

  • cacheKey (required): Cache key from initial response
  • chunkIndex (required): Chunk index to retrieve (1-based)

Additional Tools

  • timeout-test: Test timeout prevention mechanisms
  • ping: Test connection to the server
  • Help: Display help information about available tools

Usage Examples

Natural Language Examples

With File References (using @ syntax):

  • "ask gemini to analyze @src/main.js and explain what it does"
  • "use gemini to summarize @. the current directory"
  • "analyze @package.json and tell me about dependencies"

General Questions:

  • "ask gemini to search for the latest tech news"
  • "use gemini to explain div centering"
  • "ask gemini about best practices for React development"

Using Sandbox Mode:

  • "use gemini sandbox to create and run a Python script that processes data"
  • "ask gemini to safely test @script.py and explain what it does"

Slash Commands (for Claude Code Users)

  • /analyze: Analyzes files or directories using Gemini
  • /sandbox: Safely tests code or scripts in Gemini's sandbox environment
  • /help: Displays the Gemini CLI help information
  • /ping: Tests the connection to the server

Troubleshooting

Common Issues

"Command not found: gemini"

npm install -g @google/generative-ai-cli

"API key not found"

# Check if API key is set
echo $env:GEMINI_API_KEY

# Set if empty
$env:GEMINI_API_KEY = "your-api-key"

"Permission denied"

# Check execution policy
Get-ExecutionPolicy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Testing Installation

1. Test Gemini CLI

gemini -p "Hello, how are you?"

2. Test MCP Tool

npx -y gemini-mcp-tool-windows-fixed
# Should show: [GMCPT] Gemini CLI MCP Server (Fixed) started

3. Test MCP Integration

  1. Restart your MCP client (Trae AI, Claude Desktop)
  2. Try asking: "Use gemini to explain what MCP is"
  3. Check for successful responses

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later