What the Public Browser MCP server does
Public Browser MCP server lets an MCP client control Chrome for tasks such as opening pages, reading their accessibility trees, interacting with referenced elements, and completing forms. It communicates with Chrome through the Chrome DevTools Protocol rather than through Playwright or a browser extension.
The server is designed for agent workflows that benefit from compact, multi-action calls. Its run_plan capability can combine several browser steps with variables and conditions, while responses are structured to avoid repeating unchanged page content. The project also documents behavior intended to make failures explicit: ambiguous CSS matches return candidates instead of acting, references are scoped to tabs, and stale references are reported rather than reused.
How it works
The package runs as a standard stdio MCP server. A client starts it with npx -y public-browser@latest, and the first browser interaction launches Chrome visibly without requiring a manually configured debugging port. The implementation uses Chrome DevTools Protocol access and supports nested cross-origin iframes plus open and closed shadow roots.
Typical interactions use navigate to load a page, view_page to inspect its accessibility tree and obtain stable element references, and fill_form to populate multiple fields. Actions can then be grouped through run_plan when a workflow has several dependent steps. The README also describes Node and Python access to the same handlers outside the MCP server, including a Python package and a Node createSession() API.
Setup and configuration
Node.js 20 or newer is required. For Claude Code, add the server with:
claude mcp add --scope user public-browser -- npx -y public-browser@latest
Claude Code must be fully quit and reopened after this command because it reads and caches MCP configuration at session start. Cursor and Cline use their respective MCP JSON configuration files with npx as the command and -y public-browser@latest as its argument. Other clients can use the same stdio command if they support stdio MCP servers.
By default, Chrome starts with a temporary profile containing no existing cookies, logins, or extensions. The profiles command lists available Chrome profiles, and a profile can be selected with the --profile flag, the PUBLIC_BROWSER_PROFILE environment variable, or the configure_session MCP tool before browser interaction begins. On macOS, the README notes that non-Google site cookies may not carry over when using this profile mode.
Tools and capabilities
Documented browser capabilities include:
- Navigate to pages with
navigate.
- Inspect accessibility trees and element references with
view_page.
- Fill multiple form fields with
fill_form.
- Group actions, variables, and conditions with
run_plan.
- Select a Chrome profile with
configure_session.
- Interact with elements inside nested cross-origin iframes and shadow roots.
- Detect ambiguous selectors, stale references, and unconfirmed drag operations instead of silently continuing.
The project also provides a script mode for parallel access through its Node and Python APIs. This mode is enabled by adding --script to the server arguments.