BrowserMCP
An MCP server that provides AI assistants with full control over a real browser session via a Chrome extension, supporting 36 tools for navigation, data extraction, and DOM manipulation. It bypasses bot detection by utilizing the user's active browser session, including cookies, authentication tokens, and installed extensions.
README
BrowserMCP
MCP server that gives AI assistants full control over your browser. Works with Claude Code, Cursor, and any MCP-compatible client.
The key advantage: uses your real browser session with all cookies, auth tokens, and extensions — no headless browser, no 403 errors.
Architecture
AI Client (Claude Code) --stdio--> MCP Server (Node.js) --WebSocket--> Chrome Extension
port 12800
Three components:
- MCP Server — Node.js process, communicates with AI via stdio, bridges to browser via WebSocket
- WebSocket Bridge — runs on port 12800, connects server to extension
- Chrome Extension — Manifest V3, executes commands in the browser using Chrome APIs
36 Tools
Core
| Tool | Description |
|---|---|
browser_navigate |
Open URL and return page content |
browser_read_page |
Read content from active or specific tab (text/html/full) |
browser_list_tabs |
List all open tabs with IDs, URLs, titles |
browser_close_tab |
Close a tab by ID |
browser_click |
Click element by CSS selector |
browser_type |
Type text into input field |
browser_screenshot |
Capture visible tab as PNG |
browser_execute_js |
Run JavaScript on the page |
Navigation
| Tool | Description |
|---|---|
browser_scroll |
Scroll by direction/pixels or to CSS selector |
browser_back |
Navigate back in history |
browser_forward |
Navigate forward in history |
browser_switch_tab |
Activate and focus a tab |
browser_keyboard |
Press keys with modifiers, inserts characters into inputs |
browser_hover |
Hover over element (mouseenter/mouseover) |
browser_select |
Select option in dropdown |
Data Extraction
| Tool | Description |
|---|---|
browser_get_links |
Extract all links, optionally filtered |
browser_get_elements |
Query elements by CSS selector with attributes |
browser_extract_table |
Parse table into structured JSON (headers + rows) |
browser_extract_meta |
Extract meta tags, OpenGraph, Twitter Cards, JSON-LD |
browser_extract_images |
Get all images with src, alt, dimensions |
browser_get_cookies |
Read cookies for a URL |
browser_get_storage |
Read localStorage or sessionStorage |
Utilities
| Tool | Description |
|---|---|
browser_wait_for |
Wait for element to appear (MutationObserver) |
browser_new_tab |
Open new tab |
browser_reload |
Reload tab (with optional cache bypass) |
browser_set_storage |
Write to localStorage or sessionStorage |
browser_set_cookies |
Set a cookie |
browser_find_text |
Search text on page with context |
Monitoring
| Tool | Description |
|---|---|
browser_console_log |
Capture console.log/warn/error (start/get/stop) |
browser_network_log |
Capture fetch/XHR requests (start/get/stop) |
browser_get_computed_style |
Read computed CSS properties |
browser_inject_css |
Inject custom CSS into page |
browser_highlight |
Highlight elements with colored outline |
browser_readability |
Extract main article content (Reader Mode) |
browser_watch_changes |
Watch DOM mutations (start/get/stop) |
Window Management
| Tool | Description |
|---|---|
browser_new_window |
Open new window (with size, incognito) |
browser_close_window |
Close window by ID |
browser_resize_window |
Resize window |
browser_move_tab |
Move tab between windows |
browser_pin_tab |
Pin/unpin tab |
browser_mute_tab |
Mute/unmute tab |
Advanced Interaction
| Tool | Description |
|---|---|
browser_right_click |
Right-click (contextmenu event) |
browser_double_click |
Double-click |
browser_drag_drop |
Drag and drop between elements |
Installation
1. Clone and build
git clone https://github.com/Smotree/BrowserMCP.git
cd BrowserMCP
npm install
npm run build
2. Load Chrome extension
- Open
chrome://extensions/ - Enable Developer mode (top right)
- Click Load unpacked
- Select the
extension/folder
3. Configure your MCP client
Auto-install (recommended)
Run the install script — it auto-detects Claude Code, VS Code, Cursor, and Claude Desktop:
npm run install-mcp # install to all detected clients
npm run install-mcp -- --uninstall # remove from all
Manual setup
<details> <summary><b>Claude Code</b> — <code>~/.claude.json</code> (user-scoped, all projects)</summary>
Via CLI:
claude mcp add --transport stdio --scope user browser -- node /path/to/BrowserMCP/server/dist/index.js
Or manually add to ~/.claude.json:
{
"mcpServers": {
"browser": {
"type": "stdio",
"command": "node",
"args": ["/path/to/BrowserMCP/server/dist/index.js"]
}
}
}
For a single project only, add .mcp.json to the project root with the same format.
</details>
<details> <summary><b>VS Code</b> — <code>%APPDATA%/Code/User/mcp.json</code> (Win) / <code>~/Library/Application Support/Code/User/mcp.json</code> (Mac)</summary>
{
"servers": {
"browser": {
"command": "node",
"args": ["/path/to/BrowserMCP/server/dist/index.js"],
"type": "stdio"
}
}
}
If the file already has other servers, just add "browser": { ... } inside "servers".
</details>
<details> <summary><b>Cursor</b> — <code>%APPDATA%/Cursor/User/mcp.json</code> (Win) / <code>~/Library/Application Support/Cursor/User/mcp.json</code> (Mac)</summary>
Same format as VS Code above. </details>
<details> <summary><b>Claude Desktop</b> — <code>%APPDATA%/Claude/claude_desktop_config.json</code> (Win) / <code>~/Library/Application Support/Claude/claude_desktop_config.json</code> (Mac)</summary>
{
"mcpServers": {
"browser": {
"command": "node",
"args": ["/path/to/BrowserMCP/server/dist/index.js"]
}
}
}
</details>
4. Verify
The extension badge shows ON (green) when connected, OFF (red) when disconnected. The extension auto-reconnects within 1-2 seconds when the server starts.
Testing
A test page and two test scripts are included:
# Serve the test page
npm run test:serve
# Quick test — verifies all tools with DOM state checks
# (close Claude Code first to free port 12800)
npm run test:quick
# Demo test — visual walkthrough of all tools for screen recording
npm run test:demo
Both test scripts auto-kill any process on port 12800 before starting.
Configuration
| Environment Variable | Default | Description |
|---|---|---|
BROWSER_MCP_WS_PORT |
12800 |
WebSocket port for server-extension communication |
Multi-instance (HTTP Relay)
When multiple IDE windows are open, each launches its own BrowserMCP server. The first instance owns port 12800 and connects to the Chrome extension directly. Subsequent instances detect the port is busy and automatically switch to HTTP relay mode — they proxy commands through the first instance's /exec endpoint. This is transparent: all tools work the same regardless of which instance you use.
Project Structure
BrowserMCP/
extension/ Chrome extension (Manifest V3)
background.js Service worker — WebSocket client, command handlers
manifest.json Extension manifest
popup.html/js Connection status popup
icons/ Extension icons
server/ MCP server (TypeScript)
src/
index.ts Entry point — stdio transport + WS bridge
mcp-server.ts Creates MCP server, registers tools
ws-bridge.ts WebSocket server with request correlation
types.ts Shared types
tools/ Tool definitions by category
core.ts navigate, read_page, list_tabs, etc.
navigation.ts scroll, back, forward, keyboard, etc.
extraction.ts get_links, extract_table, get_cookies, etc.
utilities.ts wait_for, new_tab, reload, find_text, etc.
interaction.ts right_click, double_click, drag_drop
monitoring.ts console_log, network_log, inject_css, etc.
window.ts new_window, resize_window, pin_tab, etc.
content.ts highlight, readability, watch_changes, etc.
test/
test-page.html Test page exercising all 36 tools
quick-test.mjs Automated test with assertions
demo-test.mjs Visual demo for screen recording
How It Works
- MCP client (Claude Code) spawns
node server/dist/index.jsas a child process - Server communicates with the client via stdin/stdout (MCP protocol)
- Server starts a WebSocket server on port 12800
- Chrome extension connects to the WebSocket and waits for commands
- When a tool is called, server sends a command to the extension via WebSocket
- Extension executes the command using Chrome APIs and returns the result
- Server forwards the result back to the MCP client
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。