browser-mcp
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., "@browser-mcpTake a snapshot of the current page"
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.
Browser MCP
Expose your Chrome/Edge browser as MCP tools for any AI agent. A Chrome extension (Manifest V3) acts as the MCP server itself: it connects to a code-mcp-gateway and answers MCP requests in place — no local server required. It speaks the same JSON-RPC protocol as code-mcp, so it drops into existing agent setups.
How it works
flowchart LR
subgraph Agent["Agent side"]
A["MCP client / AI agent"]
end
subgraph Gateway["code-mcp-gateway (Cloudflare Worker)"]
G["wss://code-mcp.tuanm.dev/ws/<id>"]
end
subgraph Browser["Your browser"]
E["Extension (MV3)<br/>service worker = MCP server<br/>offscreen = WS bridge"]
P["Page (content script)"]
end
A -- "MCP JSON-RPC" --> G
G -- "register / keepalive /<br/>forward requests" --> E
E -- "CDP / tabs / scripting" --> PThe popup takes a Device ID and Token; the extension connects straight
to the gateway (register, keepalive every 25s, 75s watchdog, jittered backoff
reconnect) and serves initialize / tools/list / tools/call in place.
Any agent that can reach the gateway can drive the browser.
An optional local server (browser-mcp.ts) adds a file store
(file_read, large downloads/uploads) and a plain local MCP HTTP endpoint.
See Local server.
Quick start
Chrome or Edge >= 111. Bun >= 1.1 only needed for the local server or dev tooling — the extension works standalone.
Load the extension. Open
chrome://extensions, enable Developer mode, click Load unpacked, and selectpackages/browser-extension. (Or runbun browser-mcp.tsand download the zip fromhttp://127.0.0.1:7777/extension.)Connect. Click the toolbar icon (the MCP mark turns green when connected). Enter the gateway Device ID and Token, click Connect. The popup shows Connected (gateway).
Use it. Point any MCP client at your gateway device. The extension answers
tools/listwith 47 tools.
The token must match the one configured for this device on the gateway. The gateway forwards it with each request and the extension verifies it. Leave it empty and anyone reaching the gateway can control the browser.
Local server
Only needed for the file store (file_read, downloads/uploads > 512 KB) or a
local MCP HTTP endpoint:
bun browser-mcp.ts # http://127.0.0.1:7777/mcp
bun browser-mcp.ts --token <s> # require auth on /mcp + /filesWith the server running, the popup also hands the ID + Token to the server's own
gateway link; without it the extension still works directly. Local clients use
http://127.0.0.1:7777/mcp — see mcp-client.example.json (add
"headers": { "Authorization": "Bearer <token>" } if you run with
--token). Verify: curl -s http://127.0.0.1:7777/health.
Remote access via code-mcp-gateway
Direct (default). Enter ID + Token in the popup; the extension serves MCP itself. No local server.
Server-side link. With the local server, the popup connects to
wss://code-mcp.tuanm.dev/ws/<id>and the server answers MCP over HTTP.CLI (custom gateway):
bun browser-mcp.ts --gateway <domain> --token <s> --id <device-id>Same protocol as direct mode. Use the same
--tokenon the gateway device; never run gateway mode without one. SetBMCP_GATEWAY_DOMAINto override the popup's default gateway host.
Tools (47)
Element discovery with the @ref system: snapshot returns an interactive
element tree with [ref=eN] markers; every interaction tool accepts the ref
or a CSS selector (refs are cached and resolved automatically; stale refs error
with "run snapshot again").
Discovery —
snapshot,find(role/name/text/label/placeholder/ title/testid/selector),get,isInteraction —
click,dblclick,type,fill,check,uncheck,select,hover,focus,press,drag,scroll,uploadNavigation —
navigate,reload,back,forward,close,tabs,windowPage reads —
extract,execute,screenshot(image block),pdf,wait,highlightState & debugging —
store,cookies,storage,console,errors,network,status,file_readEmulation & control —
emulate,set(viewport/device/geo/offline/ headers/media),perms,auth,dialog,frames,touch,download
Console/errors/network capture starts on the first call (lazy), so reload or
navigate after enabling to capture traffic. Back/forward use CDP navigation
history. Run curl -s -X POST http://127.0.0.1:7777/mcp -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
for full schemas.
Flags
Flag | Description | Default |
| Listen port |
|
| Bind address |
|
| Require auth on | none |
| Require this token from the extension on the bridge + file endpoints | none |
| Link the MCP endpoint through a code-mcp-gateway | none |
| Gateway device id (overridden by the popup ID) | random |
| Where downloaded/uploaded files are stored |
|
| DEV ONLY: skip the extension Origin check. Never on a shared machine | off |
Security
Origin-gated.
/browser/wsaccepts onlychrome-extension://origins;/mcpand/files/*reject browser origins other than localhost — a malicious website can't drive your browser through localhost (CSRF). Native MCP clients (no Origin header) are unaffected.--tokengates/mcpand/files/*(?token=or Bearer);--extension-tokenadds a secret the extension must present on the bridge.File IDs are 12-char random hex validated against a strict pattern; upload filenames are sanitized. Size caps: uploads 500 MiB, screenshots 8 MiB inline.
chrome.debuggershows the yellow infobar while attached (consent signal);perms/cookiesuse non-debugger APIs where possible.Binds to
127.0.0.1by default; binding to0.0.0.0without--tokenprints a warning.
Timeouts
Bridge commands: 30s default, 60s for navigate/execute/wait_for, 120s for
download/file_upload — capped at 120s locally and 55s in gateway mode (the
gateway aborts forwards after 60s). Tools accept bridge_timeout to override.
Development
bun run check # syntax-check server + scripts + extension JS
bun run test # mock-extension + mock-gateway E2E suite
bun run build # rebuild dist/browser-extension.zip
bun browser-mcp.ts # run the serverThis 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 Connectors
Live browser debugging for AI assistants — DOM, console, network via MCP.
AI-powered browser automation — navigate, click, fill forms, and extract data from any website.
Screenshot, diff, audit and sitemap-capture any web page — 5 MCP tools for AI agents.
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/Tuanm/browser-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server