Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Bourne2k/Gemini-Bridge-MCP

Repository files navigation

🌉 Gemini Bridge MCP

License: MIT TypeScript Playwright MCP

The Missing Link between your AI Editor and Google's Gemini 3 Pro.

Unlimited Context. Web Reasoning. Zero API Costs.

FeaturesInstallationHow it WorksContributing


⚡ The Problem

You love AI editors like OpenCode, Cursor, or Windsurf. But you also love Gemini 3 Pro's massive 1M+ token context window and superior reasoning capabilities. Paying for API keys adds up, and copy-pasting code back and forth is painful.

🚀 The Solution

Gemini Bridge is a local MCP (Model Context Protocol) server that acts as a "Puppeteer" for your browser. It gives your AI Editor the ability to:

  1. Drive the Gemini Web Interface autonomously.
  2. Upload Project Files directly for massive context analysis.
  3. Write Code back to your disk automatically.
  4. Browse the Web using Google Search (via Gemini).

No API keys. No per-token costs. Just raw, agentic power running locally on your machine.


✨ Features

  • 🛡️ Zero-Config Persistence: Maintains your login session securely locally.
  • 📂 Agentic Loop: Can iteratively read files, think, request more files, and write fixes.
  • 🧱 Chunked Writes: Handles massive file generation without timeouts by splitting outputs.
  • 🧠 Smart Context: Uses the Gemini Web "Upload" feature to handle huge codebases efficiently.
  • 🕵️ Headless & Stealth: Runs invisibly in the background; bypasses basic bot detection.

🛠️ Architecture

[ AI Editor ]  <-- JSON-RPC (MCP) -->  [ Gemini Bridge ]
                                              |
                                         (Playwright)
                                              v
                                    [ Brave/Chrome Browser ]
                                              |
                                           (HTTPS)
                                              v
                                    [ Gemini Web (Google) ]
                                              |
      (File System) <--- Writes Code <--- (Streaming Text)

📦 Installation

Prerequisites

  • Node.js (v18 or higher)
  • Brave Browser or Google Chrome installed

1. Clone & Build

git clone https://github.com/yourusername/gemini-bridge-mcp.git
cd gemini-bridge-mcp
npm install
npm run build

2. Authenticate (One Time Setup)

Run the setup script to log in to your Google account. This saves a persistent browser profile locally in the project folder.

npx tsx src/setup-auth.ts

A browser window will open. Log in to Gemini, wait for the chat interface to load, then close the browser.

3. Connect to OpenCode / Cursor

Add this to your configuration file (e.g., ~/.config/opencode/opencode.json):

{
  "mcp": {
    "gemini": {
      "command": "node",
      "args": ["C:\\Users\\YourName\\Desktop\\Gemini-Bridge-MCP\\dist\\index.js"],
      "timeout": 300000
    }
  }
}

Note: Set timeout to 300000 (5 minutes) to allow Gemini time to think for complex tasks.


🎮 Usage

Direct Command (Macro)

Use it to fix files instantly without conversation overhead.

/gemini "Refactor main.py to use async/await and handle errors"

Agentic Chat

Ask your AI Agent to use it for complex tasks.

"Hey, read src/app.ts and src/utils.ts. Use Gemini to refactor the routing logic and explain the changes."


🛠️ Architecture

[ AI Editor ]  <-- JSON-RPC (MCP) -->  [ Gemini Bridge ]
                                              |
                                         (Playwright)
                                              v
                                    [ Brave/Chrome Browser ]
                                              |
                                           (HTTPS)
                                              v
                                    [ Gemini Web (Google) ]
                                              |
      (File System) <--- Writes Code <--- (Streaming Text)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors