This guide explains when and how to use each MCP tool. For parameter details, see tool-reference.md.
list_pages— See open tabs; notepageIdfor the tab you care about.select_page— Target that tab for subsequent tools (unless you only have one page).take_snapshot— Get the accessibility tree withuidvalues for elements. Prefer this over screenshots for structure and automation.- Act (navigate, click, fill, etc.), then
take_snapshotagain when the DOM may have changed.
uids expire when the page updates. Always use the latest snapshot.
- Use when: You need to know which tabs exist, their URLs, or which
pageIdto pass toselect_page/close_page. - Typical scenario: Multi-tab debugging; picking the tab that shows the bug.
- Use when: More than one tab is open, or you need to switch context.
- Pairs with: Every page-scoped tool after switching tabs.
- Use when: You need a fresh tab, a specific URL in isolation, or an
isolatedContext(separate cookies/storage from the default profile). - Typical scenario: Testing logged-out vs logged-in side by side.
- Use when: Loading a URL, going back/forward, reload (optionally ignore cache), or injecting an init script before the next document.
- Prefer over asking the user to open links manually.
- Use when: Cleaning up extra tabs. Cannot close the last remaining page.
- Use when: The UI updates asynchronously; wait until any of the given strings appears before continuing.
- Pairs with:
take_snapshotafter the wait.
- Use when: Integrating with external tooling that needs the Chrome tab ID for the selected page.
All of these need uid values from take_snapshot (except
type_text, which uses the focused element).
- Use when: Activating buttons, links, controls, or opening menus.
- Tip: Use
dblClickwhen a double-click is required.
- Use when: You must hit pixel coordinates (e.g. canvas, non-a11y
overlay) and
uid-basedclickis not enough.
- Use when: Revealing tooltips, mega-menus, or hover-only controls before another action.
- Use when: Setting inputs, text areas,
<select>, or combobox-like controls with option children. - Prefer over
type_textwhen you have a clear fielduid.
- Use when: Many fields should be set in one pass (forms, wizards).
- Use when: Simulating keystrokes after focus (e.g. contenteditable,
IME-heavy fields). Optional
submitKey(e.g. Enter).
- Use when: Shortcuts (Ctrl+R), Escape, Tab navigation, or keys that
filldoes not model.
- Use when: Drag-and-drop between two elements identified by
from_uidandto_uid.
- Use when: Attaching a file; pass a real
filePathon the MCP host.
- Use when:
alert/confirm/promptblocks automation; accept or dismiss, with optionalpromptText.
- Use when: Reproducing mobile, slow network, CPU throttling, geolocation, user agent, dark/light, or viewport conditions.
- Typical scenario: “Why does this break on slow 3G?” or “Does dark mode break contrast?”
- Use when: You need an exact content width/height (layout breakpoints, responsive bugs).
- Use when: You need structure, roles, names, and uids for automation or reasoning about the page.
- Prefer over
take_screenshotfor “what can I click?” questions.
- Use when: You need pixels (visual regression, layout proof, sharing
with a human). Optional element
uid,fullPage, orfilePath.
- Use when: Reading
windowstate, calling page APIs, or extracting data as JSON. Pass elementuids asargswhen the script should receive DOM nodes. - Not for: Long arbitrary scripts without a return value—keep functions JSON-serializable.
- Use when: Investigating errors, warnings, logs, or DevTools issues after navigation or interaction.
- Flow: List to get
msgid, then fetch full detail for one message.
- Use when: You want a11y, SEO, best-practices scores and reports (HTML/JSON). Does not replace performance tracing for load timelines.
- Performance: Use
performance_start_trace/performance_stop_trace.
| Tool | Use when |
|---|---|
get_computed_styles |
Inspect resolved CSS for one node; optional rule origins. |
get_computed_styles_batch |
Same for many uids (design-system parity checks). |
get_box_model |
Padding/margin/content quads and geometry debugging. |
get_visibility |
“Why is this invisible?” (display, opacity, off-screen, etc.). |
diff_computed_styles |
Side-by-side two elements (A vs B) on the same page. |
save_computed_styles_snapshot |
Baseline captured styles + meta for later comparison. |
diff_computed_styles_snapshot |
Compare live node to a saved baseline; use domPath if uids drifted. |
highlight_elements_for_styles |
Draw DevTools overlays and return border quads for external diagrams. |
Typical comparison flow: take_snapshot → save_computed_styles_snapshot
→ change URL or code → take_snapshot → diff_computed_styles_snapshot.
- Use when: You need a video repro (MP4). Requires ffmpeg on PATH.
- Use when: Seeing what loaded, failed, or order/timing of requests since navigation. Filter by resource type or paginate.
- Use when: Inspecting headers, bodies, status for one request.
Omit
reqidto use the row selected in the DevTools Network panel. - Tip: Save large bodies with
requestFilePath/responseFilePath.
- Use when: Diagnosing load performance, main-thread jank, LCP/INP/CLS, or sharing a trace file.
- Note: Default flow reloads the page; navigate first if
reloadis used as intended.
- Use when: A trace is done and you need deeper detail on one insight (ids/names come from the trace summary).
- Use when: Heap leaks or retaining paths; produces a
.heapsnapshotfor Chrome DevTools Memory panel.
- Use when: Testing unpacked extensions or automating extension lifecycle during E2E.
- Use when: Clicking the extension toolbar action programmatically.
Pages can expose window.__dtmcp tools (schemas defined by the app).
- Use when: The app under test registers custom diagnostics (feature flags, store state, etc.).
- Use when: Calling those tools with JSON
params;{ "uid": "…" }in params is resolved to a real element.
For minimal deployments, the server exposes only:
| Tool | Role |
|---|---|
screenshot |
Viewport PNG to a temp path |
navigate |
goto a URL |
evaluate |
Run a script string; result as text |
Use full mode for network, console, performance, styles, and snapshot-based automation.
- Prefer this MCP when the task needs ground truth from a real browser: computed styles, traces, network waterfalls, console stacks, or reproducible clicks tied to the a11y tree.
- Prefer crawling/search for documentation or third-party content you are not loading in the instrumented Chrome instance.
- Tool reference — full schemas
- Slim tool reference
- Troubleshooting
- CLI options — flags that enable experimental categories