chrome-pilot

D3OXY/chrome-pilot

3.3

If you are the rightful owner of chrome-pilot and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Chrome MCP Server is a Model Context Protocol server that facilitates AI assistants like Claude to control Chrome browsers through a Chrome extension and WebSocket communication, ideal for cross-platform automation.

Tools
11
Resources
0
Prompts
0

Chrome MCP Server

A Model Context Protocol (MCP) server that enables AI assistants like Claude to control Chrome browsers through a Chrome extension and WebSocket communication. Perfect for cross-platform automation, especially WSL/Windows setups.

๐Ÿš€ Features

  • Browser Automation: Navigate, click, scroll, fill forms, take screenshots
  • Cross-Platform: Works across WSL/Windows network boundaries
  • Dual Communication: Native messaging (local) + WebSocket (network)
  • Claude Integration: Direct integration with Claude Code and Claude Desktop
  • Real-time Control: Live browser interaction through MCP tools
  • Chrome Extension: Easy-to-install browser extension with popup controls

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    WebSocket     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    MCP/stdio    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Windows   โ”‚ โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ†’  โ”‚     WSL     โ”‚ โ†โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ†’ โ”‚ Claude Code โ”‚
โ”‚   Chrome    โ”‚   ws://IP:9222   โ”‚   Server    โ”‚                 โ”‚             โ”‚
โ”‚ + Extension โ”‚                  โ”‚             โ”‚                 โ”‚             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ฆ Installation

Prerequisites

  • Node.js >= 18.0.0
  • Chrome/Chromium browser
  • TypeScript (for development)

Quick Setup

  1. Clone the repository

    git clone https://github.com/deoxy/chrome-pilot.git
    cd chrome-pilot
    
  2. Install dependencies

    cd server
    npm install
    npm run build
    
  3. Start the WebSocket server

    node dist/index.js --websocket
    
  4. Load Chrome extension

    • Open chrome://extensions/
    • Enable "Developer mode"
    • Click "Load unpacked"
    • Select the extension folder
  5. Configure extension

    • Click extension icon
    • Enter WebSocket URL: ws://YOUR_IP:9222/ws
    • Click "Save Configuration" and "Reconnect"

๐Ÿ”ง Configuration

For Claude Code (WSL)

Add to ~/.claude/settings.json:

{
  "mcpServers": {
    "chrome-pilot": {
      "command": "node",
      "args": ["/path/to/chrome-pilot/server/dist/index.js", "--websocket"],
      "env": {}
    }
  }
}

For Claude Desktop

Add to Claude Desktop settings:

{
  "mcpServers": {
    "chrome-pilot": {
      "command": "node",
      "args": ["/path/to/chrome-pilot/server/dist/index.js"]
    }
  }
}

๐Ÿ› ๏ธ Available Tools

ToolDescriptionParameters
navigateNavigate to a URLurl, tabId?
get_tabsGet all open browser tabs-
get_current_tabGet currently active tab-
close_tabClose a browser tabtabId
clickClick on an elementselector, tabId?
typeType text into an inputselector, text, tabId?
scrollScroll the pagedirection, amount?, tabId?
screenshotTake a screenshottabId?
get_contentExtract page contentselector?, tabId?
get_interactive_elementsFind clickable elementstabId?
wait_for_elementWait for element to appearselector, timeout?, tabId?

๐ŸŒ Network Setup (WSL/Windows)

1. Find WSL IP

ip route | grep default

2. Configure Windows Firewall

# Run as Administrator
New-NetFirewallRule -DisplayName "Chrome MCP Server" -Direction Inbound -Port 9222 -Protocol TCP -Action Allow

3. Extension Setup

  1. Access extension via \\wsl$\Ubuntu\path\to\chrome-pilot\extension
  2. Load in Windows Chrome
  3. Configure WebSocket URL in popup
  4. Test connection

๐Ÿงช Testing

Test WebSocket Server

curl http://localhost:9222/info
curl -X POST http://localhost:9222/command \
  -H "Content-Type: application/json" \
  -d '{"action": "get_tabs", "params": {}}'

Test with Claude

Can you navigate to google.com and take a screenshot?

๐Ÿ“ Project Structure

chrome-pilot/
โ”œโ”€โ”€ server/                 # MCP Server (TypeScript)
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts        # Main server entry
โ”‚   โ”‚   โ”œโ”€โ”€ websocket-server.ts    # WebSocket server
โ”‚   โ”‚   โ”œโ”€โ”€ native-host.ts  # Native messaging
โ”‚   โ”‚   โ””โ”€โ”€ tools/          # Browser automation tools
โ”‚   โ”œโ”€โ”€ package.json
โ”‚   โ””โ”€โ”€ tsconfig.json
โ”œโ”€โ”€ extension/              # Chrome Extension
โ”‚   โ”œโ”€โ”€ manifest.json       # Extension config
โ”‚   โ”œโ”€โ”€ background-websocket.js   # Service worker
โ”‚   โ”œโ”€โ”€ content.js          # Content script
โ”‚   โ”œโ”€โ”€ popup.html          # Extension popup
โ”‚   โ””โ”€โ”€ popup.js
โ”œโ”€โ”€ native-host/            # Native messaging setup
โ”‚   โ”œโ”€โ”€ install.sh          # Installation script
โ”‚   โ””โ”€โ”€ com.chrome_mcp.host.json.template
โ””โ”€โ”€ docs/                   # Documentation

๐Ÿ” Troubleshooting

Extension Not Connecting

  • Verify WebSocket URL in extension popup
  • Check WSL IP address hasn't changed
  • Ensure server is running on correct port
  • Check Windows firewall settings

MCP Tools Not Working

  • Restart Chrome extension
  • Verify "Connected" status in popup
  • Check server logs for errors
  • Ensure extension has necessary permissions

Performance Issues

  • Use ethernet connection for best performance
  • Monitor network latency between WSL and Windows
  • Consider running on fixed IP

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“ License

MIT License - see file for details.

๐Ÿ™ Acknowledgments

  • Built with MCP SDK by Anthropic
  • Uses Chrome Extension APIs for browser automation
  • WebSocket communication for cross-platform support

๐Ÿ“ž Support

  • Create an issue for bug reports
  • Check for detailed guides
  • See for WSL/Windows configuration