Chrome DevTools MCP server provides a bridge between Claude and Chrome's debugging capabilities, allowing you to connect to any web application running in Chrome for debugging network requests, console errors, and performance issues, all through natural conversation with Claude.
.dxt file from Releases.dxt fileQuick Install (most common):
git clone https://github.com/benjaminr/chrome-devtools-mcp.git
cd chrome-devtools-mcp
mcp install server.py -n "Chrome DevTools MCP" --with-editable .
Note: The
mcpcommand is part of the Python MCP SDK. Install it withpip install mcpif not already available.
All Installation Options:
# Clone the repository
git clone https://github.com/benjaminr/chrome-devtools-mcp.git
cd chrome-devtools-mcp
# Basic installation with local dependencies
mcp install server.py --with-editable .
# Install with custom name
mcp install server.py -n "Chrome DevTools MCP" --with-editable .
# Install with environment variables
mcp install server.py -n "Chrome DevTools MCP" --with-editable . -v CHROME_DEBUG_PORT=9222
# Install with additional packages if needed
mcp install server.py -n "Chrome DevTools MCP" --with-editable . --with websockets --with aiohttp
# Install with environment file (copy .env.example to .env first)
cp .env.example .env
# Edit .env with your settings
mcp install server.py -n "Chrome DevTools MCP" --with-editable . -f .env
git clone https://github.com/benjaminr/chrome-devtools-mcp.git
cd chrome-devtools-mcp
uv sync # Creates .venv and installs dependencies
# Get the absolute paths
SERVER_PATH="$(pwd)/server.py"
PYTHON_PATH="$(pwd)/.venv/bin/python"
# Add the server with absolute paths
claude mcp add chrome-devtools "$PYTHON_PATH" "$SERVER_PATH" -e CHROME_DEBUG_PORT=9222
# List configured MCP servers
claude mcp list
# Get details about the server (check that paths are absolute)
claude mcp get chrome-devtools
git clone https://github.com/benjaminr/chrome-devtools-mcp.git
cd chrome-devtools-mcp
uv sync
Edit your Claude Desktop config file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%/Claude/claude_desktop_config.json{
"mcpServers": {
"chrome-devtools": {
"command": "python",
"args": ["/absolute/path/to/chrome-devtools-mcp/server.py"],
"env": {
"CHROME_DEBUG_PORT": "9222"
}
}
}
}
After installation, verify the server is available:
get_connection_status()Once installed in Claude Desktop, you can start debugging any web application:
One-step setup (recommended):
start_chrome_and_connect("localhost:3000")
Replace localhost:3000 with your application's URL
If Chrome isn't found automatically:
start_chrome_and_connect("localhost:3000", chrome_path="/path/to/chrome")
This command will:
Manual setup (if you prefer step-by-step):
start_chrome()
navigate_to_url("localhost:3000")
connect_to_browser()
Once connected, use these commands:
get_network_requests() - View HTTP trafficget_console_error_summary() - Analyse JavaScript errorsinspect_console_object("window") - Inspect any JavaScript objectstart_chrome(port?, url?, headless?, chrome_path?, auto_connect?) - Start Chrome with remote debugging and optional auto-connectionstart_chrome_and_connect(url, port?, headless?, chrome_path?) - Start Chrome, connect, and navigate in one stepconnect_to_browser(port?) - Connect to existing Chrome instancenavigate_to_url(url) - Navigate to a specific URLdisconnect_from_browser() - Disconnect from browserget_connection_status() - Check connection statusget_network_requests(filter_domain?, filter_status?, limit?) - Get network requests with filteringget_network_response(request_id) - Get detailed response data including bodyget_console_logs(level?, limit?) - Get browser console logsget_console_error_summary() - Get organized summary of errors and warningsexecute_javascript(code) - Execute JavaScript in browser contextclear_console() - Clear the browser consoleinspect_console_object(expression) - Deep inspect any JavaScript objectmonitor_console_live(duration_seconds) - Monitor console output in real-timeget_page_info() - Get comprehensive page metrics and performance dataevaluate_in_all_frames(code) - Execute JavaScript in all frames/iframesget_performance_metrics() - Get detailed performance metrics and resource timingget_storage_usage_and_quota(origin) - Get storage usage and quota informationclear_storage_for_origin(origin, storage_types?) - Clear storage by type and originget_all_cookies() - Get all browser cookiesclear_all_cookies() - Clear all browser cookiesset_cookie(name, value, domain, path?, expires?, http_only?, secure?, same_site?) - Set a cookieget_cookies(domain?) - Get browser cookies with optional domain filteringget_storage_key_for_frame(frame_id) - Get storage key for a specific frametrack_cache_storage(origin, enable?) - Enable/disable cache storage trackingtrack_indexeddb(origin, enable?) - Enable/disable IndexedDB trackingoverride_storage_quota(origin, quota_size_mb?) - Override storage quotaget_document(depth?, pierce?) - Retrieve DOM document structurequery_selector(node_id, selector) - Find single element by CSS selectorquery_selector_all(node_id, selector) - Find multiple elements by CSS selectorget_element_attributes(node_id) - Get all attributes of an elementget_element_outer_html(node_id) - Get outer HTML of an elementget_element_box_model(node_id) - Get layout informationdescribe_element(node_id, depth?) - Get detailed element descriptionget_element_at_position(x, y) - Get element at screen positionsearch_elements(query) - Search DOM elements by text/attributesfocus_element(node_id) - Focus a DOM elementget_computed_styles(node_id) - Get computed CSS stylesget_inline_styles(node_id) - Get inline stylesget_matched_styles(node_id) - Get all CSS rules matching an elementget_stylesheet_text(stylesheet_id) - Get stylesheet contentget_background_colors(node_id) - Get background colors and fontsget_platform_fonts(node_id) - Get platform font informationget_media_queries() - Get all media queriescollect_css_class_names(stylesheet_id) - Collect CSS class namesstart_css_coverage_tracking() - Start CSS coverage trackingstop_css_coverage_tracking() - Stop and get CSS coverage resultsWhen your web application makes API calls that fail or return unexpected data:
Example workflow:
You: "I need to debug my React app at localhost:3000"
Claude: I'll start Chrome with debugging enabled and navigate to your app.
start_chrome_and_connect("localhost:3000")
Perfect! Chrome is now running with debugging enabled and connected to your app. Let me check for any failed network requests:
get_network_requests(filter_status=500)
I can see there are 3 failed requests to your API. Let me get the details of the first one:
get_network_response("request-123")
When your web application has JavaScript errors or unexpected behaviour:
get_console_error_summary() to see all errorsmonitor_console_live(10) to watch for new errors as you interactinspect_console_object("myVariable") to examine application stateWhen your web application loads slowly or uses too much memory:
get_page_info() to see load times and resource countsget_performance_metrics() to see detailed timing data| Task | Command |
|---|---|
| Start Chrome and connect to app | start_chrome_and_connect("localhost:3000") |
| Start Chrome (manual setup) | start_chrome() |
| Navigate to page | navigate_to_url("localhost:3000") |
| Connect to browser | connect_to_browser() |
| See all network requests | get_network_requests() |
| Find failed API calls | get_network_requests(filter_status=404) |
| Check for JavaScript errors | get_console_error_summary() |
| Watch console in real-time | monitor_console_live(10) |
| Check page load performance | get_page_info() |
| Examine a variable | inspect_console_object("window.myApp") |
| View cookies | get_cookies() |
| Run JavaScript | execute_javascript("document.title") |
If the server appears in Claude but shows as "disabled", try these steps:
Check Claude Desktop logs:
~/Library/Logs/Claude/mcp*.log%APPDATA%/Claude/logs/mcp*.logCommon fixes:
# Reinstall with verbose output
mcp remove "Chrome DevTools MCP"
mcp install server.py -n "Chrome DevTools MCP" --with-editable . -v CHROME_DEBUG_PORT=9222
# Check installation status
mcp list
# Test the server manually
python3 server.py
Check dependencies:
# Ensure all dependencies are available
pip install mcp websockets aiohttp
# Test imports
python3 -c "from server import mcp; print('OK')"
Restart Claude Desktop completely (quit and reopen)
| Error | Solution |
|---|---|
| "Module not found" | Use --with-editable . flag |
| "No server object found" | Server should export mcp object (already fixed) |
| "Import error" | Check pip install mcp websockets aiohttp |
| "Permission denied" | Use absolute paths in config |
| "Server disabled" | Check Claude Desktop logs, restart Claude |
| "python: command not found" (Claude Code) | Use absolute path to venv Python: /path/to/.venv/bin/python |
| "server.py: No such file" (Claude Code) | Use absolute path to server: /path/to/server.py |
| "ModuleNotFoundError" (Claude Code) | Use venv Python that has dependencies installed |
start_chrome()get_connection_status() to check the connectionconnect_to_browser() or used start_chrome_and_connect()To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "chrome-devtools" '{"command":"python","args":["/absolute/path/to/chrome-devtools-mcp/server.py"],"env":{"CHROME_DEBUG_PORT":"9222"}}'
See the official Claude Code MCP documentation for more details.
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.
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": {
"chrome-devtools": {
"command": "python",
"args": [
"/absolute/path/to/chrome-devtools-mcp/server.py"
],
"env": {
"CHROME_DEBUG_PORT": "9222"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"chrome-devtools": {
"command": "python",
"args": [
"/absolute/path/to/chrome-devtools-mcp/server.py"
],
"env": {
"CHROME_DEBUG_PORT": "9222"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect