| name | chrome-devtools-cli |
| description | Use this skill to write shell scripts or run shell commands to automate tasks in the browser or otherwise use Chrome DevTools via CLI. |
The chrome-devtools-mcp CLI lets you interact with the browser from your terminal.
Setup
Note: If this is your very first time using the CLI, see references/installation.md for setup. Installation is a one-time prerequisite and is not part of the regular AI workflow.
AI Workflow
- Execute: Run tools directly. If you don't know the target page's ID, run
chrome-devtools list_pages to find it. The background server starts implicitly; do not run start/status/stop before each use.
- Inspect: Use
chrome-devtools take_snapshot <pageId> to get an element <uid>.
- Act: Use
chrome-devtools click <pageId> <uid>, chrome-devtools fill <pageId> <uid> <value>, etc. State persists across commands.
Snapshot example:
uid=1_0 RootWebArea "Example Domain" url="https://example.com/"
uid=1_1 heading "Example Domain" level="1"
Permissions & File Access
By default, the server only has access to the OS temp directory (as defined by Node APIs, os.tmpdir()). File-saving parameters (--filePath, --outputDirPath) and upload_file outside the temp directory require unrestricted filesystem access:
chrome-devtools start --allowUnrestrictedPaths=true
Command Usage
chrome-devtools <tool> [arguments] [flags]
- Required arguments are passed positionally; optional arguments use flags.
- Use
--help on any command for usage details.
- Output defaults to plain Markdown-like text; pass
--output-format=json for JSON.
Input Automation ( from snapshot)
chrome-devtools take_snapshot 1
chrome-devtools click 1 "id"
chrome-devtools click 1 "id" --dblClick true --includeSnapshot true
chrome-devtools drag 1 "src" "dst"
chrome-devtools drag 1 "src" "dst" --includeSnapshot true
chrome-devtools fill 1 "id" "text"
chrome-devtools fill 1 "id" "text" --includeSnapshot true
chrome-devtools handle_dialog 1 accept
chrome-devtools handle_dialog 1 dismiss --promptText "hi"
chrome-devtools hover 1 "id"
chrome-devtools hover 1 "id" --includeSnapshot true
chrome-devtools press_key 1 "Enter"
chrome-devtools press_key 1 "Control+A" --includeSnapshot true
chrome-devtools type_text 1 "hello"
chrome-devtools type_text 1 "hello" --submitKey "Enter"
chrome-devtools upload_file 1
chrome-devtools upload_file 1 --includeSnapshot
Navigation
chrome-devtools close_page 1
chrome-devtools list_pages
chrome-devtools navigate_page 1 --url "https://example.com"
chrome-devtools navigate_page 1 --type "reload" --ignoreCache true
chrome-devtools navigate_page 1 --url "https://example.com" --timeout 5000
chrome-devtools navigate_page 1 --handleBeforeUnload "accept"
chrome-devtools navigate_page 1 --type "back" --initScript "foo()"
chrome-devtools new_page "https://example.com"
chrome-devtools new_page "https://example.com" --background true --timeout 5000
chrome-devtools new_page "https://example.com" --isolatedContext "ctx"
chrome-devtools select_page 1
chrome-devtools select_page 1 --bringToFront true
Emulation
chrome-devtools emulate 1 --networkConditions "Offline"
chrome-devtools emulate 1 --cpuThrottlingRate 4 --geolocation "0x0"
chrome-devtools emulate 1 --colorScheme "dark" --viewport "1920x1080"
chrome-devtools emulate 1 --userAgent "Mozilla/5.0..."
chrome-devtools resize_page 1 1920 1080
Performance
chrome-devtools performance_analyze_insight 1 "1" "LCPBreakdown"
chrome-devtools performance_start_trace 1 --reload true --autoStop false
chrome-devtools performance_start_trace 1 --reload true --autoStop true --filePath "t.json.gz"
chrome-devtools performance_stop_trace 1
chrome-devtools performance_stop_trace 1 --filePath "t.json.gz"
Memory
chrome-devtools take_heapsnapshot 1 "./snap.heapsnapshot"
Memory Debugging (requires --memoryDebugging=true)
chrome-devtools get_heapsnapshot_summary "./snap.heapsnapshot"
chrome-devtools compare_heapsnapshots "./base.heapsnapshot" "./target.heapsnapshot"
chrome-devtools get_heapsnapshot_class_nodes "./snap.heapsnapshot" "Array"
chrome-devtools get_heapsnapshot_details "./snap.heapsnapshot" 123
chrome-devtools get_heapsnapshot_dominators "./snap.heapsnapshot" 123
chrome-devtools get_heapsnapshot_duplicate_strings "./snap.heapsnapshot"
chrome-devtools get_heapsnapshot_edges "./snap.heapsnapshot" 123
chrome-devtools get_heapsnapshot_object_details "./snap.heapsnapshot" 123
chrome-devtools get_heapsnapshot_retainers "./snap.heapsnapshot" 123
chrome-devtools get_heapsnapshot_retaining_paths "./snap.heapsnapshot" 123
chrome-devtools close_heapsnapshot "./snap.heapsnapshot"
Network
chrome-devtools get_network_request 1
chrome-devtools get_network_request 1 --reqid 1 --requestFilePath "req.md"
chrome-devtools get_network_request 1 --responseFilePath "res.md"
chrome-devtools list_network_requests 1
chrome-devtools list_network_requests 1 --pageSize 50 --pageIdx 0
chrome-devtools list_network_requests 1 --resourceTypes Fetch
chrome-devtools list_network_requests 1 --includePreservedRequests true
Debugging & Inspection
chrome-devtools evaluate_script "() => document.title" --pageId 1
chrome-devtools evaluate_script "(a) => a.innerText" --pageId 1 --args 1_4
chrome-devtools get_console_message 1 1
chrome-devtools lighthouse_audit 1 --mode "navigation"
chrome-devtools lighthouse_audit 1 --mode "snapshot" --device "mobile"
chrome-devtools lighthouse_audit 1 --outputDirPath ./out
chrome-devtools list_console_messages 1
chrome-devtools list_console_messages 1 --pageSize 20 --pageIdx 1
chrome-devtools list_console_messages 1 --types error --types info
chrome-devtools list_console_messages 1 --includePreservedMessages true
chrome-devtools take_screenshot 1
chrome-devtools take_screenshot 1 --fullPage true --format "jpeg" --quality 80
chrome-devtools take_screenshot 1 --uid "id" --filePath "s.png"
chrome-devtools take_snapshot 1
chrome-devtools take_snapshot 1 --verbose true --filePath "s.txt"
Extensions
chrome-devtools list_extensions
chrome-devtools install_extension "/path/to/extension"
chrome-devtools uninstall_extension "extension_id"
chrome-devtools reload_extension "extension_id"
chrome-devtools trigger_extension_action "extension_id"
Progressive Web Apps (requires --categoryPwa=true)
chrome-devtools install_pwa "https://example.com/"
chrome-devtools launch_pwa "https://example.com/"
chrome-devtools get_os_app_state "https://example.com/"
chrome-devtools uninstall_pwa "https://example.com/"
Experimental Features
Experimental tools are disabled by default. Enable them with the corresponding flag during start.
chrome-devtools click_at 1 100 200
chrome-devtools screencast_start 1 --filePath "screen.mp4"
chrome-devtools screencast_stop 1
chrome-devtools list_webmcp_tools 1
chrome-devtools execute_webmcp_tool 1 "tool_name" --input '{"arg":"val"}'
chrome-devtools list_3p_developer_tools 1
chrome-devtools execute_3p_developer_tool 1 "tool_name" --params '{"arg":"val"}'
Service Management
chrome-devtools start
chrome-devtools start --allowUnrestrictedPaths=true
chrome-devtools start --headless=false
chrome-devtools status
chrome-devtools stop