mcp-browser-dev-tools

v0.5.9
io.github.Hinaser/mcp-browser-dev-tools Checked 12 hours ago Published 2 days ago

MCP server for browser use: batch clicks, typing, waits, checks in one call on Chrome, Edge, Firefox

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_tabs

List the browser's tabs.

ensure_browser

Reuse a reachable browser or launch one (with the MCP_BROWSER_USER_DATA_DIR profile when set), optionally opening url in a new tab. It never launches twice on one profile (except from WSL).

ParameterTypeDescription
browserFamily *stringRequired in auto mode.
addressstringChromium/Edge bind address; loopback unless MCP_BROWSER_ALLOW_REMOTE_ENDPOINTS=1.
createTabbooleanDefault: true when url is given.
launchIfMissingbooleanLaunch when none is reachable (default true).
portintegerDebugging port (default: the configured endpoint's, usually 9222).
skipDoctorbooleanReturn right after spawning, without waiting or a doctor report.
urlstringOpen this in a new tab.
userDataDirstringProfile for a new launch (default MCP_BROWSER_USER_DATA_DIR).
waitMsintegerms to wait for the endpoint after launch (default 5000).

new_tab

Open a tab; returns its target id.

ParameterTypeDescription
browserFamily *stringRequired in auto mode.
urlstringDefault about:blank.

close_tab

Close a tab and its session.

ParameterTypeDescription
targetId *stringFrom list_tabs or new_tab.

attach_tab

Start here: attach to a tab by its url, or a targetId from list_tabs or new_tab. Returns the page's snapshot, one line per visible heading and control with a ref such as e12 (f1e3 inside an iframe), and buffers the tab's console and network events from now on. Later calls without sessionId act on the tab attached last.

ParameterTypeDescription
targetIdstringFrom list_tabs or new_tab.
urlstringInstead of targetId: the tab whose URL is this, else the one whose URL contains it.

wait_for

Wait until every given condition holds, or the first of anyOf; at timeoutMs it fails with the last observed state. Selector checks scroll the element into view. Actions already return what changed once the page settles, so wait only for something that comes later.

ParameterTypeDescription
anyOfarrayConditions with the fields above, instead of them; holds when any holds (result: matchedIndex).
expressionstringPage JavaScript; holds when its (awaited) result is truthy. Throwing fails.
pollIntervalMsintegerms between checks (default 100).
readyStatestringdocument.readyState is at least this.
selectorstringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring
statestringWith selector (default visible); hidden means absent or not visible.
textEqualsstringThe selector's visible text equals this (whitespace collapsed).
textExcludesstringThe selector's visible text no longer contains this; false for a missing element.
textIncludesstringThe selector's visible text contains this.
timeoutMsintegerms before failing (default 10000).
urlstringPage URL equals this.
urlIncludesstringPage URL contains this.

navigate

Load a URL.

ParameterTypeDescription
url *stringAbsolute URL.
sessionIdstring
waitUntilstringReturn at none (navigation started), interactive (DOMContentLoaded), or complete (load; default).

reload

Reload the tab.

ParameterTypeDescription
ignoreCachebooleanBypass the cache.
sessionIdstring
waitUntilstringReturn at none (navigation started), interactive (DOMContentLoaded), or complete (load; default).

click

Click with real mouse input at an element's center (fails if something covers it) or at x, y. Accepts alert and confirm dialogs, dismisses prompts. Returns changes: what changed on the page. Locators in every tool are case-sensitive: ref=e12 until the page navigates; CSS; text=Foo and name=Foo, the first visible element whose text or accessible name equals, else contains, Foo (a label finds its control); role=button[name="Save"]; a >> b for b inside a, and has-text=Foo to filter: tr >> has-text=Ada >> text=Delete. Only refs reach into iframes.

ParameterTypeDescription
buttonstringDefault left.
clickCountinteger2 for a double click.
selectorstringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring
timeoutMsintegerms to retry while the element is missing, covered, outside the viewport, or disabled (default 2000).
xnumberViewport CSS px, with y, instead of selector.
ynumber

hover

Move the real mouse pointer to an element's center or x, y. Returns changes.

ParameterTypeDescription
selectorstringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring
timeoutMsintegerms to retry while the element is missing, covered, or outside the viewport (default 2000).
xnumberViewport CSS px, with y, instead of selector.
ynumber

type

Type with real text input into an input, textarea, or contenteditable, replacing its content unless clear is false. Returns changes.

ParameterTypeDescription
selector *stringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
text *stringEach newline presses Enter. Picker inputs (date, time, datetime-local, month, week, color, range) take their value format, e.g. 2026-09-27.
clearbooleanfalse appends (default true); picker inputs are always replaced.
sessionIdstring
timeoutMsintegerms to retry while the element is missing (default 2000).

upload_file

Set files on a file input (or its label, or an element holding one; on Chromium also a button that opens a file chooser) and fire change events. Files must be in the working or temp directory or MCP_BROWSER_UPLOAD_DIRS. Returns changes.

ParameterTypeDescription
paths *arrayAbsolute file paths; [] clears the input.
selector *stringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring
timeoutMsintegerms to retry while the element is missing (default 2000).

select

Pick a native <select> option by value or label and fire change events; use click for custom dropdowns. Returns changes.

ParameterTypeDescription
selector *stringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
labelstringText the option contains.
sessionIdstring
timeoutMsintegerms to retry while the element is missing (default 2000).
valuestringOption value or full text.

press_key

Press a key or combination with real keyboard input on selector (focused first) or the focused element. Returns changes.

ParameterTypeDescription
key *stringA character or key name (Enter, Tab, Escape, ArrowDown, PageUp, F5, ...); join modifiers with +, e.g. Shift+Tab, Meta+a.
selectorstringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring
timeoutMsintegerms to retry while the element is missing (default 2000).

scroll

Scroll the page by deltas, an element into view, or with a real wheel at x, y or over selector with deltas (scrolls what is under the pointer).

ParameterTypeDescription
blockstringDefault center.
deltaXintegerCSS px; negative is left.
deltaYintegerCSS px; negative is up.
selectorstringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring
xnumberViewport CSS px, with y, instead of selector.
ynumber

get_console_messages

Buffered console messages and exceptions.

ParameterTypeDescription
limitintegerMost recent N (default 50).
sessionIdstring

get_network_requests

Buffered network requests.

ParameterTypeDescription
limitintegerMost recent N (default 50).
sessionIdstring

get_snapshot

List visible headings and controls, one line each with a ref, role, name, and state, e.g. e3 textbox "Email" value="ada@example.com". ref=e3 works as any tool's selector until the page navigates; controls inside iframes get refs like f1e3. Far cheaper than get_document or a screenshot.

ParameterTypeDescription
headingsbooleanDefault true.
limitintegerDefault 100.
selectorstringOnly inside this element.
sessionIdstring

read_text

Visible text of the main content, or of selector, as lines up to maxChars; with links, also its links.

ParameterTypeDescription
linksbooleanAlso list http(s) links (default false).
maxCharsintegerDefault 8000.
maxLinksintegerDefault 50.
selectorstringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring

take_screenshot

Screenshot the page or selector: base64 in the JSON (output data, default), image content (image), or a file (file, or path). cssRect and scale convert image pixels to x, y.

ParameterTypeDescription
formatstringDefault png; must match path's extension.
outputstringDefault data; file when path is given.
overwritebooleanReplace an existing file.
pathstringAbsolute, ending in .png, .jpg, .jpeg, .webp; default a temp file.
selectorstringLocator: ref=e3, CSS, text=…, role=button[name="…"], name=…, or a >> b
sessionIdstring

evaluate_js

Run JavaScript in the page; top-level await works, and the last expression's value is returned.

ParameterTypeDescription
expression *stringJavaScript.
awaitPromisebooleanDefault true.
returnByValuebooleanJSON value (default true); false gives a short description (Chromium only).
sessionIdstring

run_steps

Run session tools in order in one call; prefer it to separate calls for the actions you already know, such as every field of a form: [{"tool":"type","arguments":{"selector":"ref=e3","text":"Ada"}},{"tool":"click","arguments":{"selector":"text=Save"}}]. Arguments omit sessionId. Also: sleep {ms}; if {condition, then, elseIf: [{condition, then}], else, timeoutMs}, which branches on wait_for fields, checked once or until one holds within timeoutMs; repeat {steps, until, max (default 5)}, which reruns steps until until holds. All steps are validated first. A step fails when it throws or reports fo…

ParameterTypeDescription
steps *arrayAt most 50, counting nested steps.
continueOnErrorbooleanDefault false.
sessionIdstring

run_tabs

Run steps in several tabs at once and get every tab's results in one reply: {"tabs":[{"url":"https://a.example","steps":[{"tool":"read_text"}]},{"url":"https://b.example","steps":[{"tool":"read_text"}]}]}. A url tab opens, runs its steps, and closes unless keepTabs; a sessionId tab uses that session. Steps are as in run_steps. A tab that fails or passes timeoutMs does not stop the others.

ParameterTypeDescription
tabs *arrayAt most 8, each with url or sessionId, and steps.
browserFamilystringRequired for url tabs in auto mode.
concurrencyintegerTabs at once (default all).
continueOnErrorbooleanWithin each tab (default false).
keepTabsbooleanKeep url tabs open and attached (default false).
timeoutMsintegerms per tab (default 60000).

more_tools

Tools not listed here to keep each turn small: drag, cookies and storage, request mocking, HAR, performance, and more. No arguments lists them; name describes one; name with arguments calls it. They also work as run_steps steps.

ParameterTypeDescription
argumentsobjectCall the tool with these arguments.
namestring