by Rainmen-xia
A Model Context Protocol (MCP) server for Chrome browser automation via debugging protocol, specifically designed to connect to Chrome debugging ports and enable browser automation with persistent login sessions.
π§ Zero-Dependency Deployment
π¦ Container-Friendly
β‘ Two-Step Launch
# Launch with just two commands # 1. Start Chrome in debug mode /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug # 2. Run MCP server npx chrome-debug-mcp
π‘οΈ Enterprise-Grade Security
Launch with npx - no installation required:
# 1. Start Chrome in debug mode /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug # 2. Run MCP server directly npx chrome-debug-mcp
git clone https://github.com/rainmenxia/chrome-debug-mcp.git cd chrome-debug-mcp npm install npm run build npm start
npx chrome-debug-mcp
, no complex installation requiredThe server needs to connect to a Chrome instance with debugging port enabled:
# macOS /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug # Windows chrome.exe --remote-debugging-port=9222 --user-data-dir=c:\temp\chrome-debug # Linux google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug
Important Notes:
--user-data-dir
parameter points to a temporary directory, ensuring Chrome starts in debug modeAdd the following configuration to your MCP client:
*Configuration content*
That's it! No installation, no downloads, no complex path configuration needed.
π‘ Alternative Installation Methods:
Global Installation:
npm install -g chrome-debug-mcp
*Configuration content*json
{
"name": "launch_browser",
"arguments": {
"remote_host": "http://localhost:9222" // optional
}
}
### 2. navigate\_to
Navigate to specified URL with intelligent tab management.
*Configuration content*
### 3. click
Click at specified coordinates.
*Configuration content*
### 4. type\_text
Input text content.
*Configuration content*
### 5. scroll\_down / scroll\_up
Scroll the page.
*Configuration content*
### 6. hover
Hover mouse at specified position.
*Configuration content*
### 7. resize\_browser
Resize browser window.
*Configuration content*
### 8. get\_page\_content
Get current page HTML content.
*Configuration content*
### 9. close\_browser
Close browser connection.
*Configuration content*
## Typical Use Cases
### 1. Social Media Automation
```bash
# Manually log into Twitter/Weibo in Chrome first
# Then use MCP tools for automation
launch_browser -> navigate_to -> click -> type_text
# Keep logged-in state for Taobao/JD # Automate product search, price monitoring, etc. launch_browser -> navigate_to -> type_text -> click
# Scrape data from login-required websites # Bypass login verification, direct operations launch_browser -> navigate_to -> get_page_content
example.com
) reuse existing tabsIf Chrome runs in a Docker container:
# Start Chrome in Docker docker run -d --name chrome-debug \ -p 9222:9222 \ --shm-size=2gb \ zenika/alpine-chrome \ --no-sandbox \ --disable-dev-shm-usage \ --remote-debugging-address=0.0.0.0 \ --remote-debugging-port=9222
The server will automatically discover Chrome instances in Docker environments.
--remote-debugging-port=9222
lsof -i :9222
MCP Client ββ stdio ββ MCP Server ββ Chrome Debug Port ββ Chrome Browser
# Watch mode compilation npm run dev # View MCP communication logs DEBUG=mcp* npm start
# Build project npm run build # Publish to npm npm publish
This project's design philosophy and core concepts were inspired by the RooCode project. RooCode is an excellent browser automation MCP server implementation that provided valuable technical references and design insights.
Special thanks to the RooCode team for their contributions in the following areas:
Building upon RooCode's foundation, this project further focuses on browser automation with persistent login sessions, achieving more practical automation capabilities by connecting to existing Chrome debug ports to maintain user sessions.
MIT License
Core Advantage: The biggest feature of this MCP server is its ability to connect to existing Chrome instances and maintain login sessions, making it ideal for automation scenarios requiring user authentication. Through Chrome debug ports, it can take over user-logged browser sessions, achieving true "session-persistent" browser automation.
No version information available