chrome-mcp
You can automate a real Chromium browser via MCP, with tools for navigation, JavaScript execution, CDP commands, DrissionPage Python scripting, network capture, and documentation.
Navigate to URLs in the current tab or open/switch to a new tab (with timeout and background options).
Execute JavaScript in the current tab, including a
dom_treepreset for DOM structure output.Send raw Chrome DevTools Protocol (CDP) commands to the current tab;
Target.createTarget/activateTargetauto-switch the active tab.Run arbitrary DrissionPage Python code in-process with injected
page,browser,context,switch_tab(),tabs(),relaunch(), enabling loops, waits, and multi-tab orchestration.Capture network traffic:
start/get/stop, with HTTP method and URL keyword filters; overview inline, full bodies saved to JSON.Retrieve a built-in manual covering locator syntax, CDP recipes, capture workflow, and launch options.
Close the browser instance.
(Per README) Manage browser instances with
get_browser(ensure ready, attach via CDP, relaunch with options) and customize launch via CLI args like--headless,--proxy,--user-data.
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., "@chrome-mcp Open https://example.com and return the page title"
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.
chrome-mcp
A Model Context Protocol server for browser automation, powered by DrissionPage.
Lets MCP clients (Claude Desktop, Claude Code, Cursor, etc.) drive a real Chromium browser through a minimal 8-tool surface — all sharing one "current tab" pointer.
Why
Zero learning curve for agents. Facade tools (
execute_js,run_cdp,navigate,capture) speak only universal knowledge — JavaScript, the CDP protocol, URLs. No niche-library syntax required for the 90% cases.Full power underneath.
run_drission_codeis the complete-capability base: execute DrissionPage Python code in-process withpage/browser/context(persistent dict) /switch_tab()/tabs()/relaunch()injected — loops, waits, multi-tab orchestration, anything one tool call can't express.One pointer, always in sync. Switch tabs via DrissionPage code or
Target.createTarget/Target.activateTargetCDP commands — every tool follows. (Call tools serially per session; the shared pointer is not concurrency-safe.)Multi-instance safe. Per-process isolation (atomic port allocation via
socket.bind+ PID/UUID private user-data dirs) — spawn N servers, zero conflicts.Self-documenting.
get_manualreturns a compact built-in cheat sheet (DrissionPage locator syntax, error-prone CDP recipes, capture workflow, launch options) — agents fetch it on demand, zero token cost otherwise.
Related MCP server: Browser MCP
Installation
uv tool install chrome-mcp
# or
uvx chrome-mcp
# or
pip install chrome-mcpRequires Python ≥ 3.10 and a local Chromium-based browser.
Usage
Add to your MCP client config (e.g. claude_desktop_config.json). Two equivalent forms:
{
"mcpServers": {
"chrome": {
"command": "chrome-mcp"
}
}
}Or run on the fly with uvx (no install needed):
{
"mcpServers": {
"chrome": {
"command": "uvx",
"args": ["chrome-mcp"]
}
}
}A typical agent flow:
navigate("https://httpbin.org/get") → returns tab list
execute_js("return document.body.innerText") → page data as JSON
capture(action="start", url_filter="api/")
... trigger requests ...
capture(action="get") → overview inline,
full bodies in $TMPDIR/chrome-mcp-captures/*.jsonTools
Tool | Description |
| Navigate in current tab, or open a new tab ( |
| Run JavaScript in the current tab (must |
| Raw CDP passthrough to the current tab. |
| Full-capability base: execute DrissionPage Python code with injected |
| Network capture in one tool: |
| Return the built-in authoring manual (locator syntax, CDP recipes, capture workflow, launch options) |
| Instance management: no args = ensure an instance is ready (starts one if absent); |
| Close the browser instance |
Launch options
Customize browser startup via command-line args:
{
"mcpServers": {
"chrome": {
"command": "chrome-mcp",
"args": ["--headless", "--proxy", "http://127.0.0.1:7890", "--arg", "--lang=zh-CN"]
}
}
}Arg | Description |
| Run browser headless |
| Proxy server |
| Custom User-Agent |
| User data dir to reuse login state. ⚠️ Conflicts if your system Chrome is using the same profile |
| Path to a specific browser binary |
| Incognito mode |
| Don't load images. ⚠️ May be ignored by recent Chrome versions — reliable alternative: |
| Pass through any Chrome flag (repeatable) |
Options can also be changed mid-session (destructive, restarts the browser) from inside run_drission_code:
return relaunch(headless=True, user_agent="Mozilla/5.0 ...")The get_browser tool exposes the same options (plus cdp) at the tool level — e.g. get_browser(cdp="127.0.0.1:9222") takes over your logged-in browser; get_browser(user_data=...) rebuilds with a given profile.
Testing
8 scenario suites run against the real MCP stdio protocol (each spawns an independent server + headless browser — itself a multi-instance concurrency test):
uv run python tests/run_all.py # full regression
uv run python tests/run_all.py --only smoke,cCovers: data extraction (DOM tree/pagination/iframes), form interaction (DP actions + CDP input sequences), network capture (filters/timing traps/body fidelity), multi-tab pointer consistency, CDP capabilities (screenshots/emulation/cookies), lifecycle (relaunch/kill-recovery), and real-site scenarios (httpbin/TLS).
License
Available Tools
7 toolscaptureA
网络抓包三合一。action='start':在当前 tab 启动监听(⚠️ 必须在触发请求之前调用;监听挂载在该 tab,不随指针迁移);action='get':拉取结果(概览直接返回,完整数据落盘 JSON 供 read);action='stop':停止并清空。
Inputs: action (required), limit, method, url_filter.
close_browserC
关闭浏览器实例
Inputs: no named parameters.
execute_jsA
在当前 tab 执行 JavaScript 代码。⚠️ 必须使用 return 语句返回结果。preset='dom_tree' 时 code 改为传 JSON 参数对象 {"max_depth":5,"include_text":true,"max_text_length":50,"selector":null},直接输出 DOM 结构树。
Inputs: code (required), preset, timeout.
get_manualB
返回内置编写手册:定位语法、元素动作、等待、tab 管理、抓包、CDP 高频配方、启动定制等速查。
Inputs: no named parameters.
run_cdpA
对当前 tab 透传 Chrome DevTools Protocol 命令。method 如 'Page.captureScreenshot',params 为参数对象。命令始终作用于当前 tab,无需 attachToTarget(Target.createTarget/activateTarget 会自动切换操作 tab)。详见 get_manual。
Inputs: method (required), params.
run_drission_codeB
执行 DrissionPage Python 代码(server 进程内,完整能力底座)。预置变量:page=当前tab、browser=浏览器对象、context=跨调用持久字典、DOM_TREE_JS=DOM树JS模板。预置函数:switch_tab(tab_id)、tabs()、relaunch(**opts)。⚠️ 必须用 return 返回结果。
Inputs: code (required), timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
run_cdp, execute_js, and run_drission_code all provide code/protocol execution on the current tab, creating overlap that could confuse an agent. get_manual and close_browser are distinct, but the three execution tools lack clear boundary guidance.
Mostly consistent snake_case verb_noun style (run_cdp, get_manual, close_browser, run_drission_code, execute_js), with 'capture' and 'navigate' as minor single-verb exceptions.
Seven tools are well-scoped for a Chrome automation server, covering navigation, JS execution, CDP, network capture, manual lookup, and browser lifecycle without bloat.
Covers the core lifecycle: launch/close, navigate/tabs, JS/CDP execution, network capture, and a manual. Minor gaps exist around explicit tab management (though navigate and run_drission_code provide switch_tab/tabs), and no dedicated element-click/type tools, but coverage is strong for the stated purpose.
Maintenance
Related MCP Connectors
Unofficial Browserless MCP — wraps the Browserless headless-Chromium REST API (browserless.io)
Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.
Official Browserless MCP server: browser automation, scraping, screenshots and PDFs for AI agents.
Browser automation MCP for whole web tasks in a cloud browser: saved logins, bot checks, replays.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to drive a real, logged-in Chrome browser for web automation tasks like navigation, clicking, typing, and screenshotting.MIT
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to control a real local browser window for web automation tasks such as clicking, typing, scrolling, and taking screenshots.55 npm-
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to control Chrome/Edge browsers via CDP, including page navigation, element interaction, snapshots, network debugging, script execution, and performance tracing.AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to control an already logged-in Chromium-based browser over CDP, including listing and opening tabs, navigating, taking text snapshots, clicking, typing, pressing keys, and executing JavaScript.MIT