browser-mcp
Browser MCP
Chrome/Edge extension (Manifest V3) that turns the browser into an MCP server for AI agents — 67 browser tools, direct code-mcp-gateway mode, screen recording, TTS narration, page annotations.
How it works
flowchart LR
A["AI agent"] -->|"MCP JSON-RPC"| G["code-mcp-gateway"]
G -->|"wss /ws/{deviceId}?token=…"| E["Extension (MV3)"]
E -->|"CDP / tabs"| P["Pages"]Mode | Connection | When to use |
Direct gateway (default) | Popup: Device ID + Token → | Remote agents over the internet; extension serves MCP itself, no local server |
Local bridge |
| File store ( |
Toolbar icon: gray = disconnected, green = connected.
Install
Requires Chrome or Edge ≥ 111.
Open
chrome://extensions, enable Developer mode, click Load unpacked, selectpackages/browser-extension(or install the zip above).Click the toolbar icon, enter the gateway Device ID and Token, click Connect — the popup shows Connected (gateway).
The token must match the device's token configured on the code-mcp-gateway. Leave it empty only if you accept that anyone reaching the gateway can control the browser.
Tools (67)
Element discovery uses the @ref system: snapshot returns an interactive element tree with [ref=eN] markers; every interaction tool accepts a ref or a CSS selector.
Group | Tools |
Discovery |
|
Interaction |
|
Navigation |
|
Page reads |
|
Network & DevTools |
|
State & debugging |
|
Emulation & control |
|
Media & narration |
|
Vault |
|
Media & narration
Tool | Behavior |
| Narrates each step via native speech synthesis ( |
| Caption bar for narrated text ( |
| Draws arrows, boxes, circles, highlights and text labels on a fixed overlay ( |
Vault
Encrypted in-browser credential store: master password → PBKDF2 → AES-256-GCM, stored in chrome.storage.local, never sent to the gateway.
Action | Purpose |
| Vault lifecycle |
| Credential CRUD |
| Fill a login form from the vault — secrets never leave the extension |
| Supply HTTP Basic/Digest credentials from the unlocked vault instead of tool arguments |
Local server
bun browser-mcp.ts # http://127.0.0.1:7777/mcp
bun browser-mcp.ts --token <s> # require auth on /mcp + /filesLocal clients use http://127.0.0.1:7777/mcp — see mcp-client.example.json. Verify: curl -s http://127.0.0.1:7777/health.
CLI
bun browser-mcp.ts --gateway <domain> --token <s> --id <device-id>Flag | Description | Default |
| Listen port |
|
| Bind address |
|
| Require auth on | none |
| Require this token from the extension | 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 | off |
Security
/browser/wsaccepts onlychrome-extension://origins;/mcpand/files/*reject browser origins other than localhost (CSRF).--tokengates/mcpand/files/*(?token=or Bearer);--extension-tokengates the extension bridge.In gateway mode the extension verifies the device token forwarded with each request before answering.
File IDs are 12-char random hex, validated and sanitized; uploads capped at 500 MiB, screenshots 8 MiB inline.
Binds to
127.0.0.1by default; binding to0.0.0.0without--tokenprints a warning.
Development
bun run check # syntax check
bun run test # test suite
bun run build # build dist/browser-extension.zip
bun browser-mcp.ts # run the serverLatest 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