Browser MCP
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., "@Browser MCP open news.ycombinator.com and summarize the top five stories"
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.
Browser MCP
Browser MCP gives a local agent its own background browser. The agent reads structured page text and acts on element references. It can ask for a normal-size window when a person needs to sign in or complete a visual interaction.
The server is written in TypeScript and speaks MCP over stdio. Each client gets its own browser sessions. The desktop targets are macOS, native Windows and Omarchy (Wayland/Hyprland).
Status
Version 0.1.0 is the first public release.
Platform | State |
macOS | Verified with all five engines, including handoff and the desktop host |
Windows (GitHub Copilot desktop app) | Supported target. Needs verification on a Windows desktop |
Omarchy (Wayland/Hyprland) | Supported target. Needs verification on an Omarchy desktop |
Please report results from Windows and Omarchy. See CONTRIBUTING.md.
Related MCP server: MultiZen MCP Server
Install from source
Install Node.js 22.13 or later, then run:
git clone https://github.com/kh4rit/browser-mcp.git
cd browser-mcp
npm ci
npm run build
node dist/cli.js install desktopTo install it as a command instead, pack the checkout and install the archive. The commands below then start with browser-mcp in place of node dist/cli.js.
npm pack
npm install -g ./browser-mcp-local-0.1.0.tgz
browser-mcp install desktopThe default desktop engine uses Electron’s Chromium runtime. The install command fetches the runtime for the current platform. On Omarchy, start the client in your graphical login session so the handoff window can use the Wayland display. The server sizes the window to the primary work area and lets Hyprland place it. On Windows, use a native Windows Node installation and a local session in the GitHub Copilot desktop app.
Engine | Runtime |
| Managed Chromium in Electron, with a native window around the live document |
| Installed Google Chrome stable |
| Installed Microsoft Edge stable |
| Playwright Chromium. Install with |
| Playwright’s WebKit build. Install with |
For the desktop engine, handoff makes the live document visible in its native window. The other engines keep the original tab running and stream its view to a local human-only window during handoff. That separate window forwards pointer and keyboard input. Its frames stay on the machine and consume zero model image tokens. Use the desktop engine for workflows that depend on native browser or OS dialogs.
For Chrome and Edge, install the browser from its vendor. Playwright publishes builds for specific OS versions. The Omarchy target uses Chromium-based browsers; availability of additional engine binaries depends on upstream build support. Playwright browser documentation
Connect a client
Run the config command from the built checkout. It prints an entry containing the absolute Node and server paths for this installation, including the correct JSON escaping on Windows. Merge the entry with existing servers. Keep the checkout at that location while the client uses it.
Client | Command | Where the output goes |
Claude Code CLI |
| Project |
Codex CLI |
| User |
GitHub Copilot desktop app on Windows (primary) |
| User |
GitHub Copilot CLI on macOS or Omarchy |
| User |
Restart or refresh the client after adding the entry. The entry is named browser-mcp; some model providers reserve the bare name browser and reject requests from a server that uses it. Ask the client to use the browser-mcp server to open a public page, find a heading and follow a link. Claude Code MCP setup · Codex MCP setup · GitHub Copilot app MCP support · Copilot CLI setup
Clients without desktop access
For a client that can reach localhost but cannot launch graphical applications, start the browser host from a terminal in your signed-in desktop session. Leave it running while clients use it.
node dist/cli.js hostGenerate the client configuration with node dist/cli.js config codex --host (or substitute claude or copilot). The configured client starts a small stdio connector. Browser processes and handoff windows run under the desktop host. Closing a connector releases that client's sessions. Ctrl+C stops the host and checkpoints named profiles.
The host listens only on IPv4 loopback. Host and connector authenticate each other with a TLS pre-shared key in the OS user's browser-mcp data directory, under host/connection.key. Use the same OS account and data directory for both. The default port is 43971. To select a different port, append it to both host and config … --host. The host starts browsers on demand.
Tools
Tool | Purpose |
| Start a background session, optionally with an engine, a named profile or data copied from another session |
| List sessions, pages (including popups) and who has control |
| Go to an HTTP(S) URL and read the page |
| Read the page as compact text, search it, or scan ahead through lazy content |
| Click, fill, select, check, uncheck, hover or press a key on an element reference |
| Reveal more of the document or a nested scroll container |
| Show the live page to the user in a normal-size window until they choose Done |
| Copy cookies for chosen sites between two sessions |
| Checkpoint a named profile now |
| Close a session and save its profile |
An agent that also has a web fetch tool or another browser may not choose this server by itself. To direct it, add a line such as this to the agent's instructions:
Use the browser-mcp server for web pages that need interaction or sign-in. Read with browser_read and a query instead of taking screenshots. Call browser_handoff when a sign-in or a visual control needs me.Working with pages
Call
browser_openwith a URL and optional engine. The response includes the session ID, page ID and an observation revision. The default virtual viewport is 1440 × 2400 CSS pixels. Setwidthand the initialheightat open to select a different layout. Full observations grow the viewport up to 8192 pixels high.Use
browser_readwith a search term or element reference to narrow the result. For virtualized content, pass a query andscanStepsto search ahead by up to that many viewport heights. A scan reports the number of steps, scroll extent and reason it stopped. Include a ref and revision to scan a nested container. Continue a long response using its offset and revision. General observations omit editable field values. A scoped read can show an ordinary field value when its purpose is identifiable.browser_scrolladvances a document or nested container to expose lazy or virtualized content. Read and act on a virtualized row before scrolling it away.Pass the page ID, reference and observed revision to
browser_act. Actions include click, fill, select, check, uncheck, hover and keypress. Refresh the observation after a stale reference.browser_listdiscovers popups.Call
browser_handofffor sign-in or visual controls. The agent’s page operations stop while the user has control. After the user selects Done, checkbrowser_listand read the page again. Handoff requires a graphical desktop available to the server process.Call
browser_closewhen finished. Disconnecting the MCP client also closes its sessions.
For example, if the open result identifies session s1, page p1, revision 3 and a button with reference [e4], the click arguments are:
{"session":"s1","page":"p1","revision":3,"ref":"e4","action":"click"}On the 500-order unit fixture, a bounded initial read followed by the submit result used 1,850 tokens of tool-response text. Returning the entire page both times used 11,062. The post-submit change alone used 29 tokens. These measurements use the o200k_base tokenizer and exclude client prompts and tool definitions.
The agent interface returns text. Images, canvas drawings, protected media and custom controls can lack accessible content. Human handoff is available for these cases. An oversized viewport and incremental scrolling expose more content, subject to what the site renders.
Saved sessions and copying cookies
Open with "profile": "daily" to persist cookies (including session cookies), local storage and supported IndexedDB data. Open the same name later to restore the checkpoint. A profile admits a single writer across clients. Profiles checkpoint after opening, navigation, successful actions, completed handoff, explicit browser_save and graceful close. Data created after the last checkpoint can be lost on a forced termination.
{"source":"s1","destination":"s2","sites":["https://app.example.com"]}Pass these fields to browser_copy_cookies to merge matching cookies into a second open session. The result reports counts. Site selection respects cookie domain, secure transport and partition scope; include the partition’s top-level site when needed. Matching cookie keys replace previous values. Some sites bind sign-ins to a device, engine or other storage.
To seed a fresh session with both cookies and selected origins’ local storage and IndexedDB, pass copyFrom to browser_open:
{"engine":"desktop","copyFrom":{"session":"s1","sites":["https://app.example.com"],"includeStorage":true}}Session IDs are local to one server connection. To move between MCP clients, close a named profile and reopen it from the other client. The server only manages sessions that it created.
Profile checkpoints contain authentication secrets. They live in the OS user data directory (~/Library/Application Support/browser-mcp on macOS, %LOCALAPPDATA%\browser-mcp on Windows, and $XDG_DATA_HOME/browser-mcp or ~/.local/share/browser-mcp on Linux). Keep this directory private to your OS account. BROWSER_MCP_DATA_DIR overrides the location. Explicit transfer returns counts; cookie values stay inside the browser service.
Troubleshooting
Symptom | What to do |
The server reports that it cannot reach the desktop session | The client runs in a sandbox without access to your graphical login. Run |
The handoff window does not appear | Start the client, or the desktop host, from your graphical login session. On Omarchy the process needs |
| The user has control. Choose Done or close the handoff window first |
An action reports a stale reference | The page changed. Read it again and use the new revision |
An engine fails to start | Install it: |
A named profile is busy | Another client has it open. A profile admits one writer at a time |
Development
npm ci
npm test
npm pack --dry-runThe default tests exercise the MCP protocol, profile locking, semantic observations, stale references and handoff ownership without launching browsers. npm run test:native is a separate desktop acceptance suite. It opens a local fixture and briefly activates a window to test focus and sign-in. It runs suites sequentially and stops at the first failure. Install the desktop runtime and Playwright Chromium before selecting this suite.
Run node dist/cli.js check-desktop to check desktop visibility without starting a browser. The native suite runs this check first. On macOS, the server checks for a visible login session before launching a browser from a known Codex Seatbelt sandbox. When that check fails, it returns a diagnostic before starting the application. After a fatal native startup error the server pauses further launches for that MCP process.
On macOS, run ./test/Verify\ on\ macOS.command from the project directory in Terminal, or double-click the file in Finder. It tests the desktop runtime, installed Chrome and Edge, and Playwright Chromium and WebKit. It also exercises human handoff with Chrome and WebKit. The run saves a private log under test-results/. Install all five runtimes before running this matrix.
For a custom native run, BROWSER_MCP_TEST_ENGINES and BROWSER_MCP_TEST_ENGINE_HANDOFF accept comma-separated engine names for the browser and human-window tests. BROWSER_MCP_TEST_ENGINE selects the additional engine for the stdio session test, which always covers the desktop adapter. The Windows GitHub Copilot GUI and Omarchy compositor require verification on their respective desktops.
Licensed under MIT. Dependency and browser distribution notices are listed in NOTICE.md.
Available Tools
10 toolsbrowser_actC
Act on a reference from the indicated observation and return the change. Use handoff for passwords and other secrets.
Inputs: ref (required), page (required), action (required), session (required), +2 more.
browser_closeC
Close a browser session, saving its named profile and releasing its resources.
Inputs: session (required).
browser_copy_cookiesB
Copy matching cookies, including session cookies, between two managed sessions. sites must be explicit HTTP(S) origins. Returns counts.
Inputs: sites (required), source (required), destination (required).
browser_handoffA
Give the user control of this live page in a normal-size desktop window. Agent page operations pause until the user chooses Done.
Inputs: page (required), session (required).
browser_listB
List sessions, page IDs (including popups) and current control owner.
Inputs: no named parameters.
browser_openB
Open an isolated background browser. desktop supports native takeover. A named profile persists cookies and site storage. copyFrom optionally seeds a fresh session from selected sites.
Inputs: url, width, engine, height, +2 more.
browser_readA
Read the page as compact actionable text. Search by query or scope to a ref. Set scanSteps with a query to advance through lazy or virtual content until a match or limit. Use the revision and offset to continue a bounded result.
Inputs: page (required), session (required), ref, query, +4 more.
browser_saveA
Checkpoint a named profile now. Normal actions, handoff completion and close also checkpoint it.
Inputs: session (required).
browser_scrollB
Reveal more content in the document or a nested scroll container. Use a nearby element ref to target the container.
Inputs: page (required), session (required), direction (required), ref, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
Most tools have clearly distinct roles: session lifecycle, navigation, reading, acting, scrolling, handoff, cookie copying, and checkpointing. There is minor overlap between browser_read and browser_scroll for revealing content, and between browser_save and the automatic checkpointing on browser_close, but descriptions clarify the boundaries.
All tools use the same browser_ prefix with snake_case verbs, producing a predictable and consistent naming pattern throughout the set.
Ten tools is well-scoped for a browser automation server. Each tool covers a meaningful lifecycle or interaction capability without obvious redundancy.
The surface covers session management, navigation, reading, acting, scrolling, handoff, cookie transfer, and profile checkpointing/close. Minor gaps remain around explicit tab/page switching, screenshots or visual inspection, and waiting/synchronization helpers, but core browser workflows are covered.
Maintenance
Related MCP Connectors
Connect your agents to any website. The cheaper, faster and more reliable alternative to browser use
Undetectable cloud browser sessions for AI agents and scrapers. Navigate, extract, click, captcha.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Launch, inspect, control, and share isolated cloud browsers for your agents.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables agents to reuse a human-completed Chrome login session to open confirmed origins, read visible page text, and perform single click, fill, or key press actions without ever handling passwords or exposing cookies.6MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI agents and human operators to drive isolated browser profiles with persistent cookies, fingerprints, and proxies, exposing navigation, clicking, typing, extraction, screenshots, JS evaluation, tabs, cookies, and waits to MCP clients.-
- AlicenseNot gradedqualityBmaintenanceEnables any agent to drive a dedicated Chromium instance through MCP, including opening and reading pages, taking steps, logging in via a password vault, downloading/uploading files, and replaying saved routines. It also gates sensitive actions behind approvals and can use client certificates or one-time card data for official procedures.MIT
- AlicenseNot gradedqualityBmaintenanceEnables browser automation through a headless browser page, letting agents navigate to URLs, click, hover, fill and select form elements, capture screenshots, and evaluate JavaScript in the page.63 npmMIT