chrome debug mcp

Local 2025-08-31 23:46:56 0

Controls Chrome browser with debugging capabilities, allowing page automation, extension management, and userscript injection through the Model Context Protocol.


x000D A Model Context Protocol (MCP) implementation for browser automation using Playwright, with full Greasemonkey API support.x000D x000D x000D x000D x000D Chrome Debug Server MCP serverx000D x000D x000D x000D x000D x000D

Features_x000D_

x000D

Core Browser Features_x000D_

  • Browser launch and management_x000D_
  • Multi-tab support with create/switch/close capabilities_x000D_
  • Page navigation and interaction_x000D_
  • Screenshot capture_x000D_ x000D

Greasemonkey API Support_x000D_

  • GM_addStyle for CSS injection_x000D_
  • GM_getValue/GM_setValue for data storage_x000D_
  • GM_deleteValue for storage cleanup_x000D_
  • GM_notification for desktop notifications_x000D_
  • GM_setClipboard for clipboard operations_x000D_
  • GM_xmlhttpRequest for cross-origin requests_x000D_ x000D

Resource Management_x000D_

  • Network request interception_x000D_
  • Request blocking, modification, and logging_x000D_
  • Resource type filtering_x000D_ x000D

Debug Features_x000D_

  • Detailed logging system_x000D_
  • Log file organization_x000D_
  • Clean interface output_x000D_ x000D

Installation_x000D_

x000D bash_x000D_ npm install chrome-debug-mcp-playwright_x000D_x000D x000D

Quick Start_x000D_

x000D javascript_x000D_ // Launch browser_x000D_ tool browser launch_browser --url "https://example.com" --browserType "chromium"_x000D_ _x000D_ // Use GM functions_x000D_ tool browser gm_setValue --key "setting" --value "test"_x000D_ tool browser gm_getValue --key "setting"_x000D_ _x000D_ // Intercept requests_x000D_ tool browser intercept_requests --patterns ["*.jpg", "*.css"] --action "block"_x000D_x000D x000D

Documentation_x000D_

  • Commands - Detailed command documentation with examples_x000D_
  • Full command list with usage examples available in COMMANDS.md_x000D_ x000D

Core Features_x000D_

x000D

Browser Management_x000D_

javascript_x000D_ // Launch browser_x000D_ tool browser launch_browser --url "https://example.com"_x000D_ _x000D_ // Create new tab_x000D_ tool browser create_tab --url "https://example.com"_x000D_ _x000D_ // Switch between tabs_x000D_ tool browser switch_tab --index 1_x000D_x000D x000D

Greasemonkey API_x000D_

javascript_x000D_ // Add custom styles_x000D_ tool browser gm_addStyle --css "body { background: #f0f0f0; }"_x000D_ _x000D_ // Store data_x000D_ tool browser gm_setValue --key "setting" --value "test"_x000D_ _x000D_ // Make cross-origin requests_x000D_ tool browser gm_xmlhttpRequest --url "https://api.example.com/data" --method "GET"_x000D_x000D x000D

Resource Interception_x000D_

javascript_x000D_ // Block image loading_x000D_ tool browser intercept_requests --patterns ["*.jpg", "*.png"] --action "block"_x000D_ _x000D_ // Log all CSS requests_x000D_ tool browser intercept_requests --patterns ["*.css"] --action "log"_x000D_x000D x000D

Implementation Details_x000D_

x000D

Logging System_x000D_

  • All debug output redirected to log files_x000D_
  • Timestamped entries_x000D_
  • Organized in logs directory_x000D_
  • Clean interface output_x000D_ x000D

Error Handling_x000D_

  • Detailed error logging_x000D_
  • Proper cleanup on errors_x000D_
  • Resource management_x000D_ x000D

Dependencies_x000D_

  • Playwright: Browser automation_x000D_
  • @modelcontextprotocol/sdk: MCP implementation_x000D_ x000D

Development_x000D_

x000D

Prerequisites_x000D_

  • Node.js 16 or higher_x000D_
  • npm 7 or higher_x000D_ x000D

Setup_x000D_

bash_x000D_ git clone https://github.com/yourusername/chrome-debug-mcp-playwright.git_x000D_ cd chrome-debug-mcp-playwright_x000D_ npm install_x000D_x000D x000D

License_x000D_

x000D MIT License - See LICENSE file for details.x000D x000D

Contributing_x000D_

x000D We welcome contributions! Please see our Contributing Guide for details.x000D x000D

Acknowledgments_x000D_

x000D Based on the original chrome-debug-mcp by Robert Headley.x000D =======x000D =======x000D

parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D

Chrome Debug MCP Server_x000D_

x000D A Model Context Protocol (MCP) server for controlling Chrome with debugging capabilities, userscript injection, and extension support.x000D x000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ =======x000D =======x000D

parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D x000D Chrome Debug Server MCP serverx000D x000D x000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D

Features_x000D_

x000D

Chrome Control_x000D_

  • Launch Chrome with custom configurations_x000D_
  • Support for custom Chrome executable paths_x000D_
  • User profile management (default or custom user data directory)x000D
  • Extension support and management_x000D_
  • Disable Chrome's "Automation Controlled" banner_x000D_ x000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ =======x000D =======x000D

    parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D

Page Automation_x000D_

  • Click, type, and interact with page elements_x000D_
  • Handle dropdowns and form inputs_x000D_
  • Hover and wait for elements_x000D_
  • Take screenshots of full page or elements_x000D_
  • Navigate between pages_x000D_
  • Set viewport size and device emulation_x000D_
  • Extract text and attributes from elements_x000D_ x000D

Tab Management_x000D_

  • List all open tabs with their IDs and URLs_x000D_
  • Open new tabs with specified URLs_x000D_
  • Close tabs by ID_x000D_
  • Switch between tabs_x000D_
  • Track and manage multiple tab states_x000D_ x000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_

    parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D

Debugging Capabilities_x000D_

  • Remote debugging via Chrome DevTools Protocol (CDP)x000D
  • Console log capture and monitoring_x000D_
  • JavaScript evaluation in page context_x000D_
  • Real-time console output streaming_x000D_ x000D

Userscript Support_x000D_

  • Inject userscripts into web pages_x000D_
  • Greasemonkey-style API support:x000D
  • GM_setValue/GM_getValue for persistent storage_x000D_
  • GM_addStyle for CSS injection_x000D_
  • GM_xmlhttpRequest for cross-origin requests_x000D_
  • GM_openInTab for new tab creation_x000D_
  • GM_registerMenuCommand for menu commands_x000D_ x000D

Extension Integration_x000D_

  • Load unpacked extensions_x000D_
  • Maintain extension states and configurations_x000D_
  • Support for default Chrome profile extensions_x000D_
  • Selective extension enabling/disabling_x000D_ x000D

Installation_x000D_

x000D

Prerequisites_x000D_

Installing Roo Code Extension_x000D_

  1. Open Visual Studio Code_x000D_
  2. Go to Extensions (Ctrl+Shift+X)x000D
  3. Search for "Roo Code"x000D
  4. Click Install_x000D_ x000D

Setting up Chrome Debug MCP Server_x000D_

  1. Clone this repository:x000D bash_x000D_ git clone https://github.com/yourusername/chrome-debug-mcp.git_x000D_ cd chrome-debug-mcp_x000D_x000D x000D
  2. Install dependencies:x000D bash_x000D_ npm install_x000D_x000D x000D
  3. Build the project:x000D bash_x000D_ npm run build_x000D_x000D x000D
  4. Configure in Roo Code:x000D Add to cline_mcp_settings.json:x000D json_x000D_ {_x000D_ "mcpServers": {_x000D_ "chrome-debug": {_x000D_ "command": "node",_x000D_ "args": ["path/to/chrome-debug-mcp/build/index.js"],_x000D_ "disabled": false,_x000D_ "alwaysAllow": []_x000D_ }_x000D_ }_x000D_ }_x000D_x000D x000D

Usage_x000D_

x000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ =======x000D For a complete reference of all available commands, tools, and functions, see COMMANDS.md.x000D x000D

parent of 64acbb3 (Add files via upload)x000D =======x000D For a complete reference of all available commands, tools, and functions, see COMMANDS.md.x000D x000D parent of 64acbb3 (Add files via upload)x000D =======x000D For a complete reference of all available commands, tools, and functions, see COMMANDS.md.x000D x000D parent of 64acbb3 (Add files via upload)x000D =======x000D For a complete reference of all available commands, tools, and functions, see COMMANDS.md.x000D x000D parent of 64acbb3 (Add files via upload)x000D =======x000D For a complete reference of all available commands, tools, and functions, see COMMANDS.md.x000D x000D parent of 64acbb3 (Add files via upload)x000D =======x000D For a complete reference of all available commands, tools, and functions, see COMMANDS.md.x000D x000D parent of 64acbb3 (Add files via upload)x000D =======x000D For a complete reference of all available commands, tools, and functions, see COMMANDS.md.x000D x000D parent of 64acbb3 (Add files via upload)x000D

Basic Chrome Launch_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "launch_chrome",_x000D_ arguments: {_x000D_ executablePath: "C:Program FilesGoogleChromeApplicationchrome.exe",_x000D_ url: "https://example.com"_x000D_ }_x000D_ })_x000D_x000D x000D

Launch with Custom Profile_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "launch_chrome",_x000D_ arguments: {_x000D_ executablePath: "C:Program FilesGoogleChromeApplicationchrome.exe",_x000D_ userDataDir: "path/to/chrome/profile",_x000D_ disableAutomationControlled: true_x000D_ }_x000D_ })_x000D_x000D x000D

Inject Userscript_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "launch_chrome",_x000D_ arguments: {_x000D_ url: "https://example.com",_x000D_ userscriptPath: "path/to/userscript.js"_x000D_ }_x000D_ })_x000D_x000D x000D

Evaluate JavaScript_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "evaluate",_x000D_ arguments: {_x000D_ expression: "document.title"_x000D_ }_x000D_ })_x000D_x000D x000D

Get Console Logs_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "get_console_logs",_x000D_ arguments: {_x000D_ clear: true_x000D_ }_x000D_ })_x000D_x000D x000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ =======x000D =======x000D

parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D

Page Interaction Examples_x000D_

x000D

Click an Element_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "click",_x000D_ arguments: {_x000D_ selector: "#submit-button",_x000D_ delay: 500_x000D_ }_x000D_ })_x000D_x000D x000D

Type into Input_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "type",_x000D_ arguments: {_x000D_ selector: "#search-input",_x000D_ text: "search query",_x000D_ delay: 100_x000D_ }_x000D_ })_x000D_x000D x000D

Select from Dropdown_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "select",_x000D_ arguments: {_x000D_ selector: "#country-select",_x000D_ value: "US"_x000D_ }_x000D_ })_x000D_x000D x000D

Wait for Element_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "wait_for_selector",_x000D_ arguments: {_x000D_ selector: ".loading-complete",_x000D_ visible: true,_x000D_ timeout: 5000_x000D_ }_x000D_ })_x000D_x000D x000D

Take Screenshot_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "screenshot",_x000D_ arguments: {_x000D_ path: "screenshot.png",_x000D_ fullPage: true_x000D_ }_x000D_ })_x000D_x000D x000D

Set Viewport Size_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "set_viewport",_x000D_ arguments: {_x000D_ width: 1920,_x000D_ height: 1080,_x000D_ deviceScaleFactor: 1_x000D_ }_x000D_ })_x000D_x000D x000D

Tab Management Examples_x000D_

x000D

List All Tabs_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "list_tabs",_x000D_ arguments: {}_x000D_ })_x000D_x000D x000D

Open New Tab_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "new_tab",_x000D_ arguments: {_x000D_ url: "https://example.com"_x000D_ }_x000D_ })_x000D_x000D x000D

Switch to Tab_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "switch_tab",_x000D_ arguments: {_x000D_ tabId: "tab-id-from-list-tabs"_x000D_ }_x000D_ })_x000D_x000D x000D

Close Tab_x000D_

javascript_x000D_ use_mcp_tool({_x000D_ server_name: "chrome-debug",_x000D_ tool_name: "close_tab",_x000D_ arguments: {_x000D_ tabId: "tab-id-from-list-tabs"_x000D_ }_x000D_ })_x000D_x000D x000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_

parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D =======x000D parent of 64acbb3 (Add files via upload)x000D

Dependencies_x000D_

x000D This project uses the following open-source packages:x000D x000D - Puppeteer - Chrome automation library_x000D_ - chrome-remote-interface - Chrome DevTools Protocol client_x000D_ - @modelcontextprotocol/sdk - MCP SDK for server implementation_x000D_ x000D

License_x000D_

x000D This project is licensed under the MIT License - see the LICENSE file for details.x000D x000D

Contributing_x000D_

x000D See our Contributing Guide for details on making contributions.x000D x000D

Acknowledgments_x000D_

x000D - Chrome DevTools Protocolx000D - Greasemonkey APIx000D <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ <<<<<<< HEAD_x000D_ - Model Context Protocolx000D

parent of 8a57443 (Merge pull request #4 from robertheadley/feature/puppeteer-commands)x000D =======x000D - Model Context Protocolx000D parent of 64acbb3 (Add files via upload)x000D =======x000D - Model Context Protocolx000D parent of 64acbb3 (Add files via upload)x000D =======x000D - Model Context Protocolx000D parent of 64acbb3 (Add files via upload)x000D =======x000D - Model Context Protocolx000D parent of 64acbb3 (Add files via upload)x000D =======x000D - Model Context Protocolx000D parent of 64acbb3 (Add files via upload)x000D =======x000D - Model Context Protocolx000D parent of 64acbb3 (Add files via upload)x000D =======x000D - Model Context Protocolx000D parent of 64acbb3 (Add files via upload)x000D