browser-mcp
Connects to a Chrome DevTools Protocol endpoint to control a Chrome browser, including listing tabs, inspecting the DOM and selected elements, interactively picking elements, evaluating JavaScript, taking screenshots, and reading console and network events.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
browser-mcp
browser-mcp is a small browser-runtime MCP server for coding agents. It connects directly to a Chrome DevTools Protocol (CDP) endpoint and exposes eight high-level tools instead of mirroring the very large CDP API.
Tools
Tool | Purpose |
| List tabs, refresh the default to the focused page, and begin console/network capture |
| Return a compact, bounded DOM tree |
| Inspect one CSS-selected element, its box and computed style |
| Highlight the page and block until the user clicks a visually referenced element |
| Evaluate JavaScript, await promises, and test runtime mutations |
| Return a viewport or full-page image to the agent |
| Read buffered console events or wait for the next matching event |
| Read buffered requests or wait for the next matching request |
All potentially large outputs have hard limits. Network output intentionally excludes headers such as Authorization and Cookie.
Related MCP server: chrome-devtools-mcp
Requirements
Node.js 22 or newer
Chrome, Chromium, or Chrome for Testing with a CDP HTTP endpoint
Cursor or another MCP client that supports stdio servers
Chrome 136 and newer ignore --remote-debugging-port for the normal Chrome profile. Use a separate --user-data-dir, which is also the safer way to give an agent runtime access.
Install and build
npm install
npm run buildThe ordinary settings are at the top of src/config.ts. The CDP endpoint defaults to http://127.0.0.1:9222; set BROWSER_CDP_URL only when a different local endpoint is needed.
Start Chrome with CDP
Close or leave your ordinary Chrome untouched, then start a separate debugging profile.
macOS:
open -na "Google Chrome" --args --remote-debugging-port=9222 --user-data-dir=/tmp/browser-mcp-profileLinux:
google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/browser-mcp-profileWindows PowerShell:
& "$env:ProgramFiles\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:TEMP\browser-mcp-profile"Open http://127.0.0.1:9222/json/list to verify that Chrome is exposing tabs.
Configure Cursor
Create or edit .cursor/mcp.json in the project that should use the tools. Replace the path with the absolute path to this project.
{
"mcpServers": {
"browser-mcp": {
"command": "node",
"args": ["/absolute/path/to/browser-mcp/dist/server.js"],
"env": {
"BROWSER_CDP_URL": "http://127.0.0.1:9222"
}
}
}
}Restart or reload Cursor after changing the configuration. Cursor CLI users can verify the registration with agent mcp list-tools browser-mcp.
Suggested agent flow
The server sends model-facing instructions with its MCP initialization response. They tell the agent to treat the user as an active debugging partner and use page-runtime or two-phase coordination instead of guessing. No workflow depends on the client rendering an input or confirmation form.
For element work:
get_pagesinspect_pagewhen the target is already identifiableFor phrases such as “this logo”, the agent tells the user what to click and calls
pick_element({ interaction_prompt: "Click the logo you mean · Esc to cancel" })The browser page displays that instruction, highlights hovered elements, and waits for a click
The same tool call returns the clicked element's selector, tag, text, box, and clipped HTML; Escape cancels
inspect_element,evaluate, andscreenshotcan then analyze, test, and verify the change
get_pages refreshes the default page on every call. It prefers the page for which document.hasFocus() is true and visibilityState is visible; if Chrome reports no focused page, it falls back to the first current /json/list page. Passing page_id targets only that tool call and never changes the default. Call get_pages again after the user opens or switches tabs when subsequent calls will omit page_id.
For a network action:
get_pagesThe agent calls
get_network({ capture_action: "start" })and retains the signedcaptureIdThe agent tells the user in ordinary chat exactly what browser action to perform; the page displays a green capture-active banner
After the user reports completion, the agent calls
get_network({ capture_action: "finish", capture_id: "...", ...filters })The finish call returns only requests whose event sequence began after the start boundary
The same start/chat/finish transaction works for console output with get_console. Results include startedAt, finishedAt, and per-event sequence numbers. Filters are evaluated on the finish call, so repeat the desired filters there.
The older wait_for_next mode remains available when the desired endpoint is one specific event rather than a user-confirmed capture window. wait_until controls whether a network wait ends when the request starts, its response arrives, or loading finishes.
Calling pick_element without interaction_prompt uses the default page banner. Supplying it changes only the banner text; both paths use the same blocking page-runtime picker. A client's tool-permission prompt merely authorizes execution and is not treated as interaction completion. For less common DOM events, evaluate can install a one-shot event listener and return a Promise that resolves after the user action.
Console and network capture begin when get_pages (or the first page-specific tool) attaches to the tab. They cannot reconstruct events that Chrome no longer has after a disconnected session.
v0.5.0 boundaries
Direct CDP-over-WebSocket connection only. Chrome 144's consent-based
--autoConnectflow for attaching to an ordinary running profile is not implemented in this version.The main frame and open shadow roots are inspectable. Cross-origin iframe contents require a later multi-target implementation.
get_networkreturns metadata, not response bodies or WebSocket frames.pick_elementwaits up to two minutes; click an element or press Escape.evaluateis intentionally powerful and can mutate the page or read data available to page JavaScript. Use a dedicated debugging profile.
Development
npm testThe test suite covers the MCP tool catalog, CDP command/event transport, output limits, selector interpolation safety, and an end-to-end fake-CDP flow through all eight runtime operations.
References
This server cannot be deployed
Maintenance
Related MCP Connectors
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Launch, inspect, control, and share isolated cloud browsers for your agents.
Cloud browser, web extraction, screenshots, and remote CDP tools for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to control and inspect a live Chrome browser via MCP, providing Chrome DevTools capabilities for automation, debugging, and performance analysis.1,884,352 npmApache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to control and inspect a live Chrome browser for reliable automation, in-depth debugging, and performance analysis via Chrome DevTools.1,884,352 npmApache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to control and inspect a live Chrome browser for reliable automation, in-depth debugging, and performance analysis.1,884,352 npmApache 2.0
- AlicenseNot gradedqualityBmaintenanceLets coding agents control and inspect a live Chrome browser for reliable automation, in-depth debugging, and performance analysis. Provides access to Chrome DevTools capabilities such as tracing, network inspection, screenshots, and console messages through MCP clients.1,884,352 npmApache 2.0