Chrome Debug Protocolのロゴ

Chrome Debug Protocol

コミュニティ
Rainmen-xia

MCP Server for Chrome browser automation via debugging protocol

公開者Rainmen-xia
リポジトリchrome-debug-mcp
言語JavaScript
フォーク
1
スター
10
利用可能なツール
10
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Chrome Debug Protocolは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 10個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには10件のスターと1件のフォークがあります。

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.

インストール

TypingMind
前提条件:

Node.js 18+

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

利用可能なツール

  • 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を複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Chrome Debug Protocolに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Chrome Debug Protocolをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Chrome Debug ProtocolのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "chrome-debug-protocol": {
      "command": "npx",
      "args": [
        "-y",
        "chrome-debug-mcp"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてChrome Debug ProtocolのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Chrome Debug ProtocolのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Chrome Debug Protocolを使ってこのタスクを手伝ってもらえますか?
Chrome Debug Protocol
はい、読みました。
Chrome Debug Protocolで調べた結果をお伝えします。

よくある質問

Chrome Debug Protocol MCPサーバーは何に使いますか?

Chrome Debug Protocolは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでChrome Debug Protocol MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでChrome Debug Protocolを利用できます。

TypingMindでChrome Debug Protocol MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Chrome Debug Protocolを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Chrome Debug Protocol MCPをTypingMindに接続するにはどうすればよいですか?

Chrome Debug ProtocolはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでChrome Debug Protocol MCPのどのようなツールを利用できますか?

Chrome Debug Protocolは10個のMCPツールを提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Chrome Debug Protocol MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Chrome Debug Protocolで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇