Chrome Browser Automation MCP server

Enables AI-driven web automation through Chrome browser integration for tasks like navigation, interaction, form filling, and content extraction via WebSocket protocol.
Back to servers
Setup instructions
Provider
dlwjdtn535
Release date
Apr 17, 2025
Language
Python
Stats
2 stars

The MCP Chrome Integration enables AI models to control Chrome browsers for web automation through a protocol that connects models to browser capabilities. It provides a server implementation that allows AI assistants to perform tasks like form filling, data extraction, and page navigation.

Installation

Prerequisites

  • Python 3.12
  • Google Chrome browser
  • Chrome extension installed (websocket client)
  • uv (Python package installer) or Docker

Installing via Smithery

For automatic installation of the Chrome Browser Automation Server via Smithery:

npx -y @smithery/cli install @dlwjdtn535/mcp-chrome-integration --client claude

Configuration Setup

Choose the setup method that matches your environment:

Using uv (Recommended)

Windows Configuration:

{
  "mcpServers": {
    "mcp-chrome-integration": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "%LOCALAPPDATA%\\Programs\\mcp-chrome-integration\\src",
        "mcp-server"
      ],
      "env": {
        "WEBSOCKET_PORT": "8012"
      }
    }
  }
}

macOS Configuration:

{
  "mcpServers": {
    "mcp-chrome-integration": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/usr/local/bin/mcp-chrome-integration/src",
        "mcp-server"
      ],
      "env": {
        "WEBSOCKET_PORT": "8012"
      }
    }
  }
}

Linux Configuration:

{
  "mcpServers": {
    "mcp-chrome-integration": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/usr/local/bin/mcp-chrome-integration/src",
        "mcp-server"
      ],
      "env": {
        "WEBSOCKET_PORT": "8012"
      }
    }
  }
}

Chrome Extension Setup

Installation Steps

  1. Prepare the Extension:

    cd mcp-client
    
  2. Install in Chrome Browser:

    • Open Chrome and navigate to chrome://extensions/
    • Enable "Developer mode" in the top-right corner
    • Click "Load unpacked" button
    • Select the mcp-client directory
  3. Configure the Extension:

    • Click the MCP extension icon in Chrome toolbar
    • Enter server URL (default: ws://localhost:8012)
    • Click "Connect" button
    • Verify connection status changes to "Connected"
  4. Using with New Tabs:

    • Click the extension icon in any new tab
    • Connect to enable automation for that tab

Server Setup

Start the MCP server:

# Navigate to server directory
cd mcp-server

# Install dependencies
pip install -r requirements.txt

# Start server
python src/server.py

Usage Examples

Basic Web Interactions

# Navigate to a website
tool_navigate_to(url="https://example.com", tab_id="your_tab_id")

# Click on an element
tool_click_element(selector="#submit-button", tab_id="your_tab_id")

# Type text into an input field
tool_type_text(selector="#search", text="query", tab_id="your_tab_id")

# Check the current page state
tool_state(tab_id="your_tab_id")

Advanced Features

# Execute JavaScript on the page
tool_execute_script(script="console.log('Hello')", tab_id="your_tab_id")

# Extract data from a table
tool_extract_table(selector=".data-table", tab_id="your_tab_id")

# Get information about an element
tool_get_element_info(selector=".my-element", tab_id="your_tab_id")

# List all available tabs
tool_tab_list()

Important Usage Notes

Browser Security Considerations

  • This integration does not work on chrome:// URLs
  • Only works on regular websites with http:// or https:// protocols
  • Some websites' Content Security Policy may restrict certain operations
  • Consider the website's CSP when executing JavaScript

Tab Management

  • A tab_id is required for all operations
  • Use tool_tab_list() to check available tabs
  • Always verify tab state before performing operations

Error Handling

  • Check return values for success/failure status
  • Include timeouts when waiting for elements or operations
  • Consider the website's loading state when executing operations

Troubleshooting

Connection Issues

  • Verify the server URL is correct
  • Check that the server is running
  • Ensure firewall settings allow connections
  • Verify port 8012 is available and not blocked

Execution Errors

  • Check for CSP restrictions on the website
  • Review browser console for error messages
  • Validate tab IDs before operations
  • Ensure elements exist before interacting with them

Performance Considerations

  • Disconnect from unused tabs to save resources
  • Monitor memory usage during long automation sessions
  • Optimize operations when processing large amounts of data

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "mcp-chrome-integration" '{"command":"uv","args":["run","--directory","%LOCALAPPDATA%\\Programs\\mcp-chrome-integration\\src","mcp-server"],"env":{"WEBSOCKET_PORT":"8012"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "mcp-chrome-integration": {
            "command": "uv",
            "args": [
                "run",
                "--directory",
                "%LOCALAPPDATA%\\Programs\\mcp-chrome-integration\\src",
                "mcp-server"
            ],
            "env": {
                "WEBSOCKET_PORT": "8012"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "mcp-chrome-integration": {
            "command": "uv",
            "args": [
                "run",
                "--directory",
                "%LOCALAPPDATA%\\Programs\\mcp-chrome-integration\\src",
                "mcp-server"
            ],
            "env": {
                "WEBSOCKET_PORT": "8012"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later