opencode-browser-mcp
Enables browser automation using Brave as the browser, providing tools for controlling tabs, navigating, and interacting with web pages.
Enables browser automation using Google Chrome as the browser, providing tools for controlling tabs, navigating, and interacting with web pages.
Enables browser automation using Helium as the preferred browser, providing tools for controlling tabs, navigating, and interacting with web pages.
Click on "Install 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-browser-mcpCheck my Gmail for unread emails and summarize them"
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-browser-mcp
One shared browser profile with separate tab ownership for every OpenCode
session. The plugin wraps
chrome-devtools-mcp
and routes each conversation through its own browser tabs while sharing cookies,
logins, local storage, cache, and extensions.
Requirements
OpenCode 1.18 or newer
Linux x64
Bun
A local Chromium-family browser
A graphical session, unless
OPENCODE_BROWSER_HEADLESS=true
Related MCP server: Chrome DevTools MCP
Setup
Add the plugin to opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@mirsella/opencode-browser-mcp"]
}Restart OpenCode after changing its configuration. That is the complete setup. You do not need a separate installation, broker command, or background service.
The first OpenCode adapter starts the packaged native broker automatically. Concurrent OpenCode instances converge on the same private socket and browser profile. The broker remains available while at least one adapter is connected, then closes the browser and exits shortly after the final adapter disconnects.
Plugin behavior
The plugin:
registers the packaged browser MCP adapter;
injects the active OpenCode session ID after model argument generation;
exposes compact browser tools unless existing permissions require direct tools;
releases owned tabs when an OpenCode session becomes idle or is deleted;
registers the bundled browser automation skill.
OpenCode sees two compact tools by default:
browser_dispatchexecutes one browser action.browser_helplists actions or loads one action schema.
If the plugin detects per-action browser_* permission or tool rules, it uses
direct tools so those policies continue to work. Compact mode can also be
disabled explicitly:
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
["@mirsella/opencode-browser-mcp", { "compactTools": false }]
]
}releaseOnIdle defaults to true. Set it to false to keep tabs between idle
turns. Deleting the OpenCode session still releases them.
{
"$schema": "https://opencode.ai/config.json",
"plugin": [
["@mirsella/opencode-browser-mcp", { "releaseOnIdle": false }]
]
}Architecture
flowchart LR
O1[OpenCode instance A] --> A1[packaged stdio adapter]
O2[OpenCode instance B] --> A2[packaged stdio adapter]
A1 -->|private Unix socket| R[auto-managed broker]
A2 -->|private Unix socket| R
R --> T[CDP target tracker]
R --> W[session worker pool]
W --> C[chrome-devtools-mcp]
T --> B[managed browser]
C --> B
B --> P[shared locked profile]The adapter starts the broker on demand but does not own it. This lets adapters from separate OpenCode processes share one browser without tying its lifetime to whichever process connected first. Socket and profile locks make simultaneous startup race-safe and prevent two browsers from opening the same profile.
Each routed session leases its own chrome-devtools-mcp worker. Stable
browser-level CDP target IDs remain the ownership authority; worker-local page
numbers are removed from model-visible schemas and responses.
Ownership guarantees
A tab has at most one owner.
Routed sessions execute concurrently through separate workers.
Popups inherit the owner of their opener tab.
A session cannot select, inspect, or close another session's tabs through the broker.
Manual and otherwise unowned tabs are not claimed during cleanup.
Ownership conflicts, stale browser generations, and malformed responses fail closed.
These are routing guarantees, not an operating-system security boundary. Any process running as the same Unix user can connect directly to the browser's loopback CDP port.
Browser and profile
The plugin detects Chromium, Google Chrome, Helium, Brave, and Microsoft Edge.
Google Chrome 136 and newer ignore remote-debugging flags for its default data
directory, so Chrome uses a dedicated directory under
~/.config/opencode-browser-mcp by default. Other detected browsers retain their
existing profile defaults.
The broker starts Chromium lazily on the first browser action. For a headed browser it passes only a fixed allowlist of display and desktop variables. The current process environment stays authoritative; missing values are recovered from the current user session when available.
Optional environment variables inherited from OpenCode:
Variable | Default | Purpose |
| auto-detected | Chromium-family executable |
| browser-dependent | Shared browser data directory |
|
| Run without a visible window |
|
|
|
|
| Loopback CDP port |
|
| Fallback cleanup for routed sessions |
|
| Browser startup deadline |
|
| Browser operation deadline |
|
| DevTools MCP launcher |
Lifecycle
Event | Behavior |
First adapter connects | One internal broker acquires the socket and profile leases |
Tools are listed | Chromium remains stopped |
First browser action | Chromium and the ownership tracker start |
OpenCode session becomes idle or is deleted | Only that session's owned tabs close |
Another OpenCode instance connects | It shares the broker and profile with isolated tab ownership |
Final adapter disconnects | The broker waits briefly, closes Chromium, and exits |
Broker exits unexpectedly | A later adapter starts a replacement and recovery fails closed unless the exact browser generation matches |
Troubleshooting
A headed startup error mentioning
DISPLAYorWAYLAND_DISPLAYmeans no graphical session could be found. SetOPENCODE_BROWSER_HEADLESS=truewhen running without one.A profile or socket lease error means another live package process owns it or a stale process is still running. Do not bypass the locks.
A process on the configured CDP port must belong to the exact managed browser generation. Stop it or choose another port.
If downstream startup fails, verify that
bunxis available to OpenCode.The plugin refuses to replace an unrelated
mcp.browserentry.
Security
All sessions deliberately share cookies, authentication, storage, extensions, permissions, history, and downloads. Browser content remains untrusted and may contain prompt injection. The private same-UID socket prevents access by other local users, but it does not isolate processes already running as your Unix user.
Read SECURITY.md before using a profile with sensitive data.
Development
cargo fmt --check
cargo test --all-targets
cargo clippy --all-targets -- -D warnings
bun test tests/plugin.test.ts
cargo test --release --test e2e -- --ignored --nocaptureThe headed E2E starts adapters against temporary profiles, sockets, and CDP ports. It checks automatic startup, startup races, cookie sharing, tab isolation, concurrent calls, active-call cleanup, reconnect grace, compact dispatch, both window layouts, and automatic browser shutdown.
Path | Responsibility |
| OpenCode registration, session routing, and cleanup controls |
| packaged native binary used directly by the OpenCode plugin |
| adapter bridge, managed broker lifecycle, routing, and leases |
| stable CDP target tracking and ownership |
| browser supervision, workers, and response filtering |
| atomic generation-scoped ownership state |
| startup, shared-profile, isolation, routing, and shutdown coverage |
See CONTRIBUTING.md for the development and release workflow.
License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser for automation, debugging, performance analysis, network monitoring, and DOM interaction through Chrome DevTools Protocol.1,608,580Apache 2.0
- -license-quality-maintenanceEnables AI coding assistants to control and inspect a live Chrome browser for automated debugging, performance analysis, and web interaction. It leverages Puppeteer and Chrome DevTools to provide capabilities like network monitoring, console logging, and automated browser actions.
- Flicense-qualityDmaintenanceA multi-agent orchestrator that enables multiple AI agents to share a single Chrome browser instance with tab isolation and shared state. It preserves local browser data like cookies and logins while allowing concurrent agent sessions through the official Playwright MCP.10
- Alicense-qualityAmaintenanceBridges AI agents to a real browser using a persistent daemon and Chrome extension for driving actual login sessions, cookies, and tabs.MIT
Related MCP Connectors
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mirsella/opencode-browser-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server