chromium-mcp-controller
Programmatically manipulate a Google Chrome or Chromium browser instance, enabling navigation, element interaction, and data extraction to enhance automated workflows.
Author

lxe
Quick Info
Actions
Tags
Chrome MCP Server Implementation Details
This repository furnishes a Model Context Protocol (MCP) server engineered to furnish precise, granular orchestration of a running Chrome browser session utilizing the Chrome DevTools Protocol (CDP).
Essential Dependencies
- Bun (Strongly recommended runtime) OR Node.js (version 14 or later).
- A functional installation of the Chrome browser configured to allow remote debugging.
Deployment Sequence
Installing Bun Runtime
-
If Bun is absent, execute the following installation command: ```bash # For Unix-like systems (macOS, Linux, WSL) curl -fsSL https://bun.sh/install | bash
For Windows (using PowerShell)
powershell -c "irm bun.sh/install.ps1 | iex"
Alternative installation path via npm
npm install -g bun ```
-
Initiate Chrome, ensuring the remote debugging interface is active:
```bash
macOS Path
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
Windows Command
start chrome --remote-debugging-port=9222
Linux Command
google-chrome --remote-debugging-port=9222 ```
-
Fetch requisite project modules:
bash bun install -
Launch the server application:
bash bun start
To facilitate iterative development with immediate reflection of code changes:
bash
bun dev
By default, the communication endpoint listens on TCP port 3000. This port assignment can be overridden via the PORT environment variable.
Configuring Roo Code Integration
To integrate this Chrome control mechanism with the Roo Code IDE:
- Access the Roo Code user settings interface.
-
Locate the designated configuration file for MCP server specifications:
- macOS:
~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json - Windows:
%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json - Linux:
~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
- macOS:
-
Inject the subsequent configuration block into the
mcpServerssection of the file:
{
"mcpServers": {
"chrome-control": {
"url": "http://localhost:3000/sse",
"disabled": false,
"alwaysAllow": []
}
}
}
-
Persist the modification and restart Roo Code to instantiate the setup.
-
The integrated Chrome MCP functionalities will now be accessible within Roo Code.
Exposed Automation Capabilities
The server exposes the following primitives for browser manipulation:
navigate
Instructs the browser to load a specified Uniform Resource Locator.
Parameters:
* url (string): The target web address.
click
Initiates a simulated mouse click at absolute screen coordinates.
Parameters:
* x (number): Horizontal coordinate.
* y (number): Vertical coordinate.
type
Simulates keyboard input directed at the currently focused interactive field.
Parameters:
* text (string): The sequence of characters to input.
clickElement
Triggers a click event on an element identified by its internal index mapping.
Parameters:
* selector (string): Element index reference (e.g., "0" for the first discovered interactive component).
getText
Retrieves the textual content from an element identified via a standard CSS selector.
Parameters:
* selector (string): The CSS path used to locate the target element.
getPageInfo
Fetches comprehensive semantic structure of the current document, detailing interactable elements and textual data.
getPageState
Retrieves the current operational metrics of the viewport, including the URL, document title, scroll offset, and window dimensions.
Connectivity Reference
The system adheres to the Model Context Protocol utilizing Server-Sent Events (SSE) for bidirectional communication. Engage with the server via these endpoints:
* SSE Subscription: http://localhost:3000/sse
* Message Relay: http://localhost:3000/message?sessionId=...
When deployed alongside Roo Code, the connection handshake is automatically managed through the prior configuration step.
Development Loop
To initiate the server within a development environment featuring automatic code reloading:
bash
bun dev
This leverages Bun's native file-watching utility to ensure the server process automatically restarts upon any source code alteration.
Legal Status
Licensed under the MIT License.
