browserpilot-mcp
Allows AI agents to control a local Brave browser through a Chrome extension, enabling navigation, clicking, typing, scrolling, screenshots, and other browser automation in an authenticated session.
Click on "Deploy 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., "@browserpilot-mcpshow me my pull requests on GitHub"
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.
๐ BrowserPilot
Control your local desktop browser directly from remote VPS AI Agents via Model Context Protocol (MCP)
๐ก Why BrowserPilot?
When building autonomous AI agents on a remote VPS, interacting with modern websites is challenging:
Traditional headless browsers (like standard Puppeteer/Playwright) get blocked by Cloudflare, reCAPTCHA, and bot-detection systems.
Authenticating into your personal accounts (Google, GitHub, banking, dashboards) on a headless VPS requires syncing cookies and session tokens.
Remote debugging ports (
--remote-debugging-port=9222) trigger Chrome's prominent yellow "Browser is being controlled by automated software" banner.
BrowserPilot solves this by establishing a secure, persistent outbound WebSocket bridge directly from your local Chrome/Brave/Edge browser to your VPS MCP server. Your VPS AI agent can interact with your real, authenticated browser tabs using realistic DOM events while keeping the connection ultra-lightweight and invisible.
Related MCP server: MCP Chrome Bridge
๐งช Quick Verification Test
Once your browser extension is connected, copy and paste this command directly to your AI agent to verify everything is working end-to-end:
Open instagram.com and follow abhinav.nexusWhen you give this command to your agent, it will automatically navigate your browser, locate the profile, and click Follow. The agent will confirm:"BrowserPilot is working properly!"
๐๏ธ Architecture
sequenceDiagram
autonumber
actor User as You (Local PC)
participant Ext as Chrome Extension (MV3)
participant Relay as Offscreen Document (Persistent WS)
participant MCP as VPS MCP Server
actor Agent as AI Agent (Claude/Cursor/AGY)
User->>Ext: Loads Extension & Enters VPS Endpoint
Ext->>Relay: Initializes Background Offscreen Relay
Relay->>MCP: Outbound WebSocket Connect (ws://<your-vps-ip>:8765?token=...)
MCP-->>Relay: Auth Verified (200 OK)
rect rgb(30, 41, 59)
note right of Agent: AI Agent executes browser action
Agent->>MCP: Call Tool: browser_click({ selector: "#submit" })
MCP->>Relay: Send JSON Command (ID: cmd_101)
Relay->>Ext: Dispatch to Content Script
Ext->>Ext: Highlight element & dispatch native mouse events
Ext-->>Relay: Action Succeeded
Relay-->>MCP: Return Result (ID: cmd_101)
MCP-->>Agent: Tool Response: "Clicked #submit successfully"
end๐ ๏ธ MCP Tools Reference
BrowserPilot exposes 21 specialized tools directly to any MCP-compatible AI agent:
MCP Tool | Description | Key Parameters |
| Checks if local browser extension is connected and reports latency. | None |
| Lists all open tabs across your browser windows with titles, URLs, and permission status. | None |
| Navigates the current tab (or opens a new tab) to a given URL. Auto-approved in Hybrid mode. |
|
| Switches focus and brings a specific tab to the foreground. |
|
| Closes a specific tab. |
|
| Extracts readable text, clean markdown, or interactive element catalog. |
|
| Clicks an element by selector, text, badge label, or x/y. Supports human Bezier curve trajectories. |
|
| Types into an input/textarea with realistic input events and human variable delays. |
|
| Dispatches keyboard events ( |
|
| Scrolls the page in any direction or scrolls an element into view. |
|
| Captures the active viewport (preserves user active tab). |
|
| Runs custom JavaScript in page context. |
|
| ๐ Agent Code Interpreter: Executes async JavaScript with elevated privileges (bypasses website CSP). |
|
| ๐ช Extracts active cookies & session tokens for current domain. |
|
| ๐ Directly populates |
|
| ๐ฏ Numbers all interactive elements on screen (OmniParser mode). |
|
| ๐ Intercepts & handles native JavaScript dialogs ( |
|
| โณ Waits until all active XHR/fetch requests settle on single-page apps. |
|
| ๐ Reads from or writes text to the desktop browser clipboard. |
|
| ๐ Lists recent downloads or waits for an active file download to complete. |
|
| ๐ก๏ธ Requests explicit user permission to access a protected pre-existing tab. |
|
๐ก๏ธ Hybrid Privacy & Tab Permission Engine
BrowserPilot features an intelligent, multi-tier privacy boundary ensuring that AI agents cannot inspect or tamper with your personal tabs without consent:
๐ข Auto-Approved Agent Tabs (Zero Friction): Any tab spawned by the agent via
browser_navigate({ url, newTab: true })is tagged as agent-owned. The agent can browse, click, type, screenshot, and close within its own tabs with 100% autonomy.๐ Protected User Tabs: Pre-existing tabs (e.g. Gmail, Slack, banking, personal dashboards) are shielded by default. If an agent attempts to interact with an unapproved tab:
An elegant, floating banner slides down on that tab: "๐ค AI Agent is requesting permission to access this tab. [Allow Access] [Deny]".
The MCP server returns an immediate
PERMISSION_REQUIREDresponse informing the agent that user authorization is required.The agent can also explicitly call
browser_request_tab_access({ tabId, reason })to request permission with a custom explanation.
โ๏ธ Extension Popup Privacy Shield:
Privacy Mode Selector: Switch between
Hybrid (Recommended),Full Access (Unrestricted), andStrict Sandbox (Agent Tabs Only)in one click.Live Tabs Permission Manager: View all open browser tabs in the popup with real-time status chips (
Agent Tab,Protected,Allowed) and quick Allow / Revoke action buttons.
๐ฆ Project Structure
browserpilot/
โโโ mcp-server/ # Model Context Protocol Server (VPS side)
โ โโโ src/
โ โ โโโ index.ts # Stdio MCP Server & lifecycle entry
โ โ โโโ websocket-hub.ts # WebSocket server & command dispatcher
โ โ โโโ tools.ts # MCP tool definitions & schema validation
โ โ โโโ types.ts # Protocol message interfaces
โ โโโ test/ # Automated bridge integration tests
โ โโโ package.json
โ
โโโ extension/ # Manifest V3 Chrome Extension (Local side)
โ โโโ manifest.json # Extension configuration & permissions
โ โโโ background.js # Service worker & tab router
โ โโโ offscreen.html/js # Offscreen document (unbreakable WebSocket keep-alive)
โ โโโ content.js # In-page DOM engine & element highlighter
โ โโโ popup.html/css/js # Settings popup UI
โ โโโ icons/ # Extension icons
โ
โโโ package.json # Root pnpm workspace๐ Quickstart Guide
Step 1: Start the MCP Server on your VPS
Clone or copy the repository to your VPS:
cd /root/browserpilot pnpm installConfigure environment variables in
mcp-server/.env:WS_PORT=8765 SECRET_TOKEN=my-secure-browserpilot-tokenBuild and test the MCP server:
pnpm build pnpm --filter browserpilot-mcp exec tsx test/test-bridge.ts
๐ Best Practice: Zero-Config Deployment with Fire PM Tunnels
Instead of manually opening firewall ports or wrestling with SSL certificates, you can supervise BrowserPilot 24/7 and expose an encrypted HTTPS / WSS tunnel using Fire PM โ the native Linux process supervisor & tunnel ecosystem.
Install Fire PM (if not already installed): Visit the Fire PM Repository or run the installer:
git clone https://github.com/Fire-Package/fire-pm.git /root/fire-pm cd /root/fire-pm && sudo ./install.shStart BrowserPilot as a Persistent System Service:
fire start /root/browserpilot/mcp-server/dist/index.js --name browserpilot --env WS_PORT=8770 --env SECRET_TOKEN=my-secure-tokenOpen a Public Secure Tunnel (Automatic SSL/WSS):
fire tunnel open 8770 # Output: โ Custom Tunnel established for localhost:8770 # ๐ URL: https://<hash>-tunnel.yourdomain.comConnect from Chrome Extension: In the extension popup, enter:
VPS WebSocket Endpoint:
wss://<hash>-tunnel.yourdomain.comSecret Token:
my-secure-token
Manage Your Tunnel & Service:
fire list # View service health and memory usage fire tunnel list # View active tunnels and uptime fire logs browserpilot # Tail live service logs
๐ก๏ธ Manual Firewall Configuration (Alternative)
If you are not using Fire PM tunnels and are connecting directly over raw TCP, make sure port 8770 (or your custom WS_PORT) is open:
1. Ubuntu / Debian (UFW)
sudo ufw allow 8770/tcp comment "BrowserPilot WebSocket"
sudo ufw reload2. RHEL / CentOS / AlmaLinux / Rocky (firewalld)
sudo firewall-cmd --permanent --add-port=8770/tcp
sudo firewall-cmd --reload3. Raw iptables
sudo iptables -A INPUT -p tcp --dport 8770 -j ACCEPTStep 2: Install the Chrome Extension on your Local Computer
Copy or download the
extension/folder from your VPS to your local PC.In your local browser (Chrome, Brave, Edge):
Navigate to
chrome://extensionsEnable Developer mode in the top-right toggle.
Click Load unpacked and select the
extensionfolder.
Click the BrowserPilot icon in your browser toolbar:
VPS WebSocket Endpoint:
ws://<your-vps-ip>:8765(orwss://tunnel.yourdomain.com)Secret Token:
my-secure-browserpilot-tokenClick Connect.
The badge will turn ๐ข ON and status will display "Connected to VPS".
Step 3: Connect your AI Agent to the MCP Server
Add BrowserPilot to your agent's MCP configuration:
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"browserpilot": {
"command": "node",
"args": ["/path/to/browserpilot/mcp-server/dist/index.js"],
"env": {
"WS_PORT": "8765",
"SECRET_TOKEN": "my-secure-browserpilot-token"
}
}
}
}Antigravity CLI (agy) or Custom Agent
{
"mcpServers": {
"browserpilot": {
"command": "node",
"args": ["/root/browserpilot/mcp-server/dist/index.js"],
"env": {
"WS_PORT": "8765",
"SECRET_TOKEN": "my-secure-browserpilot-token"
}
}
}
}๐ Security & Privacy
The WebSocket bridge allows arbitrary command execution inside your browser session. Always protect your connection:
Pre-Shared Secret: Set a strong
SECRET_TOKENin your environment.Encryption: When running over public networks, route through an encrypted tunnel (Cloudflare Tunnel, Tailscale, or Nginx with Let's Encrypt
wss://).Visual Feedback: When an AI agent clicks or interacts with elements, BrowserPilot highlights them with green/blue halos in real-time so you always see what the agent is doing.
๐ค AI Agent Skill
BrowserPilot includes a dedicated AI Agent skill definition located in skills/browserpilot/SKILL.md.
To equip your Antigravity or custom agent with native BrowserPilot capabilities:
Copy or symlink
skills/browserpilotinto your agent's skills directory (e.g.~/.gemini/skills/browserpilot).Your agent will automatically learn the tool semantics, resilience rules, non-intrusive multitasking behavior, and the standard verification prompt:
Open instagram.com and follow abhinav.nexus
๐ง Troubleshooting & Known Issues
Facing port conflicts, Chrome MV3 restrictions, strict CSP errors, or disconnects?
๐ Read the comprehensive TROUBLESHOOTING.md guide for detailed solutions to every common edge case.
This server cannot be deployed
Maintenance
Related MCP Connectors
Browser MCP for logged-in tasks. Uses your Chrome โ credentials stay local. Zero-token replay.
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Live browser debugging for AI assistants โ DOM, console, network via MCP.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to control the Google Chrome browser through a Node.js WebSocket bridge and a dedicated browser extension. It provides tools for capturing screenshots, executing JavaScript, managing tabs, and extracting page content via the MCP protocol.2-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control Chrome browser actions like navigation, clicking, form filling, screenshots, and console/network logging via an MCP server and Chrome extension.545 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to control your existing Chrome browser via MCP, using your logged-in sessions for automation on authenticated sites. Provides high-level browser tools plus raw CDP and Chrome API access.MIT
- AlicenseNot gradedqualityAmaintenanceEnables local opencode agents to control a live Chrome browser via MCP tools, including tab management, JavaScript execution, clicking, form filling, page reading, screenshots, and console log retrieval.MIT