Skip to main content
Glama

CI Dependency audit Cargo deny OSV-Scanner Trivy Release Docker Hub MIT License macOS Linux Windows Documentation

Bruster is an open-source Rust browser automation tool and Model Context Protocol (MCP) server. Control native webviews from AI agents, Python scripts, or your own test runner through MCP or a JSON-lines API. No Node.js required.

Documentation · UI testing · MCP setup · Compare with Playwright · Benchmarks · Releases

Navigate pages, inspect the DOM, fill forms, take screenshots, and manage tabs and persistent sessions on macOS (WKWebView), Linux (WebKitGTK), and Windows (WebView2). Bruster fits native-webview scripts, focused smoke tests, and agent-driven workflows. Run .bru tests with the built-in runner or use your own.

For AI tools: documentation index · full CLI and API reference.

Demo

Bruster filling a form and taking a screenshot through MCP

Scripted MCP session with real WebKitGTK captures. Try the demo.

Related MCP server: mcp-browser

Install

On macOS and Linux:

curl -fsSL https://raw.githubusercontent.com/aliilyas/bruster/main/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"

Linux also needs WebKitGTK 4.1. On Ubuntu or Debian:

sudo apt install libwebkit2gtk-4.1-0

Without a desktop display, also install xvfb and xauth. Other Linux distributions.

On Windows, download an archive from Releases and install the WebView2 runtime.

Docker Hub

The Docker image includes the Linux browser runtime and virtual display for amd64 and arm64:

docker run --rm -i ilyastmn/bruster:latest

Starts an MCP server over stdio. Docker client setup.

MCP

Add this server to Claude Desktop's claude_desktop_config.json or Cursor's .cursor/mcp.json:

{
  "mcpServers": {
    "bruster": {
      "command": "bruster",
      "args": ["--mcp", "--quiet"]
    }
  }
}

Use the executable's absolute path if your client cannot find bruster. Add --visible to watch the browser or --profile ./profile to save cookies and storage.

Setup for other clients and troubleshooting.

JSON lines

Run bruster, then send requests on stdin, waiting for each response before the next request:

{"id":1,"method":"navigate","params":{"url":"https://example.com"}}
{"id":2,"method":"snapshot","params":{"format":"text"}}
{"id":3,"method":"screenshot","params":{"path":"example.png"}}
{"id":4,"method":"close"}

Responses carry the matching id; page events also arrive on stdout. Protocol and API reference.

UI tests with the .bru DSL

Bruster includes a compact, line-oriented DSL for repeatable UI checks. It handles browser startup, waits, assertions, and failure evidence so you can focus on the flow being tested. Write a login.bru file:

base_url "http://localhost:3000"

test "opens the dashboard"
  navigate "/login"
  fill "#email" "tester@example.com"
  fill "#password" "test-password"
  click "button[type=submit]"
  expect url "/dashboard"
  expect text "h1" "Dashboard"
end

Run bruster test login.bru. Assertions retry until their deadline; each test gets a fresh browser and profile. Failures include source lines, screenshots, and page diagnostics. The runner writes a JSON report and returns a nonzero exit code on failure. No Node.js or Python is needed to run tests.

Use before_each for shared setup and --base-url to run the same tests against another environment. The time savings are in authoring and debugging tests.

The runner is available in source builds from main; older release binaries may not include bruster test yet.

UI testing guide · Beginner course: 20 lessons · DSL reference · Runnable local example · Website and demo example tests · Web automation testing tutorial

Limitations

Bruster uses WKWebView on macOS, WebKitGTK on Linux, and WebView2 on Windows. Input events are synthetic; cross-origin iframes and OS-level controls aren't supported. See the full limitations when choosing a browser backend.

Development

Build with cargo build --release --locked. See Contributing for dependencies, tests, and documentation changes.

Dependency security checks: daily RustSec, cargo-deny, OSV-Scanner, and Trivy scans, plus Dependabot and Socket setup.

License

MIT

Available Tools

43 tools
attrC

Attribute value of an element.

Inputs: name (required), ref, tab, selector, +1 more.

backD

History back.

Inputs: tab.

checkC

Set a checkbox or radio.

Inputs: ref, tab, force, checked, +3 more.

clickB

Click an element, or a viewport point with x,y. Waits until it is visible, enabled and not covered; force skips that.

Inputs: x, y, ref, tab, +4 more.

closeA

Shut down Bruster, closing all tabs and the stdio server. Use close_tab to close only one tab.

Inputs: tab.

close_tabA

Close a tab; the last tab cannot be closed (use close to shut down).

Inputs: tab.

consoleC

Console messages and page errors since the last navigation.

Inputs: tab, clear, request_timeout.

cookiesD

All cookies.

Inputs: tab.

countC

Number of elements matching a selector.

Inputs: selector (required), tab, request_timeout.

darkA

Persist dark color-scheme for all existing and future pages.

Inputs: tab.

dialogB

Set how alert/confirm/prompt are answered from now on, and list dialogs seen so far.

Inputs: tab, text, clear, accept, +1 more.

dragC

Drag one element onto another (HTML5 drag events).

Inputs: to (required), from (required), tab, request_timeout.

evalC

Evaluate a JavaScript expression in the page.

Inputs: expression (required), tab, request_timeout.

fillC

Set an input's value (fires input/change).

Inputs: value (required), ref, tab, force, +3 more.

fill_formB

Fill several fields at once: [{selector|ref, value}]. Checkboxes take a boolean, selects a value or array.

Inputs: fields (required), tab, request_timeout.

findC

Snapshot narrowed to elements whose name, text, value or href contains text or matches regex.

Inputs: max, tab, text, boxes, +4 more.

forwardD

History forward.

Inputs: tab.

hoverC

Hover an element.

Inputs: ref, tab, force, timeout, +2 more.

htmlC

outerHTML of an element.

Inputs: ref, tab, selector, request_timeout.

lightB

Persist light color-scheme for all existing and future pages.

Inputs: tab.

maximizeA

Maximize this window and persist the requested mode for future runs. Hidden windows only persist the mode.

Inputs: tab.

minimizeB

Hide this native window and persist minimized mode. Hidden windows stay off-screen and only persist the mode.

Inputs: tab.

networkC

Requests made by the page: fetch, xhr and resources. index feeds network_request.

Inputs: tab, clear, request_timeout.

network_requestC

Headers and body prefix of one fetch/xhr entry from network.

Inputs: index (required), tab, request_timeout.

new_tabA

Open a new tab, optionally at a URL. Returns its id; use switch_tab to make it current.

Inputs: tab, url, timeout.

pressB

Press a key, e.g. Enter, Escape, Tab, Control+a.

Inputs: key (required), ref, tab, selector, +1 more.

rectB

Bounding box of an element (for screenshot clip).

Inputs: ref, tab, selector, request_timeout.

reloadC

Reload the page.

Inputs: tab.

resizeC

Resize the viewport.

Inputs: width (required), height (required), tab.

screenshotA

PNG of the viewport. full=true for the whole page, or clip={x,y,width,height}. path writes the file instead of returning it.

Inputs: tab, clip, full, path.

scrollC

Scroll an element into view, or by x/y.

Inputs: x, y, ref, tab, +2 more.

selectC

Choose option(s) in a .

Inputs: value (required), ref, tab, force, +3 more.

snapshotA

List visible elements and text with refs usable in other tools, one per line: ref role "name" href=... selector scopes to a subtree, max caps the list, boxes adds rects, format=json for objects.

Inputs: max, tab, boxes, format, +2 more.

switch_tabB

Make a tab the default for later calls.

Inputs: tab (required).

tabsC

List open tabs.

Inputs: tab.

textB

innerText of an element, truncated to max characters.

Inputs: max, ref, tab, selector, +1 more.

titleC

Page title.

Inputs: tab, request_timeout.

typeB

Type text key by key into an element. submit presses Enter afterwards.

Inputs: text (required), ref, tab, delay, +5 more.

uploadC

Set files on a file input from local paths.

Inputs: paths (required), ref, tab, selector, +1 more.

urlD

Current URL.

Inputs: tab, request_timeout.

wait_forB

Wait for selector state (visible/attached/hidden), text present or gone, url substring, network idle, or time ms.

Inputs: ref, tab, url, idle, +7 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 43 tools

    Disambiguation4/5

    Most tools target clearly distinct actions or resources, and descriptions help separate close pairs like snapshot/find and cookies/set_cookie. There is some overlap among low-level inspection tools (text, html, attr, rect, count), but boundaries are generally clear.

    Naming Consistency3/5

    The set uses snake_case consistently but mixes verb commands (click, fill_form, wait_for) with bare noun getters (cookies, url, title, network, console, dialog). It remains readable and category-consistent, but it is not a predictable verb_noun pattern throughout.

    Tool Count2/5

    At 43 tools, the surface is heavy for a single browser automation server, exceeding the typical 3-15 well-scoped range. Many commands are useful, but several low-level inspection tools could reasonably be consolidated.

    Completeness4/5

    Coverage is broad: navigation, interaction, DOM inspection, screenshots, network, console, cookies, tabs, and window controls are all present. Gaps remain around iframe/frame switching and explicit download or request-interception handling, but core workflows are covered.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      single-binary MCP server that gives AI agents a browser. 66 tools for navigation, form filling, data extraction, screenshots, and DOM diffing — built on pure Chrome DevTools Protocol.
      14
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Native macOS browser (SwiftUI + WKWebView) that exposes an MCP server in-process so AI agents can drive a real local browser with the user's existing logged-in sessions. ~40 tools (navigate, click, fill, screenshot, eval_js, network log, accessibility tree). Local-only with bearer-token auth.
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A lightweight 30KB MCP browser automation server that uses raw Chrome DevTools Protocol to enable AI agents to browse the web, take screenshots, interact with elements, and capture live page events like console logs and network requests.
      41
      338 npm
      20
      MIT

    Appeared in Searches