An MCP bridge that seamlessly integrates Claude Code, Gemini CLI, and Google AI Studio
๐ฏ๐ต ๆฅๆฌ่ช็ โข ๐ฆ NPM โข ๐ Issues
|
Optimally integrates Claude's reasoning power, Gemini CLI's search capabilities, and AI Studio's generation power. Ahead of the 2026 AI trend: "Specialized AI Collaboration" |
Complete with a single |
Follows the Anthropic Model Context Protocol. Enterprise-grade reliability with 95% self-healing rate |
| Feature | Description |
|---|---|
| ๐ช Full Windows Support | Native support for both CLI and MCP |
| ๐ Enhanced OCR Processing | Automatic text extraction from scanned PDFs |
| ๐ Latest Gemini Models | Support for gemini-2.5-flash, gemini-3-flash |
| ๐ OAuth Authentication | File-based authentication compatible with Claude Code |
| ๐ Auto Translation | Japanese to English translation for image generation |
| ๐ Smart Routing | PDF URLs to AI Studio, web pages to Gemini CLI |
| โก Performance Optimization | Reduced timeouts, lazy loading, caching |
| ๐ก๏ธ Error Recovery | 95% self-healing with exponential backoff |
flowchart TD
A[Claude Code] --> B[CGMB]
B --> C[Gemini CLI]
B --> D[Claude Code]
B --> E[AI Studio]
| Layer | Specialization | Timeout |
|---|---|---|
| ๐ Gemini CLI | Web search, real-time information | 30s |
| ๐ง Claude Code | Complex reasoning, code analysis | 300s |
| ๐จ AI Studio | Image generation, audio synthesis, OCR | 120s |
- Node.js โฅ 22.0.0
- Claude Code CLI installed
- Gemini CLI (auto-installed)
npm install -g claude-gemini-multimodal-bridge๐ก The postinstall script automatically:
- Installs Gemini CLI
- Sets up Claude Code MCP integration
- Creates
.envtemplate- Verifies system requirements
Create a .env file in your working directory:
AI_STUDIO_API_KEY=your_api_key_here๐ Get API key: https://aistudio.google.com/app/apikey
geminiI installed CGMB via NPM. Please check my current environment for the cgmb command and help me use it.
CGMB integrates seamlessly with Claude Code. Just use the "CGMB" keyword:
# ๐จ Image generation
"CGMB generate an image of a futuristic city"
# ๐ Document analysis (use absolute paths)
"CGMB analyze the document at /full/path/to/report.pdf"
# ๐ URL analysis
"CGMB analyze https://example.com/document.pdf"
# ๐ Web search
"CGMB search for the latest AI news"
# ๐ต Audio generation
"CGMB create audio saying 'Welcome to our podcast'"
# ๐ OCR-enabled PDF analysis
"CGMB analyze this scanned PDF document with OCR"- Include "CGMB" in your Claude Code request
- CGMB automatically routes to the optimal AI layer:
- ๐ Gemini CLI: Web search, latest information
- ๐จ AI Studio: Images, audio, file processing
- ๐ง Claude Code: Complex reasoning, code analysis
| Purpose | Model ID | Layer |
|---|---|---|
| ๐ Web Search | gemini-3-flash |
Gemini CLI |
| ๐จ Image Generation | gemini-2.5-flash-image |
AI Studio |
| ๐ต Audio Generation | gemini-2.5-flash-preview-tts |
AI Studio |
| ๐ Document Processing | gemini-2.5-flash |
AI Studio |
| ๐ OCR/Text Extraction | gemini-2.5-flash |
AI Studio |
| ๐ฎ General Multimodal | gemini-2.0-flash-exp |
AI Studio |
|
Authentication Overhead Reduction |
Search Cache Hit Rate |
Automatic Error Recovery Rate |
- โ Supports both text-based and scanned PDFs
- โ Automatic OCR detection
- โ Native OCR processing via Gemini File API
- โ Multi-language support
PDF Input โ Upload โ OCR Processing โ Content Analysis โ Output Results
- Text-based PDFs
- Scanned PDFs (OCR processing)
- Image-based PDFs (OCR conversion)
- Mixed content
- Complex layouts (tables, charts, formatted content)
Generated content is automatically organized:
output/
โโโ images/ # ๐จ Generated images
โโโ audio/ # ๐ต Generated audio files
โโโ documents/ # ๐ Processed documents
Access via Claude Code:
get_generated_file: Retrieve specific fileslist_generated_files: List all generated filesget_file_info: Get file metadata
# Required
AI_STUDIO_API_KEY=your_api_key_here
# Optional
GEMINI_API_KEY=your_api_key_here
ENABLE_CACHING=true
CACHE_TTL=3600
LOG_LEVEL=infoCGMB automatically configures Claude Code MCP integration:
- ๐ Config path:
~/.claude-code/mcp_servers.json - โก Direct Node.js execution
- ๐ Safe merge without overwriting existing servers
CGMB fully supports Windows in v1.1.0:
| Feature | Status |
|---|---|
| CLI | โ All commands work |
| MCP Integration | โ MCP tool calls work correctly |
| Path Resolution | โ
Automatically handles C:\path\to\file format |
| Gemini CLI | โ Full compatibility with Windows version |
# Absolute paths recommended
cgmb analyze "C:\Users\name\Documents\report.pdf"
# Set environment variable (PowerShell)
$env:AI_STUDIO_API_KEY = "your_api_key_here"
# Set environment variable (Command Prompt)
set AI_STUDIO_API_KEY=your_api_key_hereCGMB works fully on Linux and WSL:
| Feature | Status |
|---|---|
| CLI | โ All commands work |
| MCP Integration | โ MCP tool calls work correctly |
| Path Resolution | โ
Supports /mnt/ WSL paths and Unix paths |
| Gemini CLI | โ Full compatibility with Linux version |
# Use Unix path format
cgmb analyze /home/user/documents/report.pdf
# WSL environment example
cgmb analyze /mnt/c/Users/name/Documents/report.pdf
# Set environment variables
export AI_STUDIO_API_KEY="your_api_key_here"
export CGMB_CHAT_MODEL="gemini-2.5-flash"export CGMB_DEBUG=true
export LOG_LEVEL=debug
cgmb serve --debugIf OCR results are inaccurate:
- Use high-resolution scanned PDFs (300+ DPI)
- Ensure clear, high-contrast text
- Avoid skewed or rotated documents
If large documents timeout:
- Split large PDFs before processing (limit: 50MB, 1,000 pages)
- Extend timeout:
export AI_STUDIO_TIMEOUT=180000
CGMB uses pay-per-use APIs:
src/
โโโ core/ # ๐ฏ Main MCP server and layer management
โโโ layers/ # ๐ AI layer implementations
โโโ auth/ # ๐ Authentication system
โโโ tools/ # ๐ ๏ธ Processing tools
โโโ workflows/ # ๐ Workflow implementations
โโโ utils/ # ๐ง Utilities and helpers
โโโ mcp-servers/ # ๐ Custom MCP servers
- ๐ช Full Windows Support: Native Windows support for both CLI and MCP
- ๐ Enhanced OCR: Automatic OCR processing for image-based PDFs
- ๐ Latest Gemini Models: Support for gemini-2.5-flash, gemini-3-flash
- โก Improved MCP Integration: Optimized async layer initialization
- ๐ Performance Improvements: Reduced timeouts, lazy loading, enhanced caching
- ๐ก๏ธ Error Recovery: 95% self-healing rate with exponential backoff
- ๐ Initial release
- ๐๏ธ 3-layer architecture implementation
- ๐จ Basic multimodal processing