A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
Minimal, auth-secured MCP server for real browser access. ~500 lines. Token auth, Chrome Extension MV3, accessibility tr
繁體中文 | English
Give your AI assistant eyes into your real browser — in ~500 lines of code.
A minimal, auth-secured MCP server that lets AI assistants read pages, take screenshots, and run scripts in your actual Chrome browser — with your existing login sessions intact.
AI Assistant ──HTTP POST──▶ MCP Server (:12307) ──WebSocket──▶ Chrome Extension ──▶ DOM
(token auth) (ws://) (minimal permissions)
Existing browser MCP solutions are either:
debugger, history, <all_urls> permissions, ships minified code you can't auditbrowser-mcp-lite takes a different approach:
| mcp-chrome | Playwright MCP | browser-mcp-lite | |
|---|---|---|---|
| Reads your real browser | Yes | No (headless) | Yes |
| Auth on MCP endpoint | No | No | Token auth |
| Extension permissions | 8+ | N/A | 5 (minimal) |
| Code you can audit | Minified | Yes | ~500 lines |
| Login sessions | Yes | No | Yes |
Four tools, exposed via standard MCP protocol:
| Tool | Description | Returns |
|---|---|---|
list_tabs | List all open tabs | [{id, url, title, active}] |
read_page | Read page as accessibility tree | Structured text (token-efficient) |
screenshot | Capture visible area | Base64 PNG image |
inject_script | Run custom JS in a tab | Script return value |
Option A — npx (no clone needed):
npx browser-mcp-lite
Option B — clone:
git clone https://github.com/notoriouslab/browser-mcp-lite.git
cd browser-mcp-lite/server
npm install
node index.js
On first run, a token is auto-generated. The server prints the full token and a ready-to-paste config block:
[browser-mcp-lite] MCP server: http://127.0.0.1:12307/mcp
[browser-mcp-lite] WebSocket: ws://127.0.0.1:12307/ws
⚠ First run — new token generated
━━━ Auth Token (paste into Chrome Extension popup) ━━━
<full 64-char hex token>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
━━━ MCP Client Config (save as .mcp.json) ━━━
{
"mcpServers": {
"browser": {
"type": "http",
"url": "http://127.0.0.1:12307/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[browser-mcp-lite] Waiting for Chrome Extension...
chrome://extensions/extension/ folderThe extension auto-connects. Click the toolbar icon to verify the green dot.
Note: The ready-to-paste
.mcp.jsonconfig is printed in the terminal when the server starts.
Add to your project's .mcp.json:
{
"mcpServers": {
"browser": {
"type": "http",
"url": "http://127.0.0.1:12307/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
}
}
}
Replace YOUR_TOKEN_HERE with the token printed in the terminal.
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"browser": {
"type": "http",
"url": "http://127.0.0.1:12307/mcp",
"headers": {
"Authorization": "Bearer YOUR_TOKEN_HERE"
}
}
}
}
In Cursor: Settings → MCP → Add Server:
browserhttphttp://127.0.0.1:12307/mcpAuthorization: Bearer YOUR_TOKEN_HERE┌─────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ AI Assistant │ │ MCP Server │ │ Chrome Extension │
│ (any MCP client) │────▶│ (Fastify) │────▶│ (Manifest V3) │
│ │HTTP │ :12307/mcp │ WS │ │
│ │POST │ Token auth │ │ tabs, scripting, │
│ │◀────│ │◀────│ activeTab, alarms │
└─────────────────┘ └──────────────────┘ └──────────────────┘
MCP Server (server/index.js, ~150 lines)
@modelcontextprotocol/sdk Streamable HTTP transport~/.browser-mcp-secrets.json)Chrome Extension (extension/background.js, ~215 lines)
Accessibility Tree Builder (extension/inject/accessibility-tree.js, ~195 lines)
ref_* IDs for each interactive/structural elementA typical web page has 50-200KB of HTML. An accessibility tree of the same page is 2-10KB — 10-50x smaller. It strips away styling, scripts, and decorative elements, keeping only what matters: headings, links, buttons, inputs, and their labels.
# Raw HTML: ~150KB
<div class="css-1dbjc4n r-1awozwy r-18u37iz r-1h0z5md" data-testid="...">
<div class="css-901oao r-1fmj7o5 r-37j5jr r-a023e6 r-b88u0q ...">
<span class="css-901oao ...">Settings</span>
</div>
</div>
# Accessibility tree: ~50 bytes
[ref_42 link "Settings" href=/settings]
Authorization: Bearer <token>. WebSocket endpoint requires token handshake on connect. Both use the same token from ~/.browser-mcp-secrets.json.tabs, activeTab, scripting, alarms, storage. No debugger, no history, no cookies, no webRequest.127.0.0.1. Not exposed to the network.Be aware of what you're exposing to your AI assistant.
list_tabs sends all open tab URLs and titles to the AI assistant. If you have sensitive pages open (email, medical, private messages), their URLs and titles will be visible.screenshot captures whatever is on screen, including passwords, personal data, or private content.screenshot switches tabs: Chrome's captureVisibleTab API can only capture the active tab. If you screenshot a background tab, it will be briefly switched to the foreground.Prompt injection risk: A malicious web page could contain hidden text that tricks your AI assistant into calling inject_script with harmful code on other tabs. Always review tool calls before approving them. Do not auto-approve inject_script calls.
Mitigations: Only run the server when you need it. Close sensitive tabs before use. Review what your AI assistant can see via list_tabs before calling other tools. Never auto-approve tool calls in your MCP client.
Chrome's Manifest V3 terminates Service Workers after ~30 seconds of inactivity. The extension uses chrome.alarms with a 24-second interval to stay alive and reconnect the WebSocket if needed.
Change the port:
MCP_PORT=9999 node index.js
Update the WebSocket URL in extension/background.js line 5 and extension/popup.html accordingly.
Add new tools:
Edit server/tools.js to register new MCP tools, and add the corresponding handler in extension/background.js's handleToolRequest switch.
node index.js). It listens on :12307 for HTTP (MCP) and WebSocket (extension).ws://127.0.0.1:12307/ws.read_page) to http://127.0.0.1:12307/mcp with a Bearer token.chrome.scripting.executeScript to inject the accessibility tree builder).The whole round trip takes 100-500ms depending on page complexity.
See examples/web-architectures.md for a detailed walkthrough of reading data from different web architectures — iframe-based legacy portals, React/Angular SPAs, Vue.js dynamic sites, AJAX-heavy dashboards, and CSP-strict pages.
node --test tests/server.test.js
Tests cover: health check, token auth (missing/wrong/valid), MCP protocol handshake, and session management.
browser-mcp-lite/
├── server/
│ ├── index.js # Fastify MCP Server + WebSocket hub
│ ├── tools.js # Tool schemas + handlers (4 tools)
│ ├── token.js # Shared token generation/loading
│ ├── setup.js # One-time token generator
│ └── package.json
├── extension/
│ ├── manifest.json # Manifest V3, minimal permissions
│ ├── background.js # Service Worker: WS client + tool implementations
│ ├── popup.html # Connection status UI
│ ├── popup.js
│ ├── inject/
│ │ └── accessibility-tree.js # DOM → structured text
│ └── icons/
├── examples/
│ └── web-architectures.md # Handling different web architectures
├── tests/
│ └── server.test.js # Server auth + protocol tests
├── LICENSE
├── README.md # English
└── README.zh-TW.md # 繁體中文
MIT
Accessibility tree approach inspired by anthropics/anthropic-quickstarts.
A Jetbrains IDE IntelliJ plugin aimed to provide coding agents the ability to leverage intelliJ's indexing of the codeba
Run Claude Code as an MCP server so any agent can delegate coding tasks to it
Browser automation using accessibility snapshots instead of screenshots