Gemini Bridge
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A lightweight MCP (Model Context Protocol) server that enables AI coding assistants to interact with Google's Gemini AI through the official CLI. Works with Claude Code, Cursor, VS Code, and other MCP-compatible clients. Designed for simplicity, reliability, and seamless integration.
✨ Features
- **Direct Gemini CLI Integration**: Zero API costs using official Gemini CLI
- **Three MCP Tools**: Basic queries, file analysis, and web search capabilities
- **Stateless Operation**: No sessions, caching, or complex state management
- **Production Ready**: Robust error handling with configurable 60-second timeouts
- **Minimal Dependencies**: Only requires mcp>=2,
Claude Code (Default)
Cursor
**Global Configuration** (~/.cursor/mcp.json):
**Project-Specific** (.cursor/mcp.json in your project):
Go to: Settings → Cursor Settings → MCP → Add new global MCP server
VS Code
**Configuration** (.vscode/mcp.json in your workspace):
**Alternative: Through Extensions**
1. Open Extensions view (Ctrl+Shift+X)
2. Search for MCP extensions
3. Add custom server with command: uvx gemini-bridge
Windsurf
Add to your Windsurf MCP configuration:
Cline (VS Code Extension)
1. Open Cline and click **MCP Servers** in the top navigation
2. Select **Installed** tab → **Advanced MCP Settings**
3. Add to cline_mcp_settings.json:
Void
Go to: Settings → MCP → Add MCP Server
Cherry Studio
1. Navigate to **Settings → MCP Servers → Add Server**
2. Fill in the server details:
- **Name**: gemini-bridge
- **Type**: STDIO
- **Command**: uvx
- **Arguments**: ["gemini-bridge"]
3. Save the configuration
Augment
**Using the UI:**
1. Click hamburger menu → **Settings** → **Tools**
2. Click **+ Add MCP** button
3. Enter command: uvx gemini-bridge
4. Name: **Gemini Bridge**
**Manual Configuration:**
Roo Code
1. Go to **Settings → MCP Servers → Edit Global Config**
2. Add to mcp_settings.json:
Zencoder
1. Go to Zencoder menu (...) → **Tools** → **Add Custom MCP**
2. Add configuration:
3. Hit the **Install** button
Alternative Installation Methods
**For pip-based installations:**
**For development/local testing:**
**For npm-style installation** (if needed):
Universal Usage
Once configured with any client, use the same two tools:
1. **Ask general questions**: "What authentication patterns are used in this codebase?"
2. **Analyze specific files**: "Review these auth files for security issues"
**The server implementation is identical** - only the client configuration differs!
⚙️ Configuration
Timeout Configuration
By default, Gemini Bridge uses a 60-second timeout for all CLI operations. For longer queries (large files, complex analysis), you can configure a custom timeout using the GEMINI_BRIDGE_TIMEOUT environment variable.
**Example configurations:**
Claude Code
Manual Configuration (mcp_settings.json)
**Timeout Options:**
- **Default**: 60 seconds (if not configured)
- **Range**: Any positive integer (seconds)
- **Per-call override**: Supply timeout_seconds to either tool for one-off extensions
- **Recommended**: 120-300 seconds for large file analysis
- **Invalid values**: Fall back to 60 seconds with warning
🛠️ Available Tools
consult_gemini
Direct CLI bridge for simple queries.
**Parameters:**
- query (string): The question or prompt to send to Gemini
- directory (string): Working directory for the query
- model (string, optional): Model to use - "flash", "pro", "flash-lite", "2.5-lite", "3-pro", "3-flash", "3.1-pro", "3.1-flash-lite", or "auto" (default: "flash")