browser-for-claude

browser-for-claude

Gives Claude control of a real, headed Chromium browser via Playwright, enabling web navigation, clicking, typing, screenshots, and JavaScript evaluation.

Category
Visit Server

README

<p align="center"> <img src="assets/banner.png" alt="browser-for-claude banner" width="100%"> </p>

<h1 align="center"> <img src="assets/logo.png" alt="browser-for-claude logo" width="32" valign="middle"> browser-for-claude </h1>

An MCP server that gives Claude control of a real, headed Chromium browser via Playwright. It exposes a small set of tools — navigate, click, type, read text, screenshot, run JS, get URL, close — so Claude can drive a live browser session instead of just reading static content.

Features

  • Isolated from your real browser — Claude never touches your everyday Chrome. See Privacy & Isolation below.
  • Headed Chromium — the browser window is visible, not run in the background, so you can watch what Claude does in real time.
  • Persistent session — the same browser/page stays open across tool calls until explicitly closed, so multi-step flows (navigate → click → type → screenshot) act on one continuous session.
  • Minimal surface — eight tools, each a thin wrapper over one Playwright action.

Privacy & Isolation

This is not your everyday Chrome — it's a completely separate, throwaway browser instance:

  • Different binary. Playwright launches its own bundled Chromium (installed via npx playwright install chromium), not the Chrome app on your machine.
  • No shared profile. Each session starts from browser.newContext() — a brand-new, blank browsing context. It does not read your Chrome profile directory, so there's no access to your bookmarks, saved passwords, browsing history, extensions, or cookies.
  • No Google account. Because the context starts blank, any site you're logged into in your real browser (Google, GitHub, etc.) shows up logged out here — Claude has no way to see or use your existing sessions.
  • Nothing persists across restarts. browser_close (or the process exiting) discards the context entirely; nothing is written back to disk for next time.

In short: Claude can look at and click around a real, live web page, but it's working in its own sandboxed browser with a clean slate — never your personal one.

Tools

Tool Description
browser_navigate Navigate the headed Chromium window to a URL
browser_click Click an element matching a CSS selector
browser_type Fill a text input matching a CSS selector
browser_get_text Read the text content of an element matching a CSS selector
browser_screenshot Capture a PNG screenshot of the current page
browser_evaluate Evaluate a JavaScript expression in the page context and return the result
browser_get_url Return the current page URL
browser_close Close the Chromium window and end the session

Requirements

  • Node.js 20+
  • npm

Setup

npm install
npx playwright install chromium
npm run build

Usage

Standalone

npm start

This starts the MCP server on stdio (dist/server.js). It's meant to be launched by an MCP client, not run interactively on its own.

With Claude Code

Add it as an MCP server, e.g. via a .mcp.json in your project:

{
  "mcpServers": {
    "browser-for-claude": {
      "command": "node",
      "args": ["dist/server.js"]
    }
  }
}

Claude Code will then discover the browser_* tools automatically.

Development

npm run build       # compile TypeScript (src -> dist)
npm run smoke-test   # launch a real browser and exercise every tool against example.com

The smoke test (test/smoke-test.ts) is an end-to-end check: it navigates to a real page, reads text, evaluates JS, takes a screenshot, and confirms that clicking a missing selector throws — all against a live Chromium instance rather than mocks.

Project structure

src/
  server.ts             MCP server: registers the browser_* tools
  browserController.ts  Playwright session management (launch/navigate/click/type/...)
test/
  smoke-test.ts         End-to-end smoke test against example.com

How it works

browserController.ts lazily launches a single headed Chromium browser, context, and page on first use, and keeps reusing them across tool calls until browser_close is called. A launch guard (launchInFlight) ensures concurrent tool calls can't race into launching two separate browser instances.

Caveats

  • Only one browser session is supported at a time (no multi-tab/multi-context support).
  • The isolation described above (see Privacy & Isolation) cuts both ways: if a task genuinely needs an already-logged-in site, you'll need to log in manually within the session first — there's no way to reuse credentials from your regular browser.
  • Intended for local/trusted use — browser_evaluate runs arbitrary JavaScript in the page with no sandboxing beyond what the browser itself provides.

License

No license specified.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured