Gemini CLI MCP Bridge MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add gemini-cli-bridge -- npx -y @intelligentinternet/gemini-cli-mcp-openai-bridge
README.md

Unified MCP endpoint and OpenAI-compatible API for Gemini CLI tools

Gemini CLI - MCP/OpenAI Bridge Server

中文文档

🎉 Built on Open Source Gemini CLI - Thanks to Google!
This project is built upon the open-source Gemini CLI by Google. We appreciate Google's commitment to open source and their contribution to the developer community.

@intelligentinternet/gemini-cli-mcp-openai-bridge (or gemini-cli-bridge) is a versatile server application designed as a powerful extension to the gemini-cli ecosystem. It serves two primary roles:

  1. MCP Toolkit: Exposes all built-in tools from gemini-cli (such as file system operations, web search powered by Gemini models, and web content understanding) through a unified MCP endpoint.

    • Can also connect to any number of external MCP servers (only allowed in YOLO mode or when specific tools are configured in configured mode).
  2. OpenAI-Compatible API Bridge: Provides a fully compatible endpoint with the OpenAI Chat Completions API (/v1/chat/completions). This enables any third-party tool or application that supports the OpenAI API (such as Open WebUI) to seamlessly interact with the underlying Gemini models of gemini-cli.

Features

  • Built on gemini-cli: Directly built upon the core functionality of gemini-cli, ensuring deep integration with Gemini models.
  • Native gemini-cli Tools: Exposes gemini-cli's built-in tools through the MCP protocol.
  • External MCP Tool Aggregation: Acts as an MCP hub, connecting and proxying tools from other tool servers (only in yolo mode or when specific tools are configured in restricted mode).
  • Full OpenAI API Compatibility: Provides /v1/chat/completions and /v1/models endpoints with support for both streaming and non-streaming requests.
  • Flexible Model Configuration: Allows configuring separate default LLM models for tool execution (such as web search summarization).
  • Inherited Configuration & Authentication: Automatically uses the same settings and authentication state as the main gemini-cli tool, requiring no duplicate configuration.
  • Configurable Security Policies: Implements MCP tool-based security model with read-only, edit, configured, and yolo modes to control tool execution.

Prerequisites

  • Node.js v18 or higher
  • All dependencies and configuration required by Gemini CLI
    • This project automatically installs gemini-cli as a submodule (from the official gemini-cli GitHub repository), so you don't need to install it separately.
    • If you already have gemini-cli installed, it will be overridden by this project's submodule version.

Installation

npm install -g @intelligentinternet/gemini-cli-mcp-openai-bridge

Usage

Security Warning: This bridge server does not ask for user confirmation when invoking tools.

  • For your safety, the MCP bridge service defaults to read-only mode and will not bridge other MCP services you have configured in settings.json.
  • This project does not provide a runtime sandbox. If you wish to configure a YOLO security policy, please ensure your environment cannot be damaged by accidentally executed shell commands (strongly recommended to run in a container).

1. Start the Server

Run the command in your terminal. You can use command-line arguments to override default settings.

# Start server on all network interfaces at port 9000 with debug mode enabled
gemini-cli-bridge --host=127.0.0.1 --port=9000 --debug

# Use a faster model for tool calls and load internal GEMINI.md prompts
gemini-cli-bridge --tools-model=gemini-2.5-flash --use-internal-prompt

After the server starts successfully, you will see output similar to:

[BRIDGE-SERVER] [INFO] Starting Gemini CLI Bridge (MCP + OPENAI)...
[BRIDGE-SERVER] [INFO] Server running {
  port: 8765,
  host: '127.0.0.1',
  mcpUrl: 'http://127.0.0.1:8765/mcp',
  openAIUrl: 'http://127.0.0.1:8765/v1'
}

2. Build from Source (Developers)

git clone https://github.com/Intelligent-Internet/gemini-cli-common-bridge.git
cd gemini-cli-common-bridge
npm install
npm run build
npm run start

Authentication

This bridge server does not manage its own authentication credentials. It shares the exact same authentication mechanism as the main gemini-cli tool to ensure seamless and secure operation.

  • Cached Credentials: If you h

Tools (1)

gemini-cli-toolsExposes built-in Gemini CLI tools including file system operations, web search, and web content understanding.

Configuration

claude_desktop_config.json
{"mcpServers": {"gemini-cli-bridge": {"command": "npx", "args": ["-y", "@intelligentinternet/gemini-cli-mcp-openai-bridge"]}}}

Try it

Search the web for the latest updates on the Gemini API using the Gemini CLI tools.
Read the contents of the local project file and summarize it using the Gemini model.
Connect to my existing MCP servers through the bridge to aggregate tool access.
Use the OpenAI-compatible API to integrate Gemini models into my Open WebUI instance.

Frequently Asked Questions

What are the key features of Gemini CLI MCP Bridge?

Exposes native Gemini CLI tools through the MCP protocol. Provides a fully compatible OpenAI Chat Completions API endpoint. Acts as an MCP hub to aggregate tools from other servers. Supports configurable security policies including read-only and YOLO modes. Enables streaming and non-streaming requests for Gemini models.

What can I use Gemini CLI MCP Bridge for?

Integrating Gemini's web search and file system tools into Claude Desktop. Connecting third-party OpenAI-compatible tools like Open WebUI to Gemini models. Aggregating multiple MCP servers into a single unified endpoint. Automating file system tasks using Gemini-powered tool execution.

How do I install Gemini CLI MCP Bridge?

Install Gemini CLI MCP Bridge by running: npm install -g @intelligentinternet/gemini-cli-mcp-openai-bridge

What MCP clients work with Gemini CLI MCP Bridge?

Gemini CLI MCP Bridge works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Gemini CLI MCP Bridge docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare