Unlimited Context. Web Reasoning. Zero API Costs.
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.
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:
- Drive the Gemini Web Interface autonomously.
- Upload Project Files directly for massive context analysis.
- Write Code back to your disk automatically.
- Browse the Web using Google Search (via Gemini).
No API keys. No per-token costs. Just raw, agentic power running locally on your machine.
- 🛡️ 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.
[ AI Editor ] <-- JSON-RPC (MCP) --> [ Gemini Bridge ]
|
(Playwright)
v
[ Brave/Chrome Browser ]
|
(HTTPS)
v
[ Gemini Web (Google) ]
|
(File System) <--- Writes Code <--- (Streaming Text)
- Node.js (v18 or higher)
- Brave Browser or Google Chrome installed
git clone https://github.com/yourusername/gemini-bridge-mcp.git
cd gemini-bridge-mcp
npm install
npm run buildRun 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.tsA browser window will open. Log in to Gemini, wait for the chat interface to load, then close the browser.
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.
Use it to fix files instantly without conversation overhead.
/gemini "Refactor main.py to use async/await and handle errors"
Ask your AI Agent to use it for complex tasks.
"Hey, read
src/app.tsandsrc/utils.ts. Use Gemini to refactor the routing logic and explain the changes."
[ AI Editor ] <-- JSON-RPC (MCP) --> [ Gemini Bridge ]
|
(Playwright)
v
[ Brave/Chrome Browser ]
|
(HTTPS)
v
[ Gemini Web (Google) ]
|
(File System) <--- Writes Code <--- (Streaming Text)