Gemini Web Bridge MCP
Use this server to send prompts to Gemini Pro through a browser extension, optionally with file uploads and returned attachments saved locally.
Submit text prompts to Gemini Pro via the browser bridge.
Attach one or more local files to a prompt.
Save files or images generated/returned by Gemini to a specified download directory, defaulting to the OS temp folder.
Provides a browser bridge to the Google Gemini web app, enabling coding agents to submit prompts, upload local files, and retrieve Gemini responses plus generated/downloadable files without using the Gemini API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gemini Web Bridge MCP ask Gemini Pro to review src/auth.ts and suggest fixes"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Gemini Web Bridge MCP
An MCP server that lets coding agents use Gemini Pro through the Gemini web app — no Gemini API key, no per-token billing, and no separate "API" account.
It drives a real Chrome/Chromium session through a small extension. The agent calls one MCP tool, the extension types the prompt into Gemini, waits for the answer, and returns it. It also supports file upload and downloading generated images/files.
This is an unofficial browser bridge. It is not affiliated with Google. Use it only with an account you are allowed to use this way, and review the security and terms-of-service notes below.
Based on Walkoud/gemini-browser-mcp (MIT), with substantial changes: file transfer, multi-workspace proxy support, loopback-only binding, automatic content-script injection, longer response stabilization, and Linux server tooling.
Contents
Related MCP server: chrome-mcp
Features
No Gemini API key — uses the same web session you use manually.
Per-session chats — every MCP server process (one per agent session) gets its own Gemini tab and chat, so concurrent sessions never share a conversation. Messages to one tab are serialized, and the tab is activated while its prompt runs.
High thinking by default — prompts select High thinking unless you explicitly ask for another level. The extension verifies the selected model/thinking in Gemini's own selector.
File upload — pass local file paths to the tool; text, code, PDF, images, documents, etc. are attached and the bridge waits for Gemini's upload chip before sending.
Download generated files — images and downloadable links from Gemini's response are saved to a local directory and returned as file paths.
Multi-workspace safe — one bridge owns port
8085; other OpenCode workspaces automatically become proxies instead of fighting for the port.Loopback-only by default — the WebSocket bridge binds
127.0.0.1and rejects non-loopback clients unless explicitly allowed.Automatic recovery — a failed submission is retried once after a page reload; a timed-out prompt reloads the tab and restores High thinking.
refresh_gemini_chatdoes the same on demand.Linux server support — run Chrome under Xvfb, or keep Chrome on your laptop and tunnel port
8085to the server.OpenCode, Claude Code, and any MCP client — the server is a standard stdio MCP server.
How it works
┌────────────────────┐ stdio MCP ┌──────────────────────────┐
│ OpenCode / agent │ ◄──────────────────────► │ server.js (MCP server) │
└────────────────────┘ │ owner on 127.0.0.1:8085 │
└────────────┬─────────────┘
│ WebSocket
│ (loopback)
┌────────────▼─────────────┐
│ Chrome extension │
│ background + content.js │
└────────────┬─────────────┘
│ DOM automation
┌────────────▼─────────────┐
│ Gemini web app │
│ gemini.google.com/app │
└──────────────────────────┘OpenCode starts
server.jsover stdio.server.jsopens a WebSocket server on127.0.0.1:8085.The Chrome extension connects to that WebSocket and identifies itself.
When the agent calls
ask_gemini_web, the server sends the prompt (and optional file payloads) to the extension.The content script clears Gemini's Quill composer, attaches files, pastes the prompt through Quill's clipboard path, clicks the real Send host, and waits for the conversation turn that belongs to this prompt.
The response text and any generated attachments are sent back over the WebSocket. The MCP server returns the text and writes attachments to disk.
Multi-workspace proxy mode
OpenCode can load the same MCP server for several workspaces. Only one process can bind port 8085. The first process becomes the owner; later processes detect EADDRINUSE, switch to proxy mode, connect to the owner, and relay their tool calls through it. If the owner disappears, proxies attempt to take over after repeated failures.
Response timing
High thinking (default): up to 9 minutes for the answer; the first response turn must appear within 75 seconds.
Other thinking levels: up to 4.7 minutes for the answer.
The bridge waits for a 1.2-second stable answer, but only after it has seen this prompt's conversation turn generate or change from the previous answer. This prevents returning a stale answer from the previous turn.
A submission that is not accepted is retried once after a page reload. A prompt that hits the bridge timeout reloads the tab and restores High thinking.
Server-side request timeout: 12 minutes (content stops first at 9 minutes).
Generated attachments are fetched in parallel, and timing logs (
[Gemini Bridge] ... +Nms) are written to the page console. Prompt and response text are not logged.
The stability window and timeouts are in chrome-extension/content.js.
Requirements
Node.js 20 or newer
Chrome, Chromium, Brave, or another Chromium-based browser
The Gemini Bridge extension loaded in that browser
A Google account with access to Gemini (Pro recommended)
For Linux servers: Xvfb and x11vnc for the one-time login (or use the SSH tunnel option)
Quick start: Windows / macOS desktop
1. Clone and install
git clone https://github.com/Zaltapar/gemini-web-bridge-mcp.git
cd gemini-web-bridge-mcp
npm install2. Load the extension
Open
chrome://extensionsEnable Developer mode
Click Load unpacked
Select the
chrome-extension/folder from this repository
3. Log in to Gemini
Open
https://gemini.google.com/appLog in with the account that has Gemini Pro
Set the model to Hydrogen (or Neon/Carbon if your account offers them) and thinking to High. The bridge defaults to High for prompts.
Keep the tab open
4. Configure OpenCode
Add this to ~/.config/opencode/opencode.jsonc (Linux/macOS) or C:\Users\<you>\.config\opencode\opencode.jsonc (Windows):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"gemini": {
"type": "local",
"command": [
"node",
"C:\\path\\to\\gemini-web-bridge-mcp\\server.js"
]
}
}
}
}Alternatively, with the OpenCode CLI:
opencode mcp add gemini --global -- node /absolute/path/to/gemini-web-bridge-mcp/server.js
opencode mcp list5. Test
Ask OpenCode:
Use
ask_gemini_webto reply with exactly: BRIDGE_OK
You should get BRIDGE_OK.
6. Keep Chrome running
The extension needs a Gemini tab. You can minimize Chrome; you do not need to interact with it while the MCP is working. If you close the tab or Chrome, open Gemini again.
OpenCode configuration
Minimal global config:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"servers": {
"gemini": {
"type": "local",
"command": ["node", "/opt/gemini-web-bridge-mcp/server.js"],
"environment": {
"GEMINI_BRIDGE_HOST": "127.0.0.1",
"GEMINI_BRIDGE_PORT": "8085"
}
}
}
}
}Environment variables:
Variable | Default | Description |
|
| Bind address for the WebSocket bridge. Keep loopback unless you have a specific reason. |
|
| Owner/proxy port. The extension's |
| unset | Set to |
| unset | Set to |
| unset | Set to |
|
| Log file path. Each line includes the process PID. |
| unset | Set to |
Project-local config works the same way in any opencode.json(c) or .opencode/opencode.json(c) discovered by OpenCode.
Linux server guide
See docs/LINUX.md for a longer copy-paste guide, including systemd, VNC, dedicated users, and firewall notes.
Linux desktop with a GUI
If your Linux machine has a normal desktop session, Chrome runs natively. You do not need Xvfb or VNC:
Install Google Chrome or Chromium.
Load
chrome-extension/atchrome://extensions.Open
https://gemini.google.com/app, log in, and select Pro.Install and configure the MCP as usual:
cd /opt/gemini-web-bridge-mcp
npm install
opencode mcp add gemini --global -- node /opt/gemini-web-bridge-mcp/server.jsThat is the whole setup. Xvfb is only needed when there is no display at all.
Headless Linux server
There are two reliable ways to run this on a headless Linux server:
Recommended for headless servers: Chrome runs on your laptop/desktop; the server runs OpenCode and the MCP bridge; an SSH tunnel connects the extension to the server.
Chrome on the server: Chrome runs under Xvfb on the server. Log in once with VNC, then keep it running headlessly.
Option A: Chrome on your laptop + SSH tunnel (recommended for headless servers)
This is the easiest and most reliable setup if your server has no desktop environment. Chrome stays on your machine, where you can see and log in normally. Only the WebSocket is tunneled.
On the server
sudo apt update
sudo apt install -y nodejs npm
# Node 20+ is recommended. If your distro ships an older Node, use nvm or NodeSource.
git clone https://github.com/Zaltapar/gemini-web-bridge-mcp.git /opt/gemini-web-bridge-mcp
cd /opt/gemini-web-bridge-mcp
npm install
opencode mcp add gemini --global -- node /opt/gemini-web-bridge-mcp/server.js
opencode mcp listOn your laptop
Load
chrome-extension/as an unpacked extension in Chrome.Open
https://gemini.google.com/app, log in, select Pro.Create an SSH tunnel from your laptop to the server:
ssh -N -L 8085:127.0.0.1:8085 user@your-server.example.comKeep that SSH session open. The extension connects to ws://127.0.0.1:8085 on your laptop, which is forwarded to the MCP bridge on the server.
Start OpenCode on the server and test:
Use
ask_gemini_webto reply with exactly: TUNNEL_OK
If the tunnel is up and Chrome has a Gemini tab open, this works exactly like the desktop setup.
Windows laptop: use the same
ssh -L 8085:127.0.0.1:8085 user@servercommand in PowerShell, or configure an equivalent tunnel in PuTTY.
Option B: Chrome on the server with Xvfb + VNC
Use this when you want the server to be fully self-contained.
1. Install system packages
Debian/Ubuntu:
sudo apt update
sudo apt install -y nodejs npm xvfb x11vncFor a newer Node.js, install Node 20+ via nvm or NodeSource. Then:
git clone https://github.com/Zaltapar/gemini-web-bridge-mcp.git /opt/gemini-web-bridge-mcp
cd /opt/gemini-web-bridge-mcp
npm install
chmod +x linux/*.sh2. One-time login through VNC
Run:
./linux/login.shThe script starts:
Xvfb on virtual display
:99x11vnc on
127.0.0.1:5900(localhost only)Chrome with the extension and
gemini.google.com/app
From your laptop, tunnel the VNC port:
ssh -L 5900:127.0.0.1:5900 user@your-server.example.comThen open a VNC viewer at 127.0.0.1:5900 (macOS: Finder → Go → Connect to Server → vnc://127.0.0.1:5900). Log in with the Google account that has Gemini Pro. Close the Chrome window and press Enter in the terminal.
The Chrome profile is stored at:
~/.local/share/gemini-web-bridge/chrome-profileIt contains the login session. Treat it as a secret.
3. Start the background browser
./linux/start-browser.shThis starts Chrome under Xvfb with the extension and a Gemini tab, minimized/offscreen. You do not need a monitor.
4. Configure OpenCode
opencode mcp add gemini --global -- node /opt/gemini-web-bridge-mcp/server.js
opencode mcp listOr use linux/opencode.json.example as a starting point.
5. Test
Use
ask_gemini_webto reply with exactly: SERVER_OK
Stop the browser
./linux/stop-browser.shRun the background browser as a systemd user service
Copy the unit file and adjust the path if needed:
mkdir -p ~/.config/systemd/user
cp linux/gemini-browser.service ~/.config/systemd/user/
# Edit ExecStart if you cloned somewhere other than ~/gemini-web-bridge-mcp
systemctl --user daemon-reload
systemctl --user enable --now gemini-browser.service
systemctl --user status gemini-browser.serviceLogs:
journalctl --user -u gemini-browser.service -fThe service runs Chrome under Xvfb. The separate gemini-bridge-owner.service runs the persistent bridge owner; OpenCode MCP processes and laptop proxies connect to it.
Laptop OpenCode with Chrome on a server (recommended)
Use this when Chrome and the Gemini login run on a server, and OpenCode runs on your laptop. The bridge owner is a persistent systemd service on the server; the laptop reaches it through an SSH tunnel and runs in proxy-only mode.
On the server:
sudo REPO_DIR=/opt/gemini-web-bridge-mcp ./linux/install-bridge-owner.sh
# The unit uses /usr/local/bin/node. Adjust ExecStart if `command -v node` differs.
systemctl is-active gemini-bridge-owner
ss -ltnp | grep 8085 # must be 127.0.0.1:8085 onlyMake sure Chrome and the extension are running and logged in. The owner survives OpenCode restarts; remote OpenCode MCP processes automatically become proxies to it.
On the laptop (Windows):
powershell -ExecutionPolicy Bypass -File scripts\install-laptop-tunnel.ps1 -RemoteHost your-server -LocalPort 18085This installs a Startup shortcut and starts:
ssh -N -L 127.0.0.1:18085:127.0.0.1:8085 your-serverOn Linux/macOS, add the equivalent SSH command to your startup. Then add the MCP server to OpenCode:
{
"mcp": {
"servers": {
"gemini-web-bridge": {
"type": "local",
"command": ["node", "/absolute/path/to/gemini-web-bridge-mcp/server.js"],
"environment": {
"GEMINI_BRIDGE_PORT": "18085",
"GEMINI_BRIDGE_PROXY_ONLY": "1"
},
"protocol": "legacy"
}
}
}
}GEMINI_BRIDGE_PROXY_ONLY=1 prevents the laptop process from binding a local port and becoming an owner when the tunnel is down; it returns a clear proxy error instead.
Test the laptop path:
GEMINI_BRIDGE_PORT=18085 node tests/smoke.mjs
# status should report bridgeMode: "proxy", extensionConnected: trueThe request path is: laptop MCP proxy → SSH tunnel → server loopback owner → extension → Chrome. No inbound port is opened; both ends of the tunnel are loopback and SSH encrypts the traffic.
Chrome on a laptop with OpenCode on a server
If you run Chrome on machine A and OpenCode on machine B, tunnel B's port to A:
On machine A (Chrome side), run:
ssh -N -L 8085:127.0.0.1:8085 user@machine-bThen the extension on machine A connects to 127.0.0.1:8085 and reaches the MCP bridge on machine B. No inbound firewall port is required; the SSH connection does the forwarding.
Tool reference
new_gemini_chat
{}Starts a fresh Gemini chat for the calling session. The session keeps its own tab and chat; if the tab is in an older conversation it navigates/reloads to a blank /app composer. The tab is unmapped when the MCP client disconnects and is reused by a later session.
get_bridge_status
{}Reports extension connectivity and version, owner/proxy mode, this session id, its chat tab (and URL) once claimed, the number of open Gemini tabs, the active model/thinking level, and whether the tab is busy.
refresh_gemini_chat
{ "model": "Hydrogen", "thinking_level": "high" }Recovers a stuck or timed-out Gemini tab: cancels any in-flight prompt, reloads the page by default, starts a new chat, and restores High thinking. Set reload_page: false for a faster new-chat-only refresh. It returns only after recovery finishes. A prompt that hits the bridge timeout triggers the same recovery automatically; set GEMINI_AUTO_RECOVER=0 to disable that.
set_gemini_model
{
"model": "Hydrogen",
"thinking_level": "high"
}model— optional. The label in Gemini's selector:Hydrogen/Everyday help,Neon/Deeper analysis,Carbon/Code & complex work, orAuto. A level suffix such asHydrogen Highis understood. LegacyPro/Flashstill map onto the current labels.thinking_level— optional:low,medium, orhigh. Defaults tohighwhen omitted. The bridge drives Gemini's ownThinking levelsubmenu and verifies the result.thinking— legacy boolean shorthand (true→ high,false→ low).
Returns the model and thinking level Gemini reports after the change. Locked options (Neon, Carbon) are skipped.
ask_gemini_web
{
"prompt": "string",
"files": ["/absolute/path/to/file1", "/absolute/path/to/file2"],
"download_dir": "/absolute/path/to/downloads",
"model": "Hydrogen",
"thinking_level": "high"
}prompt— required. The text sent to Gemini.files— optional. Local files to attach to the prompt.download_dir— optional. Where returned attachments are saved. Defaults to the OS temp directory undergemini-mcp-downloads.model/thinking_level— optional. Change the model/thinking mode before sending. Thinking defaults to High when omitted.The prompt is sent in the session's tab; the tab is activated first because Gemini ignores Send in a background tab.
If the first submission is not accepted, the bridge reloads the tab once and retries the same prompt (including its files).
Returns a text block. If Gemini returned attachments, the response includes a [Saved attachments] section with absolute local paths.
Examples:
Use ask_gemini_web to review src/main.py for bugs.Use ask_gemini_web with files ["logs/error.log", "src/server.ts"] to find the root cause of this crash.Use ask_gemini_web with files ["requirements.md", "schema.sql"] to create an implementation plan.Model selection
The Gemini web UI remains the source of truth, but the bridge can now drive its selector:
Call
set_gemini_modelto change the model and/or thinking level.Or pass
model/thinking_leveltoask_gemini_webto switch before sending a prompt.The extension also exposes a
setModeruntime message, so a popup or automation script can do the same thing.Thinking level is handled as a separate
Thinking levelsubmenu withLow/Medium/High. High is always used unless you explicitly request another level.
If the requested label is not present in the selector, the call returns an error listing the options Gemini actually offers (DOM labels change over time). The extension reports the active model and thinking level in its popup and adjusts its timeout for high thinking.
File transfer details
Uploads are read by the MCP server, base64-encoded, sent over the local WebSocket, and attached via the page's file input.
Each uploaded file is limited to 20 MiB.
The total upload per request is limited to 60 MiB before base64 encoding.
For large videos, prefer a URL-based prompt or split the request.
Generated images and downloadable links are extracted from the response container, fetched with the browser session, and written to
download_dir.Gemini's inline document editor is returned as text; it is not automatically converted into a separate file.
Architecture details
Owner / proxy mode
Only one MCP server process can own port 8085. Later processes:
Detect
EADDRINUSE.Connect to the owner as an MCP proxy client.
Send
askrequests through the owner.Receive text and attachments back.
If the owner exits, proxies attempt to take over. This avoids the "port busy" failure mode when OpenCode has several workspaces open.
Extension roles
The background worker identifies itself as role: extension. MCP proxies identify as role: mcp. The owner only routes prompts to the extension client; it does not confuse a proxy with the browser.
Content script
chrome-extension/content.js is injected into https://gemini.google.com/*. It:
Finds the composer and reads Gemini's Quill instance (
rich-textarea.__quill).Clears the composer through Quill, so a restored draft cannot leave the DOM and Quill's model out of sync.
Clicks the attachment button if Gemini has not created the hidden file input yet.
Attaches files with a
DataTransferand waits for both the upload spinner to stop and the file chip to appear.Pastes the prompt as a
ClipboardEventthrough Quill, which updates the model Angular actually reads.Clicks the
gem-icon-button.send-buttonhost (the inner<button>has no click handler) and verifies that a new user turn appeared.Pairs the answer with the conversation container whose user query matches this prompt, then waits for a 1.2-second stable answer after seeing generation or a text change.
Extracts text, images, and downloadable links.
Sends the result back through the background worker.
If the tab was open before the extension was reloaded, the background worker injects content.js with chrome.scripting.executeScript and retries once. After changing content.js, reload the extension in chrome://extensions; simply reloading the Gemini tab can keep the cached old content script.
Tab and session behavior
Each MCP session is mapped to one Gemini tab and one chat.
The tab is activated while a prompt is sent. Gemini ignores Send in a hidden tab.
A submission that fails is retried once after a page reload.
sessionEndunmaps the tab; the extension keeps a small warm pool (maximum three bridge-created tabs) and closes idle extras on its five-minute cleanup alarm.refresh_gemini_chataborts any in-flight prompt and reloads the page by default.
Security defaults
The WebSocket server binds
127.0.0.1by default.Non-loopback clients are rejected unless
GEMINI_BRIDGE_ALLOW_REMOTE=1.The extension only requests host permissions for Gemini and Google content domains.
The extension requests only
tabs,scripting,storage, andalarms. It has nocookiesordebuggerpermission.The extension has no cookie access at all, so the bridge cannot export session credentials. The bridge never logs prompt contents to its log file.
Security and privacy
This tool automates a logged-in browser session. That has real security implications:
Your Gemini session is powerful. Anyone who can connect to the bridge can send prompts as you. Keep the bridge on loopback and do not expose port
8085to the internet.Do not run it on a shared server without isolation. Use a dedicated Unix user, a dedicated Chrome profile, and OS-level access controls.
Prompt and file contents pass through the Gemini web app. Treat them as data sent to Google, exactly as if you typed them in the browser.
Use a dedicated Chrome profile for the Gemini account rather than your daily profile. Its login session is still sensitive; protect it like an SSH private key.
Chrome sandbox. The scripts add
--no-sandboxonly when running as root. Running Chrome as root is discouraged; use a normal user account.Terms of service. Automating the Gemini web UI may conflict with Google's terms or usage policies. You are responsible for how you use it. This project is not affiliated with or endorsed by Google.
No warranty. DOM selectors and Google's UI change. Expect occasional breakage.
Cookie handling
This fork does not expose Google session cookies. The extension no longer requests the cookies permission, has no getCookies handler, and the bridge does not forward cookie requests. scripts/export-cookies.mjs has been removed. The only data that crosses the bridge is prompts, responses, and attached files.
Limitations
Chrome must be running somewhere and must have a Gemini tab open. The "no browser process at all" route is not reliable; Google blocks the unofficial HTTP API.
The server needs access to Chrome. Either Chrome runs on the server under Xvfb, or you tunnel
8085from your laptop.The DOM can change. Selectors for the composer, send host, upload input, and conversation containers may need updates after Gemini UI changes.
The active tab is used for sending. Gemini ignores Send in a hidden tab, so the bridge activates the session's tab. Concurrent prompts from several sessions briefly switch tabs; each session keeps its own chat.
File upload is UI-level. Very large files or unusual MIME types may be rejected by Gemini.
One Google account per browser profile. Different accounts require a different Chrome profile and bridge instance.
High thinking is slower. Simple prompts may take 10–30 seconds because the bridge waits for a genuine generation/answer change rather than trusting stale text.
Troubleshooting
Chrome extension not connected
Make sure Chrome is running.
Make sure the extension is loaded and enabled.
Reload the extension from
chrome://extensions.Open
https://gemini.google.com/app.Check that the bridge is running:
opencode mcp listshould showconnected.On Linux, check the browser log:
~/.local/state/gemini-web-bridge/chrome.log.
Could not establish connection. Receiving end does not exist
The Gemini tab is older than the extension reload. Refresh the Gemini tab. The background worker also injects the content script automatically. After changing content.js, reload the extension first, then refresh the tab; otherwise Chrome can keep serving the cached content script.
Gemini UI only partially loaded / model selector missing
Gemini sometimes renders the composer without the model pill, history, or working Send button after a slow load. The bridge detects this before prompting and reloads the tab. If it persists, call refresh_gemini_chat; a full page reload is the default.
The answer is from the previous turn
The bridge pairs the answer with the conversation container whose user query matches this prompt and waits for a generation signal or a text change. If this still happens, reload the extension and the Gemini tab so the latest content script is active. The timing logs (prompt inserted, prompt submitted, response stable) show whether the send actually happened.
File prompt is answered from chat context
Reload the extension after content changes; an old content script may send before the upload chip appears.
Keep the Gemini tab visible while a file prompt runs; the bridge activates it, but another window can steal focus.
Check the timing logs for
Attached 1 file(s)andUploads look ready. If the upload times out, callrefresh_gemini_chatand retry.The bridge now waits for both the upload spinner to stop and the file chip to appear before sending.
No Gemini tab open
Open https://gemini.google.com/app in the Chrome instance that has the extension. In normal use the bridge creates its own tab if none exists.
Port 8085 busy / multiple workspaces
This is expected; the later MCP processes become proxies. If the owner died and nothing owns the port, restart the MCP server by reloading the OpenCode config or restarting the OpenCode service. Check server.log in the repository directory; each process line includes its PID.
Gemini file input not found
Gemini changed its upload UI. Update findFileInput, uploadCandidates, and attachFiles in chrome-extension/content.js. The error message lists visible candidate buttons to help.
Upload works but the answer is cut off
Increase the 1200 ms stable-answer timer in waitForStableResponse in chrome-extension/content.js (and reload the extension). Very long code reviews may need 2.5–3 seconds. Do not remove the generation/change proof; that is what prevents stale answers.
Linux: Chrome exits immediately
Run ./linux/start-browser.sh and inspect:
tail -n 50 ~/.local/state/gemini-web-bridge/chrome.logCommon causes:
Chrome not installed or
CHROME_BINwrong.Running as root without
--no-sandbox(the script adds it automatically when root).Missing shared libraries; install Chrome's dependencies.
Xvfb not installed.
Linux: no VNC connection
Make sure you ran
ssh -L 5900:127.0.0.1:5900 user@server.x11vnc binds localhost only. Do not expose it publicly.
Check
~/.local/state/gemini-web-bridge/x11vnc.log.
OpenCode does not see the MCP server
Validate config JSON.
Run
opencode mcp list.Check OpenCode logs:
~/.local/share/opencode/log/opencode.log.Use an absolute path to
server.jsin the config.
Development
npm install
node server.js # stdio MCP server, normally started by OpenCodeExtension development:
Edit files in
chrome-extension/.Reload the extension at
chrome://extensions.Refresh the Gemini tab after the extension reload. Content scripts are cached per extension load.
Check the service worker console for
[Bridge BG]and the Gemini page console for[Gemini Bridge]timing messages.
Tests
The tests spawn their own MCP server over stdio and exercise the real browser bridge. Chrome must be running, the extension loaded, and a Gemini tab available. If another process owns the bridge port, the test server becomes a proxy, which also exercises proxy routing.
npm run test:smoke # status, model, one prompt
npm run test:seq # text -> context -> file in one chat
npm run test:e2e # status, mode, text, context, file, refresh, new chat
npm run test:e2e:full # adds abort/recovery and two-session isolationUse GEMINI_BRIDGE_PORT to point the tests at an isolated bridge port (for example 8086). Do not expose that port.
tests/one.mjs can run a single prompt with an optional file:
node tests/one.mjs --new-chat --file /tmp/report.txt --prompt "Summarize the attachment"Logs:
MCP server log:
server.lognext toserver.js(override withGEMINI_BRIDGE_LOG). Each line includes the process PID.Browser launcher logs:
~/.local/state/gemini-web-bridge/.
To test the MCP handshake without OpenCode, send JSON-RPC lines to node server.js:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/list"}Attribution and license
Original extension and bridge concept: Walkoud/gemini-browser-mcp, MIT.
This fork adds file transfer, owner/proxy multi-workspace support, loopback security, auto-injection, Linux tooling, and documentation.
License: MIT. See LICENSE.
Available Tools
1 toolask_gemini_webB
Send a prompt to Gemini Pro via the browser extension. Optionally upload local files and save files Gemini returns.
Inputs: prompt (required), files, download_dir.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool there is no possibility of confusion or misselection between tools. The single tool's purpose—sending a prompt to Gemini via the browser bridge—is unambiguous.
ask_gemini_web follows a clear snake_case verb_noun convention, which is a good pattern. Consistency cannot really be demonstrated with a single tool, so it falls short of a perfect score by lack of evidence rather than by any flaw.
The server's purpose is narrow (a browser bridge to Gemini), so one core operation is defensible, but a single tool is thin even for this scope. There is no companion tool for checking extension connectivity, managing sessions, or retrieving prior responses.
The prompt/upload/download loop is covered, which is the essential capability. However, there are notable gaps: no connection/health check, no way to list or resume conversations, and no handling of long-running or asynchronous requests, leaving agents with dead ends when things go wrong.
Maintenance
Related MCP Connectors
Lets Claude, ChatGPT and other AI chats work on your Linux computers: terminal, files and browser.
Let AI agents use any website you're logged in to. Sessions stay encrypted on your machine.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Let AI agents use your real, signed-in Chrome: tabs, clicks, forms, screenshots and video.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control a user's existing Chrome browser with preserved logins, performing tab management, element interaction, script execution, and screenshots, all locally via a Chrome extension and Python bridge.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables any coding agent to use the user's existing Chrome profiles and logins to open tabs, read pages, fill forms, click through flows, and take screenshots.33 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude or any MCP client to use the Google Gemini web app through a real Chrome browser with a normal Google account and no API key, including sending prompts, managing chats, uploading files, downloading results, and inspecting or interacting with pages via accessibility roles.MIT
- AlicenseAqualityBmaintenanceConnects AI agents to a real local Chrome, Edge, or Brave browser over CDP, enabling navigation, interaction, page extraction, and authenticated downloads while reusing existing logins, cookies, and browser fingerprint to bypass Cloudflare challenges and handle CAPTCHAs with human-in-the-loop waiting.211,610 npmMIT