gemini-cli-mcp-server

gemini-cli-mcp-server

A MCP server wrapper for Google's Gemini CLI that enables AI assistants to perform searches, have conversations, list sessions, and analyze files using Gemini's capabilities.

Category
Visit Server

README

Gemini CLI MCP Server

CI

šŸ‡ÆšŸ‡µ ę—„ęœ¬čŖž

A simple MCP server wrapper for Google's Gemini CLI that enables AI assistants to use Gemini's capabilities through the Model Context Protocol.

✨ Features

  • 4 Tools: googleSearch, chat, listSessions, analyzeFile
  • Session Persistence: Resume previous conversations with session IDs (supports custom IDs)
  • Internationalization: English and Japanese support
  • Cross-Platform: Windows, macOS, and Linux compatible

šŸš€ Quick Setup

With Claude Code

claude mcp add -s project gemini-cli -- npx gemini-cli-mcp-server --allow-npx

Manual Configuration

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

šŸ› ļø Available Tools

googleSearch

Performs a Google search using Gemini CLI.

Parameter Required Description
query āœ… The search query
limit Maximum number of results
raw Return structured results with URLs
model Gemini model (default: gemini-2.5-pro)

chat

Have a conversation with Gemini.

Parameter Required Description
prompt āœ… The conversation prompt
sessionId Resume a previous session (supports custom IDs like "my-task")
model Gemini model (default: gemini-2.5-pro)

listSessions

Lists available Gemini CLI sessions. Returns session IDs that can be used with chat's sessionId parameter.

analyzeFile

Analyze files using Gemini's multimodal capabilities.

Parameter Required Description
filePath āœ… Absolute path to the file
prompt Additional analysis instructions
sessionId Resume a previous session (maintains context)
model Gemini model (default: gemini-2.5-pro)

Supported file types:

  • Images: PNG, JPG, JPEG, GIF, WEBP, SVG, BMP
  • Text: TXT, MD
  • Documents: PDF

šŸ’¾ Session Management

You can use Custom Session IDs (Client IDs) to manage conversations. The server automatically maps these to Gemini CLI's internal session IDs.

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "chat",
    "arguments": {
      "prompt": "Hello!",
      "sessionId": "my-task-1"
    }
  },
  "id": 1
}
  • Persistence: Mappings are stored in memory. They will be reset if the MCP server restarts (Gemini's internal history remains, but the link to your custom ID is lost).
  • Listing: Use listSessions to see active mappings.

🌐 Language Settings

Tool descriptions and error messages support multiple languages:

# Japanese
MCP_LANGUAGE=ja npx gemini-cli-mcp-server --allow-npx

# English (default)
MCP_LANGUAGE=en npx gemini-cli-mcp-server --allow-npx

System locale (e.g., LANG=ja_JP.UTF-8) is also auto-detected.

šŸ“ Development

# Clone and install
git clone https://github.com/Cinnamobot/gemini-cli-mcp-server
cd gemini-cli-mcp-server
bun install

# Run tests
bun test

# Build
bun run build

šŸ™ Credits

This project is based on choplin/mcp-gemini-cli.

Additions from fork

  • listSessions tool: List available Gemini CLI sessions
  • Session persistence: Resume conversations with sessionId parameter
  • Internationalization: Japanese/English support
  • Windows compatibility: Custom findExecutable function (no which/where dependency)
  • CI/CD: GitHub Actions for automated testing and building

šŸ“„ License

MIT License - see LICENSE file for details.

šŸ”— Related Links

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured