vew-mcp

v0.4.3
io.github.YawLabs/vew-mcp Checked 4 days ago Published 4 months ago

Browser MCP: drive a real Chromium via Playwright with compact ref-addressable page snapshots

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

browser_navigate

Navigate the persistent browser page to a URL and return a fresh snapshot of the resulting page. This is usually the first call: it loads the page and immediately gives you the ref-addressable element list + readable text so you can act without a second round-trip. Waits for the load event by default. The page renders at Playwright's default 1280x720 viewport. The snapshot lists every rendered element with a recognized interactive role (button, link, textbox, checkbox, ...), including ones below the fold; scroll only to load content injected lazily as you scroll.

ParameterTypeDescription
url *stringAbsolute http(s) URL to navigate to.
timeout_msintegerNavigation timeout in ms (default 30000).
wait_untilstringWhen to consider navigation finished (default 'load'). Use 'networkidle' for SPA-heavy pages.

browser_back

Go back one entry in the browser history, then return a fresh snapshot of the page you land on. No-op error if there is no previous entry.

browser_forward

Go forward one entry in the browser history, then return a fresh snapshot of the page you land on. No-op error if there is no forward entry.

browser_snapshot

Return a compact, token-efficient view of the CURRENT page: a ref-tagged list of interactive elements (each line is `[ref] role "name"`, optionally with value/checked/disabled) followed by the readable page text. This is the core capability -- prefer it over a raw DOM dump. Refs (e1, e2, ...) are stable within this snapshot and RENUMBER on the next one; always act off the most recent snapshot. Pass a ref to browser_click / browser_type. Lists every rendered element with a recognized interactive role, including below-the-fold ones; scroll only to surface content that loads lazily on scroll.

ParameterTypeDescription
text_budgetintegerMax characters of page text to include (default 8000). Lower it to save tokens.

browser_click

Click the interactive element addressed by `ref` (from the most recent snapshot), then return a fresh snapshot of the resulting page. Use this for buttons, links, checkboxes, tabs, menu items.

ParameterTypeDescription
ref *stringElement ref from the most recent browser_snapshot (e.g. 'e3'). Stale refs from an older snapshot are invalid.
timeout_msintegerClick timeout in ms (default 10000).

browser_type

Type `text` into the textbox/searchbox/combobox addressed by `ref` (from the most recent snapshot). The field is cleared first. Set `submit: true` to press Enter afterward (e.g. to run a search). Returns a fresh snapshot.

ParameterTypeDescription
ref *stringElement ref from the most recent browser_snapshot (e.g. 'e3'). Stale refs from an older snapshot are invalid.
text *stringText to type into the field.
submitbooleanPress Enter after typing (default false).
timeout_msintegerAction timeout in ms (default 10000).

browser_select_option

Select an option in a native <select> dropdown addressed by `ref` (from the most recent snapshot). The `value` is matched against each option's visible label OR its value attribute. browser_type cannot fill a <select> -- use this instead. On a <select multiple>, this selects only the matching option and clears any others. Returns a fresh snapshot.

ParameterTypeDescription
ref *stringElement ref from the most recent browser_snapshot (e.g. 'e3'). Stale refs from an older snapshot are invalid.
value *stringOption to select, matched against its visible label or its value attribute.
timeout_msintegerAction timeout in ms (default 10000).

browser_scroll

Scroll the page one viewport in the given direction, then return a fresh snapshot. Useful to bring lazily-loaded content (infinite scroll, IntersectionObserver widgets) into the DOM so it appears in the snapshot.

ParameterTypeDescription
direction *stringScroll direction. 'top'/'bottom' jump to page extremes.

browser_press_key

Press a single keyboard key, optionally on the element addressed by `ref`. Use Playwright key names: Enter, Tab, Escape, Backspace, Delete, ArrowUp/Down/Left/Right, Home, End, PageUp/PageDown, or a single character; combos use '+', e.g. 'Control+A'. With a `ref` the element is focused first (e.g. to submit a field or drive a focused widget); without one the key goes to whatever currently has focus (e.g. Escape to close a modal). Returns a fresh snapshot.

ParameterTypeDescription
key *stringKey to press, e.g. 'Enter', 'Escape', 'ArrowDown', 'Control+A'.
refstringOptional. Element ref from the most recent browser_snapshot (e.g. 'e3'). Stale refs from an older snapshot are invalid. If omitted, the key goes to the currently focused element.
timeout_msintegerAction timeout in ms (default 10000). Applies only when a ref is given.

browser_hover

Hover the pointer over the element addressed by `ref` (from the most recent snapshot), then return a fresh snapshot. Use this to reveal hover-only menus, tooltips, or action icons that are not in the page until hovered.

ParameterTypeDescription
ref *stringElement ref from the most recent browser_snapshot (e.g. 'e3'). Stale refs from an older snapshot are invalid.
timeout_msintegerAction timeout in ms (default 10000).

browser_file_upload

Set one or more local files on the file input addressed by `ref` (from the most recent snapshot). Paths resolve on the machine running the browser. The ref must point at an <input type=file> (it appears in the snapshot as a textbox). Returns a fresh snapshot.

ParameterTypeDescription
paths *arrayAbsolute path(s) to the file(s) to upload, on the machine running the browser.
ref *stringElement ref from the most recent browser_snapshot (e.g. 'e3'). Stale refs from an older snapshot are invalid.
timeout_msintegerAction timeout in ms (default 10000).

browser_get_text

Return the readable text (innerText) of the current page, normalized and clamped to a character budget. Use this when you want the page content WITHOUT the interactive-element list that browser_snapshot includes.

ParameterTypeDescription
text_budgetintegerMax characters of NORMALIZED text to return (default 8000). The cap is applied after whitespace normalization, so a page with heavy indentation may produce less output than the budget.

browser_screenshot

Capture a PNG screenshot of the current page and return it as an image. Defaults to the viewport; set full_page to capture the entire scrollable page. Prefer browser_snapshot for acting on the page -- a screenshot is for when you need to SEE pixels (layout, charts, visual verification).

ParameterTypeDescription
full_pagebooleanCapture the full scrollable page instead of just the viewport (default false).

browser_evaluate

Evaluate a JavaScript EXPRESSION in the current page's context and return the JSON-serializable result. This is the escape hatch for reading computed state or extracting structured data the snapshot does not surface -- e.g. 'document.title', 'location.href', or '({ count: document.querySelectorAll("a").length })'. Runs in the page sandbox (not the server process). The result must be JSON-serializable; DOM nodes and functions come back empty. Arbitrary JS can also mutate the page, so this is not a read-only call. The call is bounded by timeout_ms and returns an error if the expression has not r…

ParameterTypeDescription
expression *stringA JavaScript expression evaluated in the page. Wrap an object literal in parens, e.g. '({a: 1})'; this is an expression, not a statement block.
timeout_msintegerMax ms to wait for the expression to resolve before returning a timeout error (default 30000).

browser_wait_for

Wait for a condition on the current page, then return a fresh snapshot. Provide at least one of: `text` (wait until that text becomes visible), `text_gone` (wait until that text is no longer visible), or `time_ms` (wait a fixed time); when several are given they apply in that order. Use this after an action that triggers async / SPA rendering so the next snapshot reflects the settled page instead of racing a half-rendered DOM.

ParameterTypeDescription
textstringWait until this (substring) text becomes visible on the page.
text_gonestringWait until this (substring) text is no longer visible anywhere in the page's rendered text. Returns immediately if the text is not currently visible (so a typo or already-gone text is a fast no-op, no…
time_msintegerInstead of a text condition, just wait this many ms (max 30000).
timeout_msintegerMax time to wait for a text / text_gone condition in ms (default 10000).

browser_handle_dialog

Configure how the browser answers the next native JS dialog (alert / confirm / prompt / beforeunload), and report the most recent dialog seen. By default vew auto-ACCEPTS dialogs when driving its own launched browser (so a confirm()-gated action proceeds and alert() text is captured) and auto-DISMISSES them when attached to an existing browser (VEW_CDP_URL) so it does not hijack the human's dialogs. Pass `accept` to override that for the next dialog (and `prompt_text` to answer a prompt()); the override stays armed until a dialog actually fires (then it reverts to the mode default) or you call…

ParameterTypeDescription
acceptbooleanAccept (true) or dismiss/cancel (false) the next dialog. Omit to leave the mode default in place (accept in launched mode, dismiss when attached).
prompt_textstringText to enter into a prompt() dialog before accepting it. Ignored when accept is false.