Browser MCP Server
š Browser MCP Server
The most comprehensive Browser MCP Server for AI agents ā 70 tools with human-like behavior, stealth anti-detection, session reuse, multi-browser support, 50+ device presets, and token-optimized outputs.
Built on Playwright + Model Context Protocol.
⨠Key Features
Feature | Description |
š¤ Human-Like Behavior | Bezier curve mouse movements, variable-speed typing, smooth scrolling ā evades bot detection |
š”ļø Stealth Anti-Detection | WebGL spoofing, canvas fingerprint noise, navigator.webdriver hidden, plugin/language spoofing |
š Session Reuse | Connect to existing Chrome via CDP or user-data-dir ā keeps cookies, logins, tabs |
š Multi-Browser | Chromium, Firefox, WebKit ā test across all engines |
š± 50+ Device Presets | iPhone, iPad, Pixel, Galaxy, OnePlus, Desktop ā full viewport/UA/touch emulation |
š Proxy Support | HTTP/HTTPS/SOCKS5 proxy with bypass rules |
š Network Monitoring | Auto-capture all requests/responses, console logs, filter by type |
šø Visual Annotation | mark_page: numbered boxes on interactive elements ā massive token savings |
š¾ Storage State | Save/load cookies + localStorage for cross-session persistence |
šÆ Smart Actions | Natural language commands: "click Login", "type hello into search" |
š Token Optimized | Compact outputs, configurable truncation ā saves 60-80% tokens vs competitors |
š¬ Video Recording | Record browser sessions for debugging and replay |
š Geolocation | Override latitude/longitude for location-based testing |
š HTTPS Errors | Ignore certificate errors for internal/staging sites |
š Quick Start
Install
git clone https://github.com/user/browser-mcp-server.git
cd browser-mcp-server
npm install
npx playwright install
npm run buildRun
# Auto-detect: tries CDP on port 9222, falls back to launching a new browser
node dist/index.js
# Connect to existing Chrome (preserves your logged-in sessions)
chrome --remote-debugging-port=9222
node dist/index.js --cdp http://localhost:9222
# Reuse Chrome profile (keeps all cookies, logins, extensions)
node dist/index.js --user-data-dir "C:\Users\you\AppData\Local\Google\Chrome\User Data"
# Launch Firefox with iPhone emulation and proxy
node dist/index.js --browser firefox --device "iPhone 15" --proxy-server http://proxy:8080VS Code MCP Configuration
Add to .vscode/mcp.json:
{
"servers": {
"browser": {
"type": "stdio",
"command": "node",
"args": ["path/to/browser-mcp-server/dist/index.js"]
}
}
}Claude Desktop Configuration
Add to claude_desktop_config.json:
{
"mcpServers": {
"browser": {
"command": "node",
"args": ["path/to/browser-mcp-server/dist/index.js"],
"env": {}
}
}
}š ļø All 70 Tools
Connection (1)
Tool | Description |
| Connect to browser (CDP/profile/temp launch). Multi-browser, device emulation, proxy. |
Navigation (5)
Tool | Description |
| Navigate to URL with configurable wait conditions |
| Go back in browser history |
| Go forward in browser history |
| Reload current page |
| Wait for page navigation to complete |
Page/Tab Management (4)
Tool | Description |
| List all open tabs |
| Open new tab (optionally with URL) |
| Close a tab by ID |
| Bring a tab to front/focus |
Interaction ā Human-Like (14)
Tool | Description |
| Click element with Bezier curve mouse movement |
| Type with human-like keystroke timing |
| Fill multiple form fields with natural pauses |
| Select dropdown option by value or label |
| Check/uncheck checkbox or radio button |
| Hover with natural mouse movement |
| Press key or combo (Enter, Ctrl+C, Tab, etc.) |
| Scroll with smooth human-like motion |
| Scroll element into view |
| Wait for element to appear/disappear |
| Wait for specific text on page |
| Drag element to target with natural motion |
| Upload file(s) to input |
| Accept or dismiss browser dialogs |
Reading/Observation ā Token-Optimized (14)
Tool | Description |
| Get visible text (default 4000 chars) |
| Get HTML (truncated to save tokens) |
| Get element text content |
| Get element attribute value |
| Get form element value |
| Quick true/false existence check |
| Count elements matching selector |
| Get element position and size |
| Screenshot page or element (PNG/base64) |
| Compact ARIA accessibility tree |
| List form elements (compact format) |
| List page links (deduplicated) |
| Extract table data as structured JSON |
| Run JavaScript in page context |
Cookies & Storage (10)
Tool | Description |
| Get cookies (compact format) |
| Set cookies |
| Clear all cookies |
| Get localStorage |
| Set localStorage key-value pairs |
| Get sessionStorage |
| Set sessionStorage key-value pairs |
| Clear localStorage, sessionStorage, or both |
| Save cookies + localStorage to JSON file |
| Load cookies + localStorage from JSON file |
Network Monitoring & Control (8)
Tool | Description |
| Wait for all network requests to finish |
| Wait for URL to match pattern |
| Wait for network response matching URL |
| Wait for network request matching URL |
| Get captured network requests/responses |
| Get captured console messages |
| Block URLs by pattern (ads, trackers, etc.) |
| Set custom HTTP headers |
Device & Viewport (3)
Tool | Description |
| Set viewport size for responsive testing |
| Emulate device (50+ presets) |
| List all available device presets |
Geolocation & Permissions (3)
Tool | Description |
| Override browser geolocation |
| Grant browser permissions |
| Clear all granted permissions |
Frame/iFrame Support (3)
Tool | Description |
| List all frames on the page |
| Run JavaScript in a specific frame |
| Click element inside a frame |
PDF (1)
Tool | Description |
| Save page as PDF (A4, Letter, etc.) |
Visual Annotation ā mark_page (5)
Tool | Description |
| Annotate page with numbered boxes on interactive elements |
| Remove annotations |
| Click by index from mark_page |
| Type into element by index from mark_page |
| Mark + screenshot (best for visual agents) |
Smart Tools (2)
Tool | Description |
| Ultra-compact page summary (minimal tokens) |
| Natural language browser action |
Browser Management (2)
Tool | Description |
| Get browser config details |
| Close browser and cleanup |
š± Supported Device Presets (50+)
iPhones: SE, 12 Mini, 12, 12 Pro, 12 Pro Max, 13, 13 Pro, 14, 14 Pro, 14 Pro Max, 15, 15 Pro, 15 Pro Max, 16 Pro Max
iPads: Mini, Air, Pro 11, Pro 12.9, 10th Gen
Android: Pixel 5, 6, 7, 8 Pro, Galaxy S21, S23 Ultra, Z Fold 5, A54, OnePlus 12, Moto G, Xiaomi 14, Huawei P60
Desktop: Chrome 1920x1080, Chrome 1440, Firefox, Safari, Edge, Small Laptop, Ultrawide
Landscape: iPhone Landscape, iPad Landscape, Android Landscape
š§ CLI Options
CONNECTION:
--cdp <url> Connect via Chrome DevTools Protocol
--user-data-dir <path> Launch browser with user profile
--executable-path <path> Path to browser executable
BROWSER:
--browser <engine> chromium, firefox, or webkit (default: chromium)
--headless Run in headless mode
--timeout <ms> Default action timeout (default: 30000)
VIEWPORT & DEVICE:
--viewport <WxH> Viewport size, e.g. 1920x1080
--device <name> Emulate device preset
NETWORK:
--proxy-server <url> Proxy URL
--proxy-bypass <domains> Domains to bypass proxy
--ignore-https-errors Ignore HTTPS certificate errors
--block-service-workers Block service workers
CONTEXT:
--user-agent <string> Custom user agent
--locale <locale> Browser locale (e.g. en-US)
--timezone <tz> Timezone (e.g. America/New_York)
--color-scheme <scheme> light, dark, or no-preference
--geolocation <lat,lng> Override geolocation
--permissions <list> Comma-separated permissions
SESSION:
--storage-state <path> Load session from JSON file
VIDEO:
--record-video Record browser session
--video-dir <path> Video output directoryEnvironment Variables
Variable | CLI Equivalent |
|
|
|
|
|
|
|
|
|
|
š³ Docker
docker build -t browser-mcp-server .
docker run -i browser-mcp-server
docker run -i browser-mcp-server --headless --browser chromiumšļø Architecture
src/
āāā index.ts # CLI entry point, MCP server setup
āāā browser-manager.ts # Browser lifecycle, multi-engine, stealth, tracking
āāā tools.ts # All 70 MCP tools with human-like behavior
āāā resources.ts # 6 MCP resources (page, cookies, console, network, etc.)
āāā human.ts # Human behavior engine (Bezier curves, natural typing)
āāā devices.ts # 50+ device emulation presets
āāā utils.ts # Shared utilities (selectors, accessibility, text extraction)
āāā mark_page.js # Page annotation script (numbered interactive elements)š Anti-Detection Features
navigator.webdriverset tofalseChrome runtime spoofed
Permissions query overridden
Plugins and languages spoofed
WebGL vendor/renderer overridden (Intel Iris)
Canvas fingerprint noise injection
connection.rttconsistencyAutomation command-line flags disabled
Human-like timing on all interactions
š Competitive Advantage
Feature | This Server | Playwright MCP (Microsoft) | mcp-playwright | Browserbase MCP |
Human-like behavior | ā Bezier curves | ā | ā | ā |
Stealth anti-detection | ā Full suite | ā | ā | ā |
Session reuse (CDP) | ā | ā | ā | ā (cloud) |
Multi-browser | ā 3 engines | ā | ā | ā |
Device emulation | ā 50+ presets | ā | ā 143 | ā |
Token optimization | ā Compact outputs | ā | ā | ā |
Network monitoring | ā Auto-capture | ā | ā | ā |
mark_page annotation | ā | ā | ā | ā |
Smart natural actions | ā | ā | ā | ā |
Console log capture | ā Auto | ā | ā | ā |
Video recording | ā | ā | ā | ā |
iframe support | ā | ā | ā | ā |
Total tools | 70 | ~20 | ~30 | ~15 |
š License
MIT
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/Yukendiran2002/browser_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server