GE

Gemini Bridge MCP Server: Claude-to-Gemini Official CLI

Enable Claude-to-Gemini interactions with a lightweight MCP server via the official CLI, eliminating API costs with a stateless architecture.

Overview

Gemini Bridge MCP Server provides a lightweight, stateless bridge that enables interactions between Anthropic Claude and Google Gemini models using the Model Context Protocol (MCP). It runs as a small server process you control and exposes an MCP-compatible endpoint that forwards requests from a Claude environment to a Gemini runtime — allowing Claude-based workflows to leverage Gemini without switching APIs or paying for redundant Claude-Gemini proxying.

The server is deliberately minimal and stateless: it does not persist conversations or manage tokens itself. Instead, it acts as a protocol adapter and request router, driven by the official MCP CLI bundled with the project. This architecture reduces operational complexity and cost because requests are translated and proxied directly; no extra storage or long-running session management is required.

Features

  • Stateless MCP server that forwards Claude-style MCP requests to Gemini backends
  • Official CLI-driven lifecycle (start, stop, configure) for local or containerized use
  • Minimal dependency footprint for quick local setup and CI-friendly deployment
  • Configurable target model, endpoint, and authentication credentials
  • HTTP/JSON API compatible with MCP clients and Claude integrations
  • Optional Docker deployment for isolated environments

Installation / Configuration

Clone the repository and run the bundled CLI. The examples below show the common installation patterns: running locally from source and running via Docker.

Clone repository

git clone https://github.com/eLyiN/gemini-bridge.git
cd gemini-bridge

Run from source (example)

# Install dependencies if needed (node/python/go etc. depending on repo)
# Example: if the project uses Node.js
npm install
# Start the MCP bridge server
npm run start
# or via the provided CLI
./bin/gemini-bridge serve --config ./config.yaml

Run with Docker

# Build the image (if Dockerfile is included)
docker build -t gemini-bridge:latest .

# Run server exposing port 8080
docker run -d --name gemini-bridge -p 8080:8080 \
  -v $(pwd)/config.yaml:/app/config.yaml \
  gemini-bridge:latest

Example minimal configuration (config.yaml)

server:
  host: 0.0.0.0
  port: 8080

target:
  provider: gemini
  endpoint: https://api.gemini.example/v1
  model: gemini-pro
  api_key_path: /secrets/gemini_key.txt

mcp:
  stateless: true
  allow_insecure_local: false

Configuration options (summary)

OptionTypeDefaultDescription
server.portnumber8080Port the MCP server listens on
target.endpointstringTarget Gemini endpoint URL
target.modelstringGemini model name to use
target.api_key_pathstringLocal path to API key or credential file
mcp.statelessbooltrueWhether to avoid session persistence

Available Resources

  • Source code and issues: https://github.com/eLyiN/gemini-bridge
  • MCP (Model Context Protocol) specifications and docs: consult your MCP client documentation or the repository README for implementation details
  • Example config and CLI usage: see the repo’s sample config.yaml and ./bin CLI script

Use Cases

  1. Local Claude-to-Gemini development

    • Run the MCP bridge on your workstation and configure a Claude-based tool to target the bridge’s MCP endpoint. You can test Gemini models in development without modifying the Claude client codebase.
  2. CI integration for model evaluation

    • Use the stateless bridge in CI jobs to direct evaluation queries to Gemini models. Because the server does not persist state, tests remain deterministic and ephemeral.
  3. Cost-optimized production routing

    • When migrating or augmenting Claude deployments with Gemini capabilities, place the bridge as a protocol adapter. This avoids reimplementing Claude-side code and reduces API switching costs: the bridge performs one-time request translation and forwarding.
  4. Hybrid model orchestration

    • Use the bridge to split workloads: keep text generation in Gemini while leaving Claude-based orchestration unchanged. The MCP server acts as a thin translator between orchestration and target model endpoints.

Example request

Once running, the bridge accepts MCP-style requests over HTTP. Example curl (adjust path/port to your setup):

curl -X POST "http://localhost:8080/mcp" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-compatible",
    "messages": [{"role":"user","content":"Summarize the following document..."}]
  }'

The bridge will translate and forward to the configured Gemini endpoint, returning Gemini responses in an MCP-compatible JSON shape.

Notes and troubleshooting

  • Ensure the target Gemini API key is readable by the process (secure local path or mounted secret).
  • Because the server is stateless by design, session continuity must be handled by the client if required.
  • Check the repository issues for known compatibility notes with specific Gemini endpoints or MCP client versions.

For detailed examples, the repository contains sample configs and the CLI help output. Visit the GitHub project to get the latest usage instructions and updates.

Tags:ai-ml

Common Issues & Solutions

The MCP server currently lacks web search capabilities that are present in the gemini CLI, limiting its functionality for users who want online search integration.

✓ Solution

I ran into this too! Integrating web search features from the gemini CLI would significantly enhance the MCP server's capabilities. By allowing the MCP to delegate web search tasks to gemini, we can provide users with real-time online information right from their applications. This would streamline workflows and improve user experience. To implement this, you can install the necessary package with the following command: npm install @ChromeDevTools/chrome-devtools-mcp

npm install @ChromeDevTools/chrome-devtools-mcp