New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@staticpayload/gemini-mcp

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@staticpayload/gemini-mcp

MCP server that bridges Google's Gemini CLI to any MCP-compatible AI assistant

npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

MCP Protocol Google Gemini Node.js 20+ GPL-3.0 License


✦ gemini-cli-mcp

Bridge Google's Gemini CLI to any MCP-compatible AI assistant

Quick Start • Tools • Usage • Configuration • How It Works


┌─────────────────────────────────────────────────────────────────┐
│                                                                 │
│   Claude / Cursor / Any MCP Client                              │
│                    │                                            │
│                    ▼                                            │
│   ┌─────────────────────────────────────┐                       │
│   │        gemini-cli-mcp               │                       │
│   │   ┌─────────┐ ┌─────────┐ ┌───────┐ │                       │
│   │   │ prompt  │ │ models  │ │  raw  │ │   ◄── MCP Tools       │
│   │   └────┬────┘ └────┬────┘ └───┬───┘ │                       │
│   └────────┼───────────┼─────────┼──────┘                       │
│            │           │         │                              │
│            └───────────┼─────────┘                              │
│                        ▼                                        │
│            ┌───────────────────────┐                            │
│            │    Gemini CLI         │   ◄── Your existing auth   │
│            │    (gemini binary)    │       & configuration      │
│            └───────────────────────┘                            │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

✨ Features

🔌 Zero Configuration

Uses your existing Gemini CLI installation and authentication. No API keys to manage, no duplicate auth flows.

🚀 Universal Access

Register once, use Gemini from Claude, Cursor, Windsurf, or any MCP-compatible client.

⚡ Production Ready

Health checks, graceful shutdown, 5-minute timeouts, proper signal handling. Built for reliability.

🛠️ Three Powerful Tools

Prompt execution, model listing, and raw CLI access for advanced use cases.

🚀 Quick Start

Prerequisites

# Install Gemini CLI globally
npm install -g @google/gemini-cli

# Authenticate (run once)
gemini

Run the MCP Server

npx gemini-cli-mcp

That's it. The server starts and waits for MCP connections via stdio.

🔧 Tools

gemini_prompt

Send a prompt to Gemini and get a response.

ParameterTypeRequiredDescription
promptstring✅The prompt to send
modelstring❌Model override (e.g., gemini-2.5-flash)

gemini_models

List all available Gemini models.

No parameters required.

gemini_raw

Execute any Gemini CLI command with raw arguments.

ParameterTypeRequiredDescription
argsstring[]✅CLI arguments array

Example: ["--version"] or ["-p", "Hello", "-m", "gemini-2.5-pro"]

📋 Usage

With Claude Desktop

Add to your Claude configuration (~/.claude/config.json):

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["gemini-cli-mcp"]
    }
  }
}

With Claude CLI

claude mcp add gemini -- npx gemini-cli-mcp

With Cursor / Windsurf

Add to your MCP settings:

{
  "gemini": {
    "command": "npx",
    "args": ["gemini-cli-mcp"]
  }
}

⚙️ Configuration

Environment Variables

VariableDescription
GEMINI_CLI_PATHOverride the Gemini binary location
GEMINI_API_KEYGemini API key (if not using OAuth)
GOOGLE_APPLICATION_CREDENTIALSService account credentials path

Inherited Configuration

The server inherits your full environment, so existing Gemini configuration works automatically:

~/.config/gemini/          ← CLI configuration
~/.gemini/settings.json    ← Gemini settings
GEMINI_* env vars          ← All Gemini environment variables
gcloud auth                ← Application default credentials

🔬 How It Works

┌──────────────┐     stdio      ┌─────────────────┐     spawn     ┌─────────────┐
│  MCP Client  │ ◄────────────► │  gemini-cli-mcp │ ◄───────────► │ gemini CLI  │
│  (Claude)    │   JSON-RPC     │    (Node.js)    │   child proc  │  (binary)   │
└──────────────┘                └─────────────────┘               └─────────────┘
  • MCP Client sends JSON-RPC requests over stdio
  • gemini-cli-mcp translates MCP tool calls to Gemini CLI commands
  • Gemini CLI executes with your existing auth & config
  • Response flows back through the same path

The server is a thin translation layer—all heavy lifting happens in Gemini CLI.

🏗️ Architecture

gemini-cli-mcp/
├── src/
│   └── index.js      # MCP server (single file, ~300 lines)
├── package.json      # npm package with bin entry
└── README.md

Design Principles:

  • Single responsibility: translate MCP ↔ Gemini CLI
  • Zero global state
  • Fail fast with clear errors
  • Minimal dependencies (@modelcontextprotocol/sdk, zod)

🐛 Troubleshooting

"Gemini CLI not found"

# Ensure gemini is installed and in PATH
which gemini

# Or set the path explicitly
export GEMINI_CLI_PATH=/path/to/gemini

"Auth method not set"

# Option 1: Run Gemini CLI once to authenticate
gemini

# Option 2: Set API key
export GEMINI_API_KEY=your-api-key

Server not responding

Check stderr output for health check results:

[gemini-mcp] Gemini CLI: /usr/local/bin/gemini (0.22.4)

📄 License

GPL-3.0 © 2024

Built with ❤️ for the MCP ecosystem

Keywords

mcp

FAQs

Package last updated on 29 Dec 2025

Related posts