web-ui-tester
web-ui-tester
MCP-сервер, который позволяет ИИ быстро управлять реальными веб-страницами и исследовать их, используя браузерные сессии, которые остаются активными между вызовами инструментов.
Быстроту обеспечивают две вещи. Страницы представлены в виде дерева доступности со ссылками на элементы, а не скриншотов или сырого HTML, поэтому модель может находить и кликать элементы, не тратя контекст на разметку и не дожидаясь обработки изображений. А сессии сохраняются — куки, состояние страницы и история переживают вызовы, так что длинное взаимодействие — это серия дешёвых шагов вместо повторных холодных запусков.
Также сервер несёт диагностику уровня DevTools — консоль, сеть с телами ответов, выполнение JavaScript, вычисленные стили — чтобы ИИ мог разобраться, почему что-то сломано, а не просто констатировать факт поломки.
Быстрый старт
claude mcp add web-ui-tester -- npx -y web-ui-testerС ключом для встроенного агента (см. run_task):
claude mcp add web-ui-tester \
-e GOOGLE_GENERATIVE_AI_API_KEY=your-key \
-- npx -y web-ui-testerИли в конфигурационном файле любого MCP-клиента:
{
"mcpServers": {
"web-ui-tester": {
"command": "npx",
"args": ["-y", "web-ui-tester"],
"env": { "GOOGLE_GENERATIVE_AI_API_KEY": "your-key" }
}
}
}Chromium поставляется через Playwright. Если он ещё не установлен:
npx playwright install chromiumRelated MCP server: Charlotte
Как работает сессия
browser_start → sessionId, kept alive across calls
browser_navigate → page state + snapshot with [ref=eN] handles
browser_click ref=e12 → act on what the snapshot showed you
browser_snapshot → fresh refs after the page changes
browser_close → done (or let it idle out after 30 minutes)Всё после browser_start использует этот sessionId. Снимок — то, к чему стоит привыкнуть:
- generic [ref=e1]:
- heading "Signup" [level=1] [ref=e2]
- textbox "Name" [ref=e5]:
- /placeholder: Your name
- combobox "Plan" [ref=e7]
- button "Create account" [ref=e10]
- link "Go to second page" [ref=e12] [cursor=pointer]:
- /url: /second.htmlЭти ссылки напрямую идут в browser_click, browser_type и остальные инструменты. Они принадлежат состоянию страницы, которое их породило: после навигации или изменения DOM делайте снимок заново. Когда инструмент сообщает, что ссылка больше недействительна, сделайте новый снимок, а не повторяйте попытку — сообщение об этом говорит явно.
Инструменты адресации элементов также принимают css или role + name, если селектор уже известен и снимок можно пропустить.
Инструменты
Сессия — browser_start (параметры: userAgent, viewportWidth, viewportHeight, headless, baseUrl, url, model), browser_list, browser_close.
Взаимодействие — browser_navigate, browser_click, browser_type, browser_press_key, browser_hover, browser_select_option, browser_scroll, browser_wait_for, browser_go_back, browser_handle_dialog.
Действия сообщают о том, что они вызвали: навигация, новые ошибки консоли, количество запросов и появившиеся диалоги возвращаются вместе с результатом, так что клик, который тихо что-то сломал, не выглядит как успех.
Про диалоги нужно сказать отдельно. alert/confirm/prompt блокирует страницу, пока не получит ответ, поэтому действие, которое открыло диалог, не может одновременно на него ответить — неотвеченный диалог автоматически закрывается, а не замораживает клик, и результат сообщает об этом. Чтобы принять диалог или заполнить prompt, вызовите browser_handle_dialog до действия, которое его запускает, и ответ будет готов для следующего диалога.
Инспекция — browser_snapshot (можно ограничить по элементу, с depth-лимитом, interactiveOnly, постранично через offset), browser_query (поиск по роли/имени, тексту или CSS — возвращает ссылки и состояние), browser_read_text (отображаемый текст страницы или одного поддерева), browser_screenshot (доступен, но дерево обычно лучше).
Диагностика — browser_console (сообщения плюс неперехваченные ошибки со стеками), browser_network (статусы, размеры, тайминги), browser_request_detail (заголовки, разбивка таймингов, тела запроса и ответа), browser_evaluate (выполнение JS на странице), browser_inspect_element (вычисленные стили, блочная модель, состояние формы).
Каждый результат ограничен бюджетом символов, а крупные (browser_snapshot, browser_read_text, тела) разбиваются на страницы через offset, а не молча обрезаются.
Встроенный агент
run_task передаёт сессию быстрой модели, которая сама управляет браузером и сообщает результат:
run_task(sessionId, "Log in as demo@example.com / hunter2 and check the
dashboard loads without errors")Отчёт — это главное. Возвращается структурированный вердикт, а не просто текст:
status: success
model: google:gemini-flash-lite-latest
Logged in and opened the dashboard. The revenue widget rendered empty.
findings (3):
[error] Request failed: GET 500 [observed by the harness]
where: https://app.example.com/api/revenue
evidence: HTTP 500
[error] Console exception on the page [observed by the harness]
where: app.js:214:9
evidence: TypeError: Cannot read properties of undefined (reading 'total')
[warning] The revenue widget shows no empty state, just blank space
where: #revenue-card
evidence: card is present but contains no textНаходки приходят из двух источников, и различие важно. Агент вызывает report_finding по ходу работы — так что запуск, достигший лимита шагов, всё равно возвращает всё, что было найдено до этого момента. Отдельно каркас записывает каждую ошибку консоли, неудачный запрос и диалог во время запуска и сообщает о них независимо от того, упомянул ли их агент, с пометкой [observed by the harness]. Модель, которая пропустила 500 или забыла упомянуть исключение, не сможет это скрыть.
Тот же отчёт возвращается как structuredContent по объявленной схеме вывода, так что вызывающий ИИ может ветвиться по findings[].severity, а не разбирать текст. Задача может быть выполнена, но при этом иметь находки; success отражает, выполнена ли задача, а не то, была ли страница чистой.
Это единственная часть, для которой нужен ключ API. По умолчанию используется Gemini Flash Lite для низкой задержки; Anthropic тоже работает:
Модель по умолчанию | Ключ | |
|
| |
Anthropic |
|
|
Установите WUT_MODEL, чтобы выбрать (anthropic, или google:gemini-flash-latest, или любой provider:modelId). Сессия может переопределить его через model в browser_start, а отдельный вызов — через model в run_task. Все остальные инструменты работают без ключа.
HTTP-режим
web-ui-tester --port 7399
claude mcp add --transport http web-ui-tester http://127.0.0.1:7399/mcpВ этом режиме браузерные сессии живут в долгоживущем сервере, а не в процессе клиента, поэтому они переживают перезапуски и переподключения клиента — переподключитесь, передайте тот же sessionId, и страница всё ещё там. GET /health сообщает количество сессий и подключений.
По умолчанию сервер привязывается к 127.0.0.1, где включена защита от DNS-ребinding. --host расширяет это, и сервер предупреждает при этом: аутентификации нет, и любой, кто может достучаться до порта, может управлять браузером и выполнять JavaScript через него. Поместите его за прокси или файрвол.
Конфигурация
Переменная | По умолчанию | Назначение |
|
| Модель для |
| — | Ключ для Gemini |
| — | Ключ для Anthropic |
|
| User-Agent по умолчанию для новых сессий |
|
| Режим headless по умолчанию |
|
| Закрывать сессии, не использованные так долго |
|
| Лимит символов на результат инструмента |
|
| Таймаут для одного действия с элементом |
|
| Бюджет шагов по умолчанию для |
| — | Явный бинарник Chromium |
| — | Где Playwright ищет браузеры |
Флаги CLI: --port, --host, --headless / --no-headless, --idle-timeout, --version, --help.
Если ожидаемая ревизия Chromium для Playwright не установлена, но есть другая, сервер найдёт и использует её, а не упадёт — удобно в предварительно собранных контейнерах. WUT_EXECUTABLE_PATH полностью переопределяет поиск.
Разработка
npm install
npm run build
npm test # agent loop (mocked model) + full end-to-end suite
npm run typechecknpm test запускает цикл агента против скриптованной мок-модели, затем управляет собранным сервером как настоящий MCP-клиент по обоим транспортам против локального фикстур-приложения — покрывая ссылки, обработку устаревших ссылок, диагностику, сохранение сессий при переподключениях и завершение простаивающих сессий. npm run test:agent:live дополнительно проверяет run_task против реального провайдера и пропускает себя, если ключ не задан.
CI запускает проверку типов, сборку и оба набора тестов на Node 20 и 22 для каждого пуша и pull request. Живой тест агента запускается отдельно — по запросу через workflow Live agent test и еженедельно — потому что он делает реальные API-вызовы; ему нужен GOOGLE_GENERATIVE_AI_API_KEY или ANTHROPIC_API_KEY как секрет репозитория, а запланированный запуск пропускает себя, если ни один не задан.
Лицензия
MIT
Available Tools
26 toolsbrowser_call_toolCall a page or DevTools toolA
Runs a tool from browser_list_tools against the session's page, with arguments matching its browser_tool_schema. WebMCP tools are code the site supplies: their output is the site's word, and one marked CONSEQUENTIAL can take real actions (orders, payments, messages).
Inputs: name (required), sessionId (required), arguments, timeoutMs.
browser_clickClickA
Clicks an element. Address the element by ref (from the latest browser_snapshot), or by css, or by role+name. Reports any navigation, console errors, or network activity the click triggered.
Inputs: sessionId (required), css, ref, name, +5 more.
browser_closeClose sessionA
Closes a browser session and frees its resources.
Inputs: sessionId (required).
browser_consoleConsole logA
Returns buffered console messages and uncaught page errors (with stacks). Check this whenever the page misbehaves — it usually names the failure directly.
Inputs: sessionId (required), clear, level, limit, +1 more.
browser_evaluateEvaluate JavaScriptA
Runs JavaScript in the page and returns the JSON-serialized result. Accepts a bare expression ("document.title") or a function ("el => el.value"). When an element is targeted, it is bound to el. Use it to read state the accessibility tree does not expose.
Inputs: sessionId (required), expression (required), css, ref, +4 more.
browser_go_backGo backB
Navigates back in history and returns the new page state with fresh refs.
Inputs: sessionId (required).
browser_handle_dialogHandle dialogA
Answers an alert/confirm/prompt. A dialog blocks the page until it is answered, so an unanswered one is dismissed automatically rather than stalling the action that opened it. Call this BEFORE the action that triggers a dialog to arm the answer — that is the only way to accept one or supply prompt() text. Called while a dialog is open, it answers that dialog immediately.
Inputs: accept (required), sessionId (required), promptText.
browser_hoverHoverA
Hovers an element, e.g. to reveal a menu or tooltip. Address the element by ref (from the latest browser_snapshot), or by css, or by role+name.
Inputs: sessionId (required), css, ref, name, +2 more.
browser_inspect_elementInspect elementARead-only
DevTools-style inspection of one element: tag, attributes, box model, form state, and computed styles. Use it to diagnose layout and visibility problems.
Inputs: sessionId (required), css, ref, name, +3 more.
browser_listList sessionsARead-only
Lists open browser sessions with their current URL, age, and idle time.
Inputs: no named parameters.
browser_list_toolsList page and DevTools toolsARead-only
Lists tools beyond this server's own that can run against the session's page, by qualified name: "webmcp." for tools the site itself publishes through WebMCP (read live — they change as the page navigates), and "devtools." for chrome-devtools-mcp's tools (performance traces, Lighthouse, emulation, heap snapshots…), which this server runs for you — no extra MCP server to configure. Follow with browser_tool_schema, then browser_call_tool.
Inputs: sessionId (required), source.
browser_networkNetwork logARead-only
Lists network requests the session has made, with status, size, and duration. Each line carries an #id for browser_request_detail. WebSockets appear as WS entries with their frame counts. Filter by URL substring or by failure status.
Inputs: sessionId (required), limit, filter, status.
browser_press_keyPress keyB
Presses a key, optionally focused on an element. Key names follow Playwright ("Enter", "Escape", "ArrowDown", "Control+a").
Inputs: key (required), sessionId (required), css, ref, +3 more.
browser_queryQuery elementsARead-only
Finds elements by role+name, visible text, or CSS, and returns a compact line per match including its ref and visible/enabled state. Use this instead of a full snapshot when you already know what you are looking for.
Inputs: sessionId (required), css, name, role, +2 more.
browser_read_textRead textARead-only
Returns the rendered text of the page or of one element subtree — the readable content without markup. Use it to verify copy, read results, or check an error message.
Inputs: sessionId (required), css, ref, name, +4 more.
browser_request_detailRequest detailARead-only
Inspects one request from browser_network: headers, timing breakdown, request body, or response body. Small text responses are cached, so they stay readable after navigation. For a WebSocket entry, any part returns its frame stream.
Inputs: id (required), sessionId (required), part, offset, +1 more.
browser_screenshotScreenshotARead-only
Captures a JPEG of the page or an element. Use this only for genuinely visual questions (layout, styling, rendering); browser_snapshot and browser_read_text are faster and cheaper for finding and verifying content.
Inputs: sessionId (required), css, ref, name, +3 more.
browser_scrollScrollA
Scrolls an element into view, or scrolls the page by a pixel delta when no element is given.
Inputs: sessionId (required), dx, dy, css, +4 more.
browser_select_optionSelect optionA
Selects one or more options in a . Address the element by ref (from the latest browser_snapshot), or by css, or by role+name.
Inputs: values (required), sessionId (required), css, ref, +3 more.
browser_snapshotSnapshot pageARead-only
Returns the accessibility tree of the page as compact YAML, with a [ref=eN] handle on every element. This is the primary way to see the page — use these refs to click and type. Far cheaper than HTML or screenshots. Scope it with ref/css/role, cap it with depth, or page through it with offset when a page is large.
Inputs: sessionId (required), css, ref, name, +7 more.
browser_startStart browser sessionA
Opens a new browser session and returns its sessionId. The session (cookies, storage, page state) stays alive across tool calls until closed or idle-timed-out, so you can interact with the same page over many turns.
Inputs: tab, url, model, cdpUrl, +7 more.
browser_tool_schemaGet a tool's schemaARead-only
Full description and JSON input schema of a tool from browser_list_tools, e.g. "webmcp.search" or "devtools.performance_start_trace".
Inputs: name (required), sessionId (required).
browser_typeType textA
Types text into an input or textarea. Address the element by ref (from the latest browser_snapshot), or by css, or by role+name.
Inputs: text (required), sessionId (required), css, ref, +5 more.
browser_wait_forWait for conditionA
Waits for text to appear, text to disappear, or a selector to become visible. Use after actions that trigger async updates.
Inputs: sessionId (required), text, selector, textGone, +1 more.
run_taskRun UI taskA
Delegates a multi-step UI task to a fast built-in browser agent, which drives the session itself and reports back. Use it for goal-shaped work ("log in as demo@example.com and check the dashboard loads", "walk the checkout flow and report anything broken") rather than driving each click yourself.
Returns a structured report: a success flag, a summary, and findings — each with a severity, what is wrong, where, and the evidence observed. Findings come from two places: what the agent noticed, and what the harness itself recorded (console errors, failed requests, dialogs), so problems are reported even when the agent does not mention them or runs out of steps. The session is left on whatever page the agent ended on, so you can inspect it further with the browser_* tools.
Inputs: sessionId (required), instruction (required), model, maxSteps, +1 more. Returns: model, steps, success, summary, +6 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Most tools have clearly distinct purposes: interaction (click/type/hover/press_key/select_option), navigation, and session management are unambiguous. The main soft overlap is among the page-reading tools (browser_snapshot, browser_query, browser_read_text, browser_inspect_element, browser_screenshot), but the descriptions explicitly explain when to prefer each, so misselection risk is low.
Nearly all tools use a browser_ prefix with snake_case, which is highly predictable. Slight deviation: some are verb-first (browser_navigate, browser_click) while others are noun-first (browser_console, browser_network, browser_snapshot), and run_task drops the prefix, but the style is coherent overall.
At 26 tools the surface is on the heavy side, but browser automation is a genuinely broad domain spanning sessions, interaction, inspection, network, dialogs, and delegation. Few tools feel redundant, though the count is borderline rather than tightly scoped.
The surface covers the full automation lifecycle: session start/list/close, navigation and history, element interaction, form filling, dialog handling, waiting, accessibility/text/visual inspection, JS evaluation, console and network diagnostics, plus a meta-tool layer and a delegated run_task agent. No obvious dead ends for typical UI testing.
Maintenance
Related MCP Connectors
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Hosted browser for AI agents: screenshots, post-JS DOM, console, WCAG. No install, no API key.
Find UI bugs, verify fixes and run tests on your web app from your AI coding agent.
Let your AI agent operate any website through a real, logged-in browser session.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to browse and interact with web pages through a persistent headless Chromium session, serving compact structured orientations, targeted element queries, and full detail only when explicitly requested. It supports navigation, observation, form filling, monitoring, and session management while cutting token overhead by up to ~140x versus raw accessibility-tree dumps.4 npm-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to browse and interact with websites through a persistent headless Chromium session, returning compact structured page representations instead of full accessibility-tree dumps. Agents can navigate, query specific elements and forms, click, type, manage tabs and cookies, and monitor console or network activity while paying a fraction of the tokens.4 npm-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to browse and interact with web pages through a token-efficient, structured page representation — orientation summaries, targeted element queries, and full detail only on request — instead of raw accessibility-tree dumps. Supports navigation, interaction, forms, screenshots, console and network monitoring, session/tab management, and browser-based development auditing.4 npm-
- FlicenseNot gradedqualityAmaintenanceEnables AI agents to browse and interact with web pages through a persistent headless Chromium session, returning compact structured page summaries, targeted element queries, and full detail only on request. This keeps token usage far below full accessibility-tree snapshots while still supporting navigation, forms, screenshots, and session control.4 npm-