Gemini CLI (Windows Fixed)

Gemini CLI (Windows Fixed)

orzcls

A Windows-compatible MCP server that integrates with Google's Gemini CLI through PowerShell, fixing encoding and compatibility issues for AI assistants on Windows systems.

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.

7428 views4Local (stdio)

What it does

  • Execute Gemini CLI commands through PowerShell
  • Run code in sandbox mode for safety
  • Switch between multiple Gemini models
  • Generate brainstorming sessions
  • Perform structured text editing
  • Auto-detect PowerShell executables

Best for

Windows developers using Gemini AI modelsAI assistant integration on Windows systemsSafe code execution and testingPowerShell-based AI workflows
Windows-specific compatibility fixesCross-terminal support (PowerShell, CMD, VS Code)Automatic PATH environment handling

About Gemini CLI (Windows Fixed)

Gemini CLI (Windows Fixed) is a community-built MCP server published by orzcls that provides AI assistants with tools and capabilities via the Model Context Protocol. Gemini CLI (Windows Fixed): Enhanced Windows CLI tool with PowerShell, multi-model support, sandboxed code, and advanced It is categorized under ai ml, developer tools.

How to install

You can install Gemini CLI (Windows Fixed) in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Gemini CLI (Windows Fixed) is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

🚀 Gemini MCP Tool - Windows Fixed Version

npm version License: MIT

Latest Version v1.0.21 - Fixed cross-terminal compatibility issues and fetch-chunk format errors

A Windows-compatible Model Context Protocol (MCP) server that enables AI assistants to interact with Google's Gemini CLI. This is a fixed version specifically designed to work seamlessly on Windows environments with PowerShell support.

Note: This is an enhanced version of the original gemini-mcp-tool with Windows-specific fixes and improvements.

🆕 Latest Updates (v1.0.21)

  • 🔧 Fixed Cross-Terminal Compatibility - Resolved Node.js path not found issues in different terminal environments
  • 📦 Fixed fetch-chunk Format Error - Fixed MCP protocol format mismatch in chunked responses
  • 🛡️ Enhanced PATH Environment Variable Handling - Automatically adds common Node.js installation paths
  • Full Compatibility with All Terminals - Supports PowerShell, CMD, VS Code Terminal, Trae AI, CherryStudio, etc.
  • 🚀 Improved Error Handling - Better error messages and debug output

v1.0.3 Updates

  • 🆕 PowerShell Path Parameter Support - Added optional powershellPath parameter allowing users to customize PowerShell executable path
  • Fixed PowerShell Execution Error - Resolved spawn powershell.exe ENOENT issue
  • Improved Windows Compatibility - Automatic detection of available PowerShell versions
  • Fixed Undefined Variable Error - Fixed args variable issue in executeCommandWithPipedInput function
  • Enhanced Error Handling - Better error messages and debug output
  • Backward Compatibility - Existing configurations require no modification, automatically uses default detection logic

✨ Features

  • 🪟 Windows Compatible: Full PowerShell support with Windows-specific path handling
  • 📊 Large Context Window: Leverage Gemini's massive token window for analyzing entire codebases
  • 📁 File Analysis: Analyze files using @filename syntax
  • 🔒 Sandbox Mode: Safe code execution environment
  • 🔗 MCP Integration: Seamless integration with MCP-compatible AI assistants (Trae AI, Claude Desktop)
  • ⚡ NPX Ready: Easy installation and usage with NPX
  • 🔧 Environment Variable Support: Flexible API key configuration

This Windows-fixed version resolves:

  • PowerShell parameter passing issues
  • Character encoding problems with Chinese/Unicode text
  • Command line argument escaping on Windows
  • Environment variable handling

📋 Prerequisites

Before using this 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: Get your API key from Google AI Studio

📦 Installation

Quick Start with NPX (Recommended)

# Use latest version (recommended)
npx gemini-mcp-tool-windows-fixed@1.0.21

# Or use latest version tag
npx -y gemini-mcp-tool-windows-fixed@latest

Global Installation

# Install latest version
npm install -g gemini-mcp-tool-windows-fixed@1.0.21

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

Updating Existing Installation

If you previously installed an older version:

# Uninstall old version and install latest
npm uninstall -g gemini-mcp-tool-windows-fixed
npm cache clean --force
npm install -g gemini-mcp-tool-windows-fixed@1.0.21

⚙️ MCP Client Configuration

Claude Code (One-Line Setup)

# One-command setup for Claude Code
claude mcp add gemini-cli -- npx -y gemini-mcp-tool-windows-fixed@1.0.21

Verify Installation: Type /mcp inside Claude Code to verify the gemini-cli MCP is active. 1

Alternative: Import from Claude Desktop

If you already have it configured in Claude Desktop:

  1. Add to your Claude Desktop config (see below)
  2. Import to Claude Code:
    claude mcp add-from-claude-desktop
    

Trae AI (Recommended)

  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",
        "gemini-mcp-tool-windows-fixed@1.0.21"
      ],
      "env": {
        "GEMINI_API_KEY": "YOUR_ACTUAL_API_KEY_HERE"
      },
      "isActive": true,
      "providerUrl": "https://github.com/orzcls/gemini-mcp-tool-windows-fixed"
    }
  }
}

Claude Desktop

  1. Open: %APPDATA%\Claude\claude_desktop_config.json
  2. Add this configuration:
{
  "mcpServers": {
    "gemini-cli": {
      "command": "npx",
      "args": ["-y", "gemini-mcp-tool-windows-fixed@1.0.21"],
      "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

Configuration File Locations

Claude Desktop:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/claude/claude_desktop_config.json

Trae AI:

  • Windows: %APPDATA%\Trae\User\mcp.json

🛠️ Available Tools

This MCP server provides the following tools for AI assistants:

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

2. 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, design-thinking, lateral, auto)
  • 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)

3. fetch-chunk

Retrieve cached chunks from changeMode responses.

Parameters:

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

4. timeout-test

Test timeout prevention mechanisms.

Parameters:

  • duration (required): Duration in milliseconds (minimum: 10ms)

5. ping

Test connection to the server.

Parameters:

  • prompt (optional): Message to echo back

6. Help

Display help information about available tools.

🎯 Usage Examples

Once configured, you can use the following tools through your MCP client:

Natural Language Examples 2

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 (without files):

  • "ask gemini to search for the latest tech news"
  • "use gemini to explain div centering"
  • "ask gemini about best practices for React development related to @file_im_confused_about"
  • "use gemini to explain index.html"
  • "understand the massive project using gemini"
  • "ask gemini to search for latest news"

Using Gemini CLI's Sandbox Mode (-s): 2 The sandbox mode allows you to safely test code changes, run scripts, or execute potentially risky operations in an isolated environment.

  • "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"
  • "use gemini sandbox to install numpy and create a data visualization"
  • "test this code safely: Create a script that makes HTTP requests to an API"

Slash Commands (for Claude Code Users) 2

You can use these commands directly in Claude Code's interface (compatibility with other clients has not been tested):

  • /analyze: Analyzes files or directories using Gemini, or asks general questions
    • prompt (required): The analysis prompt. Use @ syntax to include files (e.g., `/analyze prompt:@src/ summa

README truncated. View full README on GitHub.

Alternatives

Related Skills

Browse all skills
cli-builder

Guide for building TypeScript CLIs with Bun. Use when creating command-line tools, adding subcommands to existing CLIs, or building developer tooling. Covers argument parsing, subcommand patterns, output formatting, and distribution.

2
winapp-cli

Windows App Development CLI (winapp) for building, packaging, and deploying Windows applications. Use when asked to initialize Windows app projects, create MSIX packages, generate AppxManifest.xml, manage development certificates, add package identity for debugging, sign packages, or access Windows SDK build tools. Supports .NET, C++, Electron, Rust, Tauri, and cross-platform frameworks targeting Windows.

1
mcp-developer

Use when building MCP servers or clients that connect AI systems with external tools and data sources. Invoke for MCP protocol compliance, TypeScript/Python SDKs, resource providers, tool functions.

0
cli-developer

Use when building CLI tools, implementing argument parsing, or adding interactive prompts. Invoke for CLI design, argument parsing, interactive prompts, progress indicators, shell completions.

0
gemini-video-understanding

Analyze videos using Google's Gemini API - describe content, answer questions, transcribe audio with visual descriptions, reference timestamps, clip videos, and process YouTube URLs. Supports 9 video formats, multiple models (Gemini 2.5/2.0), and context windows up to 2M tokens (6 hours of video).

0
azure-identity-rust

Azure Identity SDK for Rust authentication. Use for DeveloperToolsCredential, ManagedIdentityCredential, ClientSecretCredential, and token-based authentication. Triggers: "azure-identity", "DeveloperToolsCredential", "authentication rust", "managed identity rust", "credential rust".

0