BrowserMCP
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., "@BrowserMCPgo to my Amazon orders and tell me the status of the most recent one"
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.
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 12800Three 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 |
| Open URL and return page content |
| Read content from active or specific tab (text/html/full) |
| List all open tabs with IDs, URLs, titles |
| Close a tab by ID |
| Click element by CSS selector |
| Type text into input field |
| Capture visible tab as PNG |
| Run JavaScript on the page |
Navigation
Tool | Description |
| Scroll by direction/pixels or to CSS selector |
| Navigate back in history |
| Navigate forward in history |
| Activate and focus a tab |
| Press keys with modifiers, inserts characters into inputs |
| Hover over element (mouseenter/mouseover) |
| Select option in dropdown |
Data Extraction
Tool | Description |
| Extract all links, optionally filtered |
| Query elements by CSS selector with attributes |
| Parse table into structured JSON (headers + rows) |
| Extract meta tags, OpenGraph, Twitter Cards, JSON-LD |
| Get all images with src, alt, dimensions |
| Read cookies for a URL |
| Read localStorage or sessionStorage |
Utilities
Tool | Description |
| Wait for element to appear (MutationObserver) |
| Open new tab |
| Reload tab (with optional cache bypass) |
| Write to localStorage or sessionStorage |
| Set a cookie |
| Search text on page with context |
Monitoring
Tool | Description |
| Capture console.log/warn/error (start/get/stop) |
| Capture fetch/XHR requests (start/get/stop) |
| Read computed CSS properties |
| Inject custom CSS into page |
| Highlight elements with colored outline |
| Extract main article content (Reader Mode) |
| Watch DOM mutations (start/get/stop) |
Window Management
Tool | Description |
| Open new window (with size, incognito) |
| Close window by ID |
| Resize window |
| Move tab between windows |
| Pin/unpin tab |
| Mute/unmute tab |
Advanced Interaction
Tool | Description |
| Right-click (contextmenu event) |
| Double-click |
| Drag and drop between elements |
Installation
1. Clone and build
git clone https://github.com/Smotree/BrowserMCP.git
cd BrowserMCP
npm install
npm run build2. 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 allManual setup
Via CLI:
claude mcp add --transport stdio --scope user browser -- node /path/to/BrowserMCP/server/dist/index.jsOr 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.
{
"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".
Same format as VS Code above.
{
"mcpServers": {
"browser": {
"command": "node",
"args": ["/path/to/BrowserMCP/server/dist/index.js"]
}
}
}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:demoBoth test scripts auto-kill any process on port 12800 before starting.
Configuration
Environment Variable | Default | Description |
|
| 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 recordingHow It Works
MCP client (Claude Code) spawns
node server/dist/index.jsas a child processServer 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
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/Smotree/BrowserMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server