Skip to content

About

Claude-Gemini Multimodal Bridge (CGMB) - A 3-layer AI integration system providing transparent enhancement of Claude Code with multimodal capabilities through Gemini CLI and AI Studio

Resources

Stars

1 star

Watchers

0 watching

Forks

ย 
ย 

Latest commit

ย 

History

56 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ‰ Claude-Gemini Multimodal Bridge

Unifying the Power of AI.

An MCP bridge that seamlessly integrates Claude Code, Gemini CLI, and Google AI Studio

๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌ่ชž็‰ˆ โ€ข ๐Ÿ“ฆ NPM โ€ข ๐Ÿ› Issues


npm version License: MIT Node.js TypeScript

MCP Compatible Gemini Claude GitHub Sponsors

Windows macOS Linux


๐Ÿค” Why CGMB?

๐Ÿ”„ Multi-Model Orchestration

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"

โšก Zero Configuration

Complete with a single npm install. Tedious setup is automated

๐ŸŽฏ MCP Standard Compliant

Follows the Anthropic Model Context Protocol. Enterprise-grade reliability with 95% self-healing rate


โœจ What's New in v1.1.0

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

๐Ÿ—๏ธ Architecture

flowchart TD
    A[Claude Code] --> B[CGMB]

    B --> C[Gemini CLI]
    B --> D[Claude Code]
    B --> E[AI Studio]
Loading
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

๐Ÿš€ Quick Start

๐Ÿ“‹ Prerequisites

  • Node.js โ‰ฅ 22.0.0
  • Claude Code CLI installed
  • Gemini CLI (auto-installed)

๐Ÿ“ฆ Installation

npm install -g claude-gemini-multimodal-bridge

๐Ÿ’ก The postinstall script automatically:

  • Installs Gemini CLI
  • Sets up Claude Code MCP integration
  • Creates .env template
  • Verifies system requirements

๐Ÿ”‘ Environment Setup

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

๐ŸŽฏ Gemini CLI Authentication

gemini

๐Ÿ’ฌ Get Started with Claude Code

I installed CGMB via NPM. Please check my current environment for the cgmb command and help me use it.

๐Ÿ’ก Usage Examples

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"

๐Ÿ”„ Automatic Routing

  1. Include "CGMB" in your Claude Code request
  2. 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

๐Ÿค– Models Used

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

๐Ÿ“ˆ Performance

80%

Authentication Overhead Reduction

60-80%

Search Cache Hit Rate

95%

Automatic Error Recovery Rate


๐Ÿ“„ PDF Processing & OCR

โœจ OCR Features

  • โœ… Supports both text-based and scanned PDFs
  • โœ… Automatic OCR detection
  • โœ… Native OCR processing via Gemini File API
  • โœ… Multi-language support

๐Ÿ“‹ Processing Workflow

PDF Input โ†’ Upload โ†’ OCR Processing โ†’ Content Analysis โ†’ Output Results

๐Ÿ“ Supported Formats

  • Text-based PDFs
  • Scanned PDFs (OCR processing)
  • Image-based PDFs (OCR conversion)
  • Mixed content
  • Complex layouts (tables, charts, formatted content)

๐Ÿ“‚ File Organization

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 files
  • list_generated_files: List all generated files
  • get_file_info: Get file metadata

๐Ÿ”ง Configuration

Environment Variables

# 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=info

MCP Integration

CGMB automatically configures Claude Code MCP integration:

  • ๐Ÿ“ Config path: ~/.claude-code/mcp_servers.json
  • โšก Direct Node.js execution
  • ๐Ÿ”’ Safe merge without overwriting existing servers

๐ŸชŸ Windows Environment

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_here

๐Ÿง Linux / WSL Environment

CGMB 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"

๐Ÿ” Troubleshooting

Debug Mode

export CGMB_DEBUG=true
export LOG_LEVEL=debug
cgmb serve --debug

OCR and PDF Processing Issues

If 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

๐Ÿ’ฐ API Costs

CGMB uses pay-per-use APIs:


๐Ÿ“ Project Structure

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

๐Ÿ”— Links

๐Ÿ“ฆ Project

๐Ÿ”ง Related Tools

๐Ÿ“œ Terms of Service


๐Ÿ“œ Version History

v1.1.0 (2026-01-10)

  • ๐ŸชŸ 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

v1.0.4

  • ๐ŸŽ‰ Initial release
  • ๐Ÿ—๏ธ 3-layer architecture implementation
  • ๐ŸŽจ Basic multimodal processing

๐Ÿ“„ License

MIT - See LICENSE


Made with โค๏ธ by goodaymmm

โญ If this project helped you, please give it a star!

Sponsor

About

Claude-Gemini Multimodal Bridge (CGMB) - A 3-layer AI integration system providing transparent enhancement of Claude Code with multimodal capabilities through Gemini CLI and AI Studio

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages