Get the FREE Ultimate OpenClaw Setup Guide →

gemini -tool

MCP server that enables AI assistants to interact with Google Gemini CLI, leveraging Gemini's massive token window for large file analysis and codebase understanding

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio jamubc-gemini-mcp-tool npx -y gemini-mcp-tool

How to use

Gemini MCP Tool is an MCP server that bridges Claude/AI assistants with the Google Gemini Command Line Interface. It enables large, token-efficient analysis by delegating heavy lifting to Gemini within the MCP workflow. The server exposes tools tailored for Gemini interactions, including asking Gemini for its perspective, sandboxed code testing, and quick help utilities. Use it to analyze large files or codebases, explain complex snippets, search for information, or generate insights directly inside Claude Code or other MCP clients.

Once the MCP server is running (via npx gemini-mcp-tool or a global install), you can interact with Gemini through the server’s tools: ask-gemini to request Gemini’s analysis or perspective on a prompt or file reference; sandbox to run code or commands in Gemini’s sandbox environment; Ping to verify connectivity; and Help to view CLI-like guidance. You can reference files using the @ syntax in prompts (e.g., @src/main.js) to have Gemini examine or explain specific parts of your project. The MCP tooling is designed to minimize token usage in your main prompt by letting Gemini handle heavy analysis within its own environment.

Typical usage flows include: configuring the MCP server in your Claude Desktop or MCP client with the npx-based command, then in Claude Code or other clients invoking analyze or the slash commands to prompt Gemini via the server. For workflows involving large codebases or datasets, use prompts that leverage the @file references to keep prompts concise while extending Gemini’s analysis window.

How to install

Prerequisites

  • Node.js v16.0.0 or higher
  • Access to the Gemini CLI (Google Gemini) and its authentication/configuration

Installation options Option A: Run without installing locally (recommended for quick use)

npx -y gemini-mcp-tool

Option B: Install globally and run via CLI when desired

npm install -g gemini-mcp-tool
# Run (depending on your MCP client workflow)
gemini-mcp-tool

Configuration (example for Claude Desktop)

  1. Add MCP server to Claude Desktop config using the npx approach:
{
  "mcpServers": {
    "gemini-cli": {
      "command": "npx",
      "args": ["-y", "gemini-mcp-tool"]
    }
  }
}
  1. If you install globally, configure as follows:
{
  "mcpServers": {
    "gemini-cli": {
      "command": "gemini-mcp-tool"
    }
  }
}

Verify installation

  • In Claude Code or your MCP client, run a test command such as invoking /ping or /help to ensure the server responds.

Additional notes

Tips and common issues:

  • Ensure Node.js is installed and accessible in your PATH.
  • The Gemini CLI must be installed and configured separately; the MCP tool acts as a bridge to Gemin i via MCP prompts.
  • When using the npx setup, you don’t need a local install; the command downloads and runs the tool on demand.
  • If you experience authentication or network issues with Gemini CLI, verify your Gemini credentials and network access from the environment running the MCP server.
  • In Claude Desktop, after updating mcpServers, restart your terminal session or reload Claude to pick up the new configuration.
  • You can reference files with the @ syntax to leverage Gemini’s analysis window effectively while keeping prompts concise.

Related MCP Servers

Sponsor this space

Reach thousands of developers