Chrome Tools MCP Server
An MCP server that provides tools for interacting with Chrome through its DevTools Protocol, enabling remote control of Chrome tabs to execute JavaScript, capture screenshots, monitor network traffic, and more.
nicholmikey
Tools
list_tabs
capture_screenshot
execute_script
load_url
capture_network_events
query_dom_elements
click_element
README
Chrome Tools MCP Server
An MCP server that provides tools for interacting with Chrome through its DevTools Protocol. This server enables remote control of Chrome tabs, including executing JavaScript, capturing screenshots, monitoring network traffic, and more.
Why use an MCP server like this?
This type of MCP Server is useful When you need to manually configure your browser to be in a certain state before you let an AI tool like Cline poke at it. You can also use this tool to listen to and pull network events into its context.
Features
- List Chrome tabs
- Execute JavaScript in tabs
- Capture screenshots
- Monitor network traffic
- Navigate tabs to URLs
- Query DOM elements
- Click elements with console output capture
Installation
npm install @nicholmikey/chrome-tools
Configuration
The server can be configured through environment variables in your MCP settings:
{
"chrome-tools": {
"command": "node",
"args": ["path/to/chrome-tools/dist/index.js"],
"env": {
"CHROME_DEBUG_URL": "http://localhost:9222",
"CHROME_CONNECTION_TYPE": "direct",
"CHROME_ERROR_HELP": "custom error message"
}
}
}
Environment Variables
CHROME_DEBUG_URL
: The URL where Chrome's remote debugging interface is available (default: http://localhost:9222)CHROME_CONNECTION_TYPE
: Connection type identifier for logging (e.g., "direct", "ssh-tunnel", "docker")CHROME_ERROR_HELP
: Custom error message shown when connection fails
Setup Guide
Native Setup (Windows/Mac/Linux)
-
Launch Chrome with remote debugging enabled:
# Windows "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 # Mac /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 # Linux google-chrome --remote-debugging-port=9222
-
Configure MCP settings:
{ "env": { "CHROME_DEBUG_URL": "http://localhost:9222", "CHROME_CONNECTION_TYPE": "direct" } }
WSL Setup
When running in WSL, you'll need to set up an SSH tunnel to connect to Chrome running on Windows:
- Launch Chrome on Windows with remote debugging enabled
- Create an SSH tunnel:
ssh -N -L 9222:localhost:9222 windowsuser@host
- Configure MCP settings:
{ "env": { "CHROME_DEBUG_URL": "http://localhost:9222", "CHROME_CONNECTION_TYPE": "ssh-tunnel", "CHROME_ERROR_HELP": "Make sure the SSH tunnel is running: ssh -N -L 9222:localhost:9222 windowsuser@host" } }
Docker Setup
When running Chrome in Docker:
-
Launch Chrome container:
docker run -d --name chrome -p 9222:9222 chromedp/headless-shell
-
Configure MCP settings:
{ "env": { "CHROME_DEBUG_URL": "http://localhost:9222", "CHROME_CONNECTION_TYPE": "docker" } }
Tools
list_tabs
Lists all available Chrome tabs.
execute_script
Executes JavaScript code in a specified tab. Parameters:
tabId
: ID of the Chrome tabscript
: JavaScript code to execute
capture_screenshot
Captures a screenshot of a specified tab, automatically optimizing it for AI model consumption. Parameters:
tabId
: ID of the Chrome tabformat
: Image format (jpeg/png) - Note: This is only for initial capture. Final output uses WebP with PNG fallbackquality
: JPEG quality (1-100) - Note: For initial capture onlyfullPage
: Capture full scrollable page
Image Processing:
- WebP Optimization (Primary Format):
- First attempt: WebP with quality 80 and high compression effort
- Second attempt: WebP with quality 60 and near-lossless compression if first attempt exceeds 1MB
- PNG Fallback:
- Only used if WebP processing fails
- Includes maximum compression and color palette optimization
- Size Constraints:
- Maximum dimensions: 900x600 (maintains aspect ratio)
- Maximum file size: 1MB
- Progressive size reduction if needed
capture_network_events
Monitors and captures network events from a specified tab. Parameters:
tabId
: ID of the Chrome tabduration
: Duration in seconds to capturefilters
: Optional type and URL pattern filters
load_url
Navigates a tab to a specified URL. Parameters:
tabId
: ID of the Chrome taburl
: URL to load
query_dom_elements
Queries and retrieves detailed information about DOM elements matching a CSS selector. Parameters:
tabId
: ID of the Chrome tabselector
: CSS selector to find elements Returns:- Array of DOM elements with properties including:
nodeId
: Unique identifier for the nodetagName
: HTML tag nametextContent
: Text content of the elementattributes
: Object containing all element attributesboundingBox
: Position and dimensions of the elementisVisible
: Whether the element is visibleariaAttributes
: ARIA attributes for accessibility
click_element
Clicks on a DOM element and captures any console output triggered by the click. Parameters:
tabId
: ID of the Chrome tabselector
: CSS selector to find the element to click Returns:- Object containing:
message
: Success/failure messageconsoleOutput
: Array of console messages triggered by the click
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Excel MCP Server
A Model Context Protocol server that enables AI assistants to read from and write to Microsoft Excel files, supporting formats like xlsx, xlsm, xltx, and xltm.
Playwright MCP Server
Provides a server utilizing Model Context Protocol to enable human-like browser automation with Playwright, allowing control over browser actions such as navigation, element interaction, and scrolling.
@kazuph/mcp-fetch
Model Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.
Claude Code MCP
An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.
Apple MCP Server
Enables interaction with Apple apps like Messages, Notes, and Contacts through the MCP protocol to send messages, search, and open app content using natural language.
DuckDuckGo MCP Server
A Model Context Protocol (MCP) server that provides web search capabilities through DuckDuckGo, with additional features for content fetching and parsing.
contentful-mcp
Update, create, delete content, content-models and assets in your Contentful Space