npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@staticpayload/gemini-mcp

v1.1.0

Published

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

Downloads

171

Readme

┌─────────────────────────────────────────────────────────────────┐
│                                                                 │
│   Claude / Cursor / Any MCP Client                              │
│                    │                                            │
│                    ▼                                            │
│   ┌─────────────────────────────────────┐                       │
│   │     @staticpayload/gemini-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 @staticpayload/gemini-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.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | prompt | string | ✅ | The prompt to send | | model | string | ❌ | 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.

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | args | string[] | ✅ | 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": ["@staticpayload/gemini-mcp"]
    }
  }
}

With Claude CLI

claude mcp add gemini -- npx @staticpayload/gemini-mcp

With Cursor / Windsurf

Add to your MCP settings:

{
  "gemini": {
    "command": "npx",
    "args": ["@staticpayload/gemini-mcp"]
  }
}

⚙️ Configuration

Environment Variables

| Variable | Description | |----------|-------------| | GEMINI_CLI_PATH | Override the Gemini binary location | | GEMINI_API_KEY | Gemini API key (if not using OAuth) | | GOOGLE_APPLICATION_CREDENTIALS | Service 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

🤖 Autonomous Setup

For production deployments with Vertex AI authentication and zero interactive prompts, use the automated setup:

# 1. Copy environment template
cp .env.example .env

# 2. Edit .env with your GCP project
# PROJECT_ID=your-gcp-project-id

# 3. Authenticate with gcloud
gcloud auth application-default login

# 4. Run automated setup
./setup-gemini.sh

# 5. Use Gemini autonomously
./run-gemini.sh

Features:

  • ✅ Vertex AI authentication (no API keys)
  • ✅ No permission prompts for file/shell/web operations
  • ✅ GA/Preview model routing
  • ✅ MCP server integration
  • ✅ Sandbox directory (avoids macOS permission issues)

See GEMINI_SETUP.md for complete documentation.



🔬 How It Works

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

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


🏗️ Architecture

@staticpayload/gemini-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