Logo vun Chrome Debug Protocol

Chrome Debug Protocol

Communautéit
Rainmen-xia

MCP Server for Chrome browser automation via debugging protocol

EditeurRainmen-xia
Repositorychrome-debug-mcp
SproochJavaScript
Forks
1
Stären
10
Disponibel Tools
10
Transporttypstdio
Kategorien
LizenzMIT
Linken
  • Tools mat KI-Workflows verbannen

    Chrome Debug Protocol stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 10 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    10 Stären an 1 Forks aus dem verlinkte Repository.

Chrome Debug MCP Server

Language: English | 中文

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.

🎯 Project Advantages

🚀 Core Technical Advantages

  1. 🔧 Zero-Dependency Deployment

    • No Chrome extensions required
    • No Chrome Web Store approval needed
    • Fully autonomous in enterprise environments
  2. 📦 Container-Friendly

    • Perfect support for Docker/Kubernetes deployment
    • No extension permission or installation issues
    • Ideal for cloud-native architecture
  3. ⚡ Two-Step Launch

    bash
    # 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
  4. 🛡️ Enterprise-Grade Security

    • Based on standard Chrome DevTools Protocol
    • No third-party extension permissions required
    • Complete local operation

🚀 Quick Start

Option 1: Direct Usage (Recommended)

Launch with npx - no installation required:

bash
# 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

Option 2: Local Development

bash
git clone https://github.com/rainmenxia/chrome-debug-mcp.git
cd chrome-debug-mcp
npm install
npm run build
npm start

Core Features

  • ✅ Chrome Debug Port Connection: Based on standard Chrome DevTools Protocol, no extensions required
  • 🏢 Enterprise-Grade Deployment: Zero-dependency deployment, no Chrome Web Store approval needed
  • 📱 Intelligent Tab Management: Reuse tabs for same domains, avoid duplicate openings
  • 🖼️ Real-time Screenshot Feedback: Automatic screenshots after each operation for visual feedback
  • 🌐 Network Activity Monitoring: Auto-wait for page load completion
  • 🐳 Native Docker Support: Perfect support for containerized Chrome instances, no extension limitations
  • ⚡ Two-Step Launch: Start Chrome in debug mode then run npx chrome-debug-mcp, no complex installation required
  • 🔍 Smart Browser Discovery: Auto-discover Chrome instances in local and Docker environments

Configuration & Usage

1. Start Chrome Debug Mode (Required)

The server needs to connect to a Chrome instance with debugging port enabled:

bash
# 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 mode
  • After startup, you can log into websites normally, and login sessions will be preserved
  • The server will reuse this Chrome instance, no need to re-login

2. Configure MCP Client

Add the following configuration to your MCP client:

json
{
  "mcpServers": {
    "browser-automation": {
      "command": "npx",
      "args": ["chrome-debug-mcp"]
    }
  }
}

That's it! No installation, no downloads, no complex path configuration needed.

💡 Alternative Installation Methods:

Global Installation:

bash
npm install -g chrome-debug-mcp
json
{
  "mcpServers": {
    "browser-automation": {
      "command": "chrome-debug-mcp"
    }
  }
}

Local Project Installation:

bash
npm install chrome-debug-mcp
json
{
  "mcpServers": {
    "browser-automation": {
      "command": "npx",
      "args": ["chrome-debug-mcp"]
    }
  }
}

Available Tools

1. launch_browser

Connect to Chrome debug port and initialize browser session.

json
{
  "name": "launch_browser",
  "arguments": {
    "remote_host": "http://localhost:9222"  // optional
  }
}

2. navigate_to

Navigate to specified URL with intelligent tab management.

json
{
  "name": "navigate_to", 
  "arguments": {
    "url": "https://example.com"
  }
}

3. click

Click at specified coordinates.

json
{
  "name": "click",
  "arguments": {
    "coordinate": "100,200"
  }
}

4. type_text

Input text content.

json
{
  "name": "type_text",
  "arguments": {
    "text": "Hello World"
  }
}

5. scroll_down / scroll_up

Scroll the page.

json
{
  "name": "scroll_down",
  "arguments": {}
}

6. hover

Hover mouse at specified position.

json
{
  "name": "hover",
  "arguments": {
    "coordinate": "100,200"
  }
}

7. resize_browser

Resize browser window.

json
{
  "name": "resize_browser",
  "arguments": {
    "size": "1200,800"
  }
}

8. get_page_content

Get current page HTML content.

json
{
  "name": "get_page_content",
  "arguments": {}
}

9. close_browser

Close browser connection.

json
{
  "name": "close_browser",
  "arguments": {}
}

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

2. E-commerce Operations

bash
# Keep logged-in state for Taobao/JD
# Automate product search, price monitoring, etc.
launch_browser -> navigate_to -> type_text -> click

3. Data Scraping

bash
# Scrape data from login-required websites
# Bypass login verification, direct operations
launch_browser -> navigate_to -> get_page_content

Advanced Features

Intelligent Tab Management

  • Same domains (e.g., example.com) reuse existing tabs
  • Different domains automatically create new tabs
  • Avoid duplicate openings of same websites

Auto-wait Mechanisms

  • Monitor network activity, wait for complete page loading
  • HTML content stability detection
  • Automatic handling of dynamic content loading

Error Recovery

  • Auto-reconnect on connection drops
  • Cache successful connection endpoints
  • Detailed error logs and feedback

Docker Environment Support

If Chrome runs in a Docker container:

bash
# 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.

Troubleshooting

Chrome Connection Failed

  1. Confirm Chrome is started with --remote-debugging-port=9222
  2. Check if port 9222 is occupied: lsof -i :9222
  3. Ensure no other Chrome instances are running

Operation Timeout

  1. Check network connection
  2. Increase page load timeout
  3. Confirm target website is accessible

Screenshot Failed

  1. Confirm page is fully loaded
  2. Check browser window size settings
  3. Try refreshing page and retry operation

Technical Architecture

MCP Client ←→ stdio ←→ MCP Server ←→ Chrome Debug Port ←→ Chrome Browser
  • Transport Protocol: stdio (standard input/output)
  • Browser Engine: Puppeteer + Chrome DevTools Protocol
  • Connection Method: WebSocket (Chrome debug port)
  • Image Format: WebP/PNG base64 encoding

Development & Debugging

bash
# Watch mode compilation
npm run dev

# View MCP communication logs
DEBUG=mcp* npm start

Publishing to npm

bash
# Build project
npm run build

# Publish to npm
npm publish

Acknowledgments

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:

  • 🎯 MCP Protocol Integration: Provided technical solutions for combining MCP servers with browser automation
  • 🔗 Browser Connection: Demonstrated elegant browser connection and session management
  • 📋 Tool API Design: Provided reference frameworks for standardizing browser operations

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.

License

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.

Installatioun

TypingMind
Viraussetzungen:

Node.js 18+

{
  "mcpServers": {
    "browser-automation": {
      "command": "npx",
      "args": [
        "chrome-debug-mcp"
      ]
    }
  }
}

Disponibel Tools

  • launch_browser

    启动浏览器连接,连接到Chrome调试端口以保持登录状态

  • close_browser

    关闭浏览器连接

  • navigate_to

    导航到指定URL,智能管理标签页(相同域名复用标签页)

  • click

    在指定坐标位置点击

  • type_text

    输入文本内容

  • scroll_down

    向下滚动页面一个视口高度

  • scroll_up

    向上滚动页面一个视口高度

  • hover

    将鼠标悬停在指定坐标位置

  • resize_browser

    调整浏览器窗口大小

  • get_page_content

    获取当前页面的HTML内容

Chrome Debug Protocol MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal Chrome Debug Protocol verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

Chrome Debug Protocol als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu Chrome Debug Protocol an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "chrome-debug-protocol": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-debug-mcp"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu Chrome Debug Protocol. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu Chrome Debug Protocol.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat Chrome Debug Protocol?
Chrome Debug Protocol
Jo. Ech hunn et gelies.
Dat hunn ech mat Chrome Debug Protocol fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server Chrome Debug Protocol benotzt?

Chrome Debug Protocol ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech Chrome Debug Protocol MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir Chrome Debug Protocol mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat Chrome Debug Protocol MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann Chrome Debug Protocol verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech Chrome Debug Protocol MCP mat TypingMind?

Chrome Debug Protocol leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt Chrome Debug Protocol MCP an TypingMind zur Verfügung?

Chrome Debug Protocol stellt 10 MCP-Tools zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir Chrome Debug Protocol MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann Chrome Debug Protocol eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇