browser-for-claude
Gives Claude control of a real, headed Chromium browser via Playwright, enabling web navigation, clicking, typing, screenshots, and JavaScript evaluation.
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_evaluateruns arbitrary JavaScript in the page with no sandboxing beyond what the browser itself provides.
License
No license specified.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。