OpenCode in Chrome
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., "@OpenCode in ChromeOpen my Gmail inbox and read the latest 2 emails"
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.
OpenCode in Chrome
Let your local opencode agent see and control the browser — tabs, clicks, JS, screenshots.
Anton Petnitsky · github.com/Mukller · LinkedIn
An alternative to Claude-in-Chrome for opencode: a Chrome extension + a local bridge with an MCP interface. The agent gets full control over your live browser — with logged-in sessions, no --remote-debugging-port, and no clouds. Everything goes through localhost.
┌──────────────────┐ WebSocket ┌─────────────────┐ stdio/MCP ┌──────────┐
│ Chrome extension │◄──────────────►│ bridge (Node) │◄───────────────►│ opencode │
│ chrome.debugger │ 127.0.0.1 │ ws + mcp │ │ │
└──────────────────┘ └─────────────────┘ └──────────┘The key trick: the extension itself starts a CDP session via chrome.debugger — so no browser launch flags are needed, and all profiles and cookies work as usual.
Features
MCP tool | What it does |
| list of open tabs |
| open / navigate / close a tab |
| wait for the page to load |
| run JavaScript on the page, get the result |
| click a CSS selector |
| fill in a field (React-friendly, via native setter) |
| send a key to the focused element |
| title + URL + visible page text |
| PNG screenshot of the tab (returned as an image block) |
| latest console.log / page exceptions |
Related MCP server: @nimbus21.ai/chrome-devtools-mcp
Installation
1. Bridge
git clone https://github.com/Mukller/opencode-chrome.git
cd opencode-chrome
npm install
node bridge/bridge.mjsOn first start, the bridge prints a token and saves it to ~/.opencode-chrome/token.
2. Extension
Open
chrome://extensions→ enable Developer modeLoad unpacked extension → select the
extension/folderClick the extension icon → Settings → paste the token from step 1 → Save & reconnect
The icon badge should turn green ON
3. Connect to opencode
In ~/.config/opencode/opencode.json (or in the project one):
{
"mcp": {
"chrome": {
"type": "local",
"command": ["node", "<путь до репо>/bridge/bridge.mjs"],
"enabled": true
}
}
}Restart opencode — the chrome_* tools will appear for the agent.
Bridge environment variables: OPENCODE_CHROME_PORT (default 8766), OPENCODE_CHROME_TOKEN (fixed token instead of a file).
Security
The WS server listens only on 127.0.0.1, foreign connections are rejected.
The handshake requires a token; an invalid token = the connection is closed.
The extension only executes commands from the connected bridge; everything is visible in the yellow "debugging started" banner during active operations.
Known limitations
While a CDP session is active on a tab, Chrome shows the infobar "An extension started debugging this browser" — that's the price for access without devtools flags.
The extension's service worker sleeps when Chrome is idle; the bridge just waits for reconnection (auto-reconnect).
Tests
npm test # E2E: фейковое расширение + MCP-клиент против реального мостаLicense
MIT © Anton Petnitsky
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Real Chrome for agents: start a browser, read pages as numbered markdown, click, type, hand off.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to control the Google Chrome browser through a Node.js WebSocket bridge and a dedicated browser extension. It provides tools for capturing screenshots, executing JavaScript, managing tabs, and extracting page content via the MCP protocol.2-
- AlicenseNot gradedqualityCmaintenanceLets AI coding agents control and inspect a live Chrome browser via MCP, providing Chrome DevTools capabilities for automation, debugging, and performance analysis.17Apache 2.0
- AlicenseNot gradedqualityBmaintenanceLets coding agents control and inspect a live Chrome browser via MCP, providing Chrome DevTools capabilities for automation, debugging, and performance analysis.1,426,792Apache 2.0
- AlicenseNot gradedqualityCmaintenanceLets AI coding assistants control and inspect a live Chrome browser through MCP, enabling reliable automation, debugging, and performance analysis using Chrome DevTools.1,426,792Apache 2.0