Skip to main content
Glama

web-ui-tester

CI

AIが実際のWebページを素早く操作・検査できるようにするMCPサーバーです。ツール呼び出しの間も存続するブラウザセッションを介して動作します。

高速である理由は2つあります。ページはスクリーンショットや生のHTMLではなく、要素参照付きのアクセシビリティツリーとして公開されるため、モデルはマークアップにコンテキストを費やしたり、ビジョンを待ったりすることなく、要素を見つけてクリックできます。また、セッションは永続化されます。Cookie、ページ状態、履歴が呼び出しをまたいで保持されるため、長い操作は繰り返しのコールドスタートではなく、一連の安価なステップになります。

また、DevToolsレベルの診断機能(コンソール、レスポンスボディ付きネットワーク、JS評価、計算済みスタイル)も備えており、AIは何が壊れているかだけでなく、なぜ壊れているのかを突き止めることができます。

Quick start

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 chromium

Related MCP server: Charlotte

How a session works

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 も受け付けます。

Tools

セッション — 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。

アクションは、その結果として発生したものを報告します。ナビゲーション、新しいコンソールエラー、リクエスト数、表示されたダイアログなどが結果とともに返されるため、静かに何かを壊したクリックが成功のように見えることはありません。

ダイアログには注意点が1つあります。alert/confirm/prompt は回答されるまでページをブロックするため、それを開いたアクションが同時に回答することはできません。未回答のダイアログはクリックを停止させるのではなく自動的に閉じられ、結果にはその旨が示されます。ダイアログを受け入れる場合、または prompt に入力する場合は、それをトリガーするアクションの前に browser_handle_dialog を呼び出してください。回答は次のダイアログのために準備されます。

検査 — browser_snapshot(要素によるスコープ指定、depth 制限、interactiveOnly、オフセットページング)、browser_query(ロール/名前、テキスト、またはCSSで検索 — 参照と状態を返します)、browser_read_text(ページまたは1つのサブツリーのレンダリングされたテキスト)、browser_screenshot(利用可能ですが、通常はツリーの方が優れたツールです)。

診断 — browser_console(メッセージとスタック付きの未キャッチエラー)、browser_network(ステータス、サイズ、タイミング)、browser_request_detail(ヘッダー、タイミングの内訳、リクエストとレスポンスのボディ)、browser_evaluate(ページ内でJSを実行)、browser_inspect_element(計算済みスタイル、ボックスモデル、フォーム状態)。

すべての結果は文字数予算に制限され、大きな結果(browser_snapshot、browser_read_text、ボディ)は、静かに切り詰めるのではなく offset でページングされます。

The built-in agent

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

発見事項は2つの場所から得られ、その区別は重要です。エージェントは進行中に report_finding を呼び出します。そのため、ステップ制限に達した実行でも、その時点までに見つけたすべてを返します。別途、ハーネスは実行中のすべてのコンソールエラー、失敗したリクエスト、ダイアログを記録し、エージェントが言及するかどうかに関係なく、[observed by the harness] とマークして報告します。500を見逃したり、例外に言及し忘れたモデルは隠すことができません。

同じレポートは、宣言された出力スキーマに対して structuredContent として返されるため、呼び出し元のAIはテキストを解析する代わりに findings[].severity で分岐できます。タスクが成功しても発見事項がある場合があります。success はタスクが達成されたかどうかを反映し、ページがクリーンかどうかではありません。

これはAPIキーが必要な唯一の部分です。レイテンシのためデフォルトでGemini Flash Liteを使用します。Anthropicも使用できます:

Default model

Key

Google

gemini-flash-lite-latest

GOOGLE_GENERATIVE_AI_API_KEY

Anthropic

claude-haiku-4-5

ANTHROPIC_API_KEY

WUT_MODEL を設定して選択します(anthropic、google:gemini-flash-latest、または任意の provider:modelId)。セッションは browser_start の model で上書きでき、単一の呼び出しは run_task の model で上書きできます。他のすべてのツールはキーなしで動作します。

HTTP mode

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リバインディング保護が有効です。--host で範囲が広がり、その際サーバーは警告を発します。認証はなく、ポートに到達できる人は誰でもブラウザを操作し、JavaScriptを実行できます。プロキシまたはファイアウォールの背後に配置してください。

Configuration

Variable

Default

Purpose

WUT_MODEL

google:gemini-flash-lite-latest

run_task のモデル。provider[:modelId] 形式

GOOGLE_GENERATIVE_AI_API_KEY

—

Gemini 用のキー

ANTHROPIC_API_KEY

—

Anthropic 用のキー

WUT_USER_AGENT

AITester/1.0

新しいセッションのデフォルト User-Agent

WUT_HEADLESS

true

デフォルトのヘッドレスモード

WUT_IDLE_TIMEOUT_MS

1800000

この時間使用されていないセッションを閉じる

WUT_MAX_OUTPUT_CHARS

15000

ツール結果ごとの文字数上限

WUT_ACTION_TIMEOUT_MS

5000

単一の要素アクションのタイムアウト

WUT_AGENT_MAX_STEPS

20

run_task のデフォルトのステップ予算

WUT_EXECUTABLE_PATH

—

明示的な Chromium バイナリ

PLAYWRIGHT_BROWSERS_PATH

—

Playwright がブラウザを探す場所

CLIフラグ:--port、--host、--headless / --no-headless、--idle-timeout、--version、--help。

Playwright が期待する Chromium リビジョンがインストールされていないが、別のものがインストールされている場合、サーバーは失敗する代わりにそれを見つけて使用します。プリビルドコンテナで便利です。WUT_EXECUTABLE_PATH は検索を完全に上書きします。

Development

npm install
npm run build
npm test          # agent loop (mocked model) + full end-to-end suite
npm run typecheck

npm test は、スクリプト化されたモックモデルに対してエージェントループを実行し、次にビルドされたサーバーを実際のMCPクライアントとして両方のトランスポートでローカルのフィクスチャアプリに対して駆動します。参照、古い参照の処理、診断、再接続をまたいだセッションの永続化、アイドル回収をカバーします。npm run test:agent:live はさらに実際のプロバイダに対して run_task を実行し、キーが設定されていない場合はスキップします。

CIは、すべてのプッシュとプルリクエストに対して、Node 20と22で型チェック、ビルド、両方のスイートを実行します。ライブエージェントテストは、実際のAPI呼び出しを行うため、Live agent test ワークフローでオンデマンドに、そして毎週、別途実行されます。GOOGLE_GENERATIVE_AI_API_KEY または ANTHROPIC_API_KEY をリポジトリシークレットとして必要とし、スケジュールされた実行はどちらも設定されていない場合はスキップします。

License

MIT

Available Tools

26 tools
browser_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 elementA
Read-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 sessionsA
Read-only

Lists open browser sessions with their current URL, age, and idle time.

Inputs: no named parameters.

browser_list_toolsList page and DevTools toolsA
Read-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_navigateNavigateA

Navigates the session to a URL and returns the new page state plus a fresh snapshot with element refs. Relative URLs resolve against the session baseUrl.

Inputs: url (required), sessionId (required), waitUntil.

browser_networkNetwork logA
Read-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 elementsA
Read-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 textA
Read-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 detailA
Read-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_screenshotScreenshotA
Read-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 pageA
Read-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 schemaA
Read-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

    A3.8/5.0

    Scored across 26 tools

    Disambiguation4/5

    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.

    Naming Consistency4/5

    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.

    Tool Count3/5

    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.

    Completeness5/5

    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

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables 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
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables 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
      -