tauri-mcp
Drives a built Tauri app's UI over WebDriver — launch it, act like a user, inspect state, and fall back to raw JS.
Session control:
app_launch(any project viaprojectDir/appPath, plus CLIargs),app_close,app_status,app_force_cleanup; one app session at a time.Mouse:
app_clickby CSS selector or visible text/accessible name (left/right/middle, double-click),app_click_atraw coordinates for canvas UI,app_scroll,app_hover,app_dragto an element or by pixel offset.Keyboard:
app_typeinto inputs (optional Enter),app_press_keyfor any key, F1–F12, arrows, and modifier chords like Ctrl+Shift+K.Forms/widgets:
app_selectnative<select>by option text/value/index.Reading/observing:
app_snapshot(title, visible text, interactive elements + selectors),app_readone element's text/value/flags/attribute,app_wait_forselector or body text appearing/disappearing,app_console_logsfor JS errors.Visuals:
app_screenshotof the window or a single element.Windows:
app_windowresize/move/maximize/minimize/fullscreen,app_list_windows/app_switch_windowfor multi-window apps.Webview:
app_reloadresets front-end state while the Rust backend keeps its state.Escape hatch:
app_execute_jsruns arbitrary JS — read/write DOM, localStorage, or invoke any Tauri backend command via__TAURI_INTERNALS__.invoke, with real side effects and no sandboxing.Targeting advice: prefer
text(optionallyexact) over brittle positional CSS selectors.Not for: app-specific data (databases/configs) — that belongs in a separate MCP server. Note the schema also omits README tools like attach, JS polling, frame recording, log tailing, desktop screenshots, and native-dialog handling.
Drives a built Tauri app's UI over WebDriver, enabling automated interactions like clicking, typing, scrolling, screenshots, and JavaScript execution within a Tauri application.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tauri-mcp Launch the app and click the 'Start' button"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tauri-mcp
A generic MCP server that drives a built Tauri app's UI over WebDriver (tauri-driver + msedgedriver on Windows / WebKitWebDriver on Linux): launch the real app, then click, type, scroll, drag, read, and screenshot it like a human — or drop to raw JS when needed.
Not tied to any one project. Point it at any local Tauri app with projectDir
or appPath. This server only knows how to drive a window; anything
app-specific (reading an app's own database or config) belongs in a separate
server of your own.
Tools
All tools are prefixed app_ and operate on a single running session (one app
at a time).
Session
Tool | What it does |
| Launch a built Tauri app under WebDriver. |
| Attach to an app that is already running with a WebView2 remote-debugging port (Windows) instead of launching a new copy. |
| Close the session and stop tauri-driver, or detach after |
| Whether a session is running, and if so the binary + driver port. |
| Close only this server's app session and drivers; unrelated processes remain untouched. |
| Resize / move / maximize / minimize / fullscreen the window; reports resulting size+position. |
| Reload the webview (resets front-end state; backend process keeps its state). |
Acting (mouse / keyboard)
Tool | What it does |
| Click by CSS |
| Left/right/middle click at raw x,y viewport coordinates (canvas / native-drawn UI). |
| Mouse-wheel scroll by a pixel delta (+down/-up, +right/-left); optional |
| Type |
| Raw keyboard: any key — literal chars, F1-F12, arrows, Home/End/PageUp/Down, and modifier chords (Ctrl+A, Ctrl+Shift+K). |
| Hover an element (by selector or text) to trigger tooltips / hover menus. |
| Pick an option from a native |
| Drag an element onto another ( |
Reading / observing
Tool | What it does |
| Title + visible text + every visible interactive element (role, text, selector). The "what can I act on" view. |
| One element's live state: text, current input value (DOM property, reflects controlled React inputs), tag, displayed/enabled, optional attribute. |
| Poll until a selector/text appears or disappears — for async loading, toasts, dialogs. |
| Browser console output ( |
| PNG screenshot of the window, or of a single element (selector/text) for focused visual diffing. |
| Poll a JS function body until it returns something truthy: for canvas scenes, stores or backend state with no DOM text. |
| Frame timing over a duration (fps, p50/p95/max, stalls over 50 ms), optionally sampling a JS expression every frame. |
| Tail a log/trace file, or the stdout/stderr captured from the driver and app since launch. |
| Screenshot a desktop region or another program's window in physical pixels (Windows). |
| List the app's Win32 message boxes (title, text, buttons) and press a button by name (Windows). |
| List windows (handle, title, URL) and switch the active one. |
Every tool that acts on one webview also takes an optional window: a handle, or a substring of
the window's title or URL (e.g. "#settings"). The call runs there and the active window is left
unchanged, so multi-window apps do not need app_switch_window round trips.
Escape hatch
Tool | What it does |
| Run arbitrary JavaScript in the window and return the result. |
app_execute_js is unrestricted: it can read/write any DOM or JS state and
invoke any Tauri backend command directly via
await window.__TAURI_INTERNALS__.invoke("cmd_name", { arg }) (always present
in Tauri v2, regardless of withGlobalTauri) — anything the app's own frontend
can do, including commands with real side effects (writing config, filesystem,
launching processes). No sandboxing beyond what the app's own command handlers
enforce. It's also the workaround for OS-native dialogs (see below).
Related MCP server: MCP Server Tauri
Targeting elements: prefer text
app_snapshot emits positional CSS selectors like
div > div:nth-of-type(3) > button, which break the moment the DOM is
restructured. Wherever a tool takes a target, prefer text (visible text or
accessible name) — app_click({ text: "Browse" }) is how a human would say it
and survives layout changes. exact: true requires an exact match; otherwise
it tries exact text, then substring, then ARIA accessible name (covers
icon-only buttons with aria-label).
Requirements
Node 24+ and
npm installonce in this folder.tauri-driver:cargo install tauri-driver --locked.Windows: Microsoft Edge WebDriver version-matched to your installed WebView2 Runtime (Settings → About Microsoft Edge WebView2, or
HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}→pv). A mismatched major version connects fine but silently never leavesabout:blank—app_launchnow detects this and errors.winget install Microsoft.EdgeDriverdoes not reliably match; download the exact version fromhttps://msedgedriver.microsoft.com/<version>/edgedriver_win64.zipand drop it at./bin/msedgedriver.exe(checked first) or setEDGEDRIVER_PATH.Windows apps with embedded
requireAdministratormanifest trigger UAC onapp_launch. Approve prompt at desktop; elevated helper runstauri-driver, WebDriver, and app at same integrity level. Helper owns private Windows job with kill-on-close;app_closetears down only this session. Never weaken production manifest for automation.The target app must already be built, and not with plain
cargo build— a debug binary points atdevUrland only renders if a Vite dev server is up. Usecargo tauri build --debug --no-bundle(fast) orcargo tauri build --no-bundle(release).app_launchdoes not build for you.
When projectDir/appPath is omitted, app_launch uses the TAURI_PROJECT_DIR
environment variable; if that is unset too, it returns a clear error. There is
no built-in default project.
Run / verify
npm install
# point it at any built Tauri app:
TAURI_PROJECT_DIR=/path/to/tauri-project npm run verify-automation
# or:
TAURI_APP_PATH=/path/to/built/app npm run verify-automationThe verify script launches the app, snapshots it, clicks the first interactive element, screenshots, and closes.
Testing without touching real user data
Point the app at a throwaway data folder when it supports one, for example
app_launch({ projectDir, args: ["--data-dir=C:/temp/test-profile"] }), and pass any
diagnostics switches through env, e.g. env: { "MY_APP_TRACE": "C:/temp/trace.log" }, then
read them back with app_logs({ path: "C:/temp/trace.log" }).
On Windows each argument must be a single --name or --name=value switch. msedgedriver treats
app arguments as browser switches: it prefixes bare values with --, lowercases and reorders them,
so --data-dir C:/x arrives as --c:/x --data-dir. app_launch rejects bare values up front.
Attaching to a running app
Start the app yourself with a debugging port, then attach:
$env:WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS = "--remote-debugging-port=9333"
& "C:/path/to/app.exe"app_attach({ debugPort: 9333, appPath: "C:/path/to/app.exe" }). WebView2 ignores new
arguments when another instance already shares the same user-data folder, so close other copies
first. app_close detaches and leaves the app running.
OS-native dialogs
WebDriver can only see the webview DOM. On Windows, app_dialogs lists the app's message boxes
and app_dialog_click({ button: "OK" }) presses one, which unblocks launches that stall behind
a startup warning. File/folder pickers are not message boxes and remain out of reach. Workaround
for those: skip the dialog and drive the backend directly with app_execute_js, e.g.
// instead of clicking a "Choose folder" button that opens a native picker:
return await window.__TAURI_INTERNALS__.invoke("set_output_dir", { path: "/some/folder" });Troubleshooting
app_launcherrors "window never rendered" — msedgedriver/WebView2 version mismatch, or a plaincargo buildbinary. See Requirements."a session is already running" —
app_force_cleanupcloses only session owned by this MCP server; it cannot recover drivers from a prior crashed server.Selectors keep breaking — target by
textinstead (see above).
Register with Claude Code
Add it to an .mcp.json (project root, or ~/.claude.json for all projects),
then restart Claude Code. Tools then appear as tauri:app_launch, etc.
{
"mcpServers": {
"tauri": {
"command": "node",
"args": ["--no-warnings", "/absolute/path/to/tauri-mcp/index.mjs"]
}
}
}Or via the CLI:
claude mcp add tauri -- node --no-warnings /absolute/path/to/tauri-mcp/index.mjsAvailable Tools
22 toolsapp_clickA
Click an element, located by CSS selector or by text (visible text / accessible name, e.g. "Browse"). button chooses left (default), right (context menu), or middle; count 2 double-clicks.
Inputs: text, count, exact, button, +1 more.
app_click_atA
Click at raw x,y viewport coordinates instead of an element — for canvas/native-drawn UI where no element handle exists. button chooses left (default), right, or middle.
Inputs: x (required), y (required), button.
app_closeA
Close the running app session started by app_launch and stop tauri-driver.
Inputs: no named parameters.
app_console_logsA
Browser console output (console.log/warn/error + uncaught exceptions) captured since app_launch — the only way to see JS errors happening in the app.
Inputs: no named parameters.
app_dragA
Drag an element (by selector or text) onto another element, or by a pixel offset — for sliders, range inputs, reordering lists, or canvas handles. Provide to (a target with selector/text) OR offset {x,y}.
Inputs: to, text, exact, offset, +1 more.
app_execute_jsA
Run arbitrary JavaScript in the running app window and return the result. Not limited to clickable elements — read any DOM/JS state, call window functions, dispatch synthetic events, read/write localStorage, or invoke a Tauri backend command directly via await window.__TAURI_INTERNALS__.invoke("cmd_name", { arg }) (always present in Tauri v2). This can do anything the app's own frontend can do, including real side effects (writing config, filesystem, launching processes) — there is no sandboxing. script is a function body; return a value for a result, await directly for async work. Also the documented workaround for OS-native dialogs (file/folder pickers) that WebDriver can't drive: call the backend command directly instead of clicking through the dialog.
Inputs: script (required).
app_force_cleanupA
Recovery hatch: kill orphaned tauri-driver/msedgedriver processes and reset session state, for when a crashed run left things half-up and app_launch complains a session is already running. Assumes one session at a time — don't use while another session you care about is live.
Inputs: no named parameters.
app_hoverA
Move the pointer over an element (by selector or text) to trigger hover-only UI (tooltips, hover menus).
Inputs: text, exact, selector.
app_launchA
Launch a built Tauri app under WebDriver automation so it can be clicked/typed into like a real user. Pass projectDir to target any local Tauri project (resolves the binary from its src-tauri/Cargo.toml + target/release|debug); defaults to the configured default project. Only one app session runs at a time — call app_close (or app_force_cleanup) before launching another. Errors loudly if the window never renders (usual causes: msedgedriver/WebView2 version mismatch, or a plain cargo build binary that points at devUrl).
Inputs: args, appPath, projectDir.
app_list_windowsA
List open window handles for the running app (Tauri apps can have more than one window) and which one is active.
Inputs: no named parameters.
app_press_keyA
Send raw keyboard input to the running app window, not tied to any element. Every key is reachable: literal characters, plus WebDriver named keys — Enter, Tab, Escape, Backspace, Delete, Space, Home, End, PageUp, PageDown, Insert, ArrowUp/Down/Left/Right, F1-F12, and modifiers Shift/Control/Alt/Meta (Meta = Win/Cmd). Several keys in one array hold modifiers together, so ["Control","a"] is Ctrl+A and ["Control","Shift","k"] is Ctrl+Shift+K; literal text like ["h","i"] just types it.
Inputs: keys (required).
app_readA
Read one element's current state: text, live input value (DOM property, so it reflects controlled React inputs), tag, displayed/enabled flags, and optionally one attribute. For verifying a specific label/status/field value without a full app_snapshot or app_execute_js.
Inputs: text, exact, selector, attribute.
app_reloadA
Reload the webview (like the app's own refresh) to reset front-end state for a clean run. Reloads the web layer only; the Rust backend process keeps its state.
Inputs: no named parameters.
app_screenshotA
Take a PNG screenshot of the running app window, or of a single element if a selector/text target is given (for focused visual diffing of one component).
Inputs: text, exact, selector.
app_scrollA
Mouse-wheel scroll by a pixel delta. Positive deltaY scrolls down, negative up; deltaX right/left. Pass a selector to scroll over a specific scrollable pane, otherwise the viewport.
Inputs: deltaX, deltaY, selector.
app_selectA
Pick an option from a native dropdown. Locate the by selector or text, then choose the option by optionText, optionValue, or optionIndex (exactly one).
Inputs: text, exact, selector, optionText, +2 more.
app_snapshotA
Read the current app window state: page title, visible body text, and every visible interactive element (button/link/input/etc.) with its role, text/aria-label, and a CSS selector. Prefer targeting by the element's text with app_click/app_type over the positional selectors here, which are brittle. Use this instead of a screenshot when you just need to know what's on screen and actionable.
Inputs: no named parameters.
app_statusA
Report whether an app session is currently running, and if so which binary and driver port.
Inputs: no named parameters.
app_switch_windowA
Switch which window subsequent app_* calls operate on. Get handles from app_list_windows.
Inputs: handle (required).
app_typeA
Type value into an input/textarea, located by CSS selector or by text (its placeholder / accessible name). Optionally press Enter after.
Inputs: value (required), text, exact, selector, +1 more.
app_wait_forA
Poll the running app window until a selector appears/disappears, or bodyText contains/loses a substring — for async loading states, toasts, or dialogs closing — instead of manually re-polling app_snapshot.
Inputs: text, state, selector, timeoutMs.
app_windowA
Resize, move, maximize, minimize, or fullscreen the app window, and report its resulting size+position. action "set" uses width/height/x/y (any omitted axis is left unchanged); "maximize"/"minimize"/"fullscreen" ignore those. Useful for consistent screenshots or checking responsive layout.
Inputs: x, y, width, action, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool has a clearly distinct purpose, from app_click (element click) to app_click_at (coordinate click), app_type (input typing), app_read (single element state), and app_snapshot (full window state). No two tools serve overlapping roles.
All tools follow the consistent pattern 'app_verb_noun' in snake_case (e.g., app_list_windows, app_execute_js, app_force_cleanup). No mixing of conventions or chaotic naming.
With 22 tools, the set is well-scoped for automating Tauri desktop apps, covering launching, interaction, state inspection, window management, and debugging without being bloated.
The toolset covers the full lifecycle (launch/close), all major user interactions (click, type, scroll, drag, select, hover), state reading (read, snapshot, console logs), window management, and debugging (execute_js, force_cleanup). No obvious gaps for typical UI automation.
Related MCP Connectors
remote debug iOS/Android/Unity/Godot/Flutter/RN/Web on real-device.ui-tree/screenshots/taps,tests.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Automate cloud Chrome—navigate, click, type, screenshot, run code, record screen video
Drive and test your React Native and Expo apps end-to-end on iOS and Android. Supports real devices, simulators, and emulators. Snapshots, taps, typing, swipes, screenshots, deep links, reloads, builds and runtime errors.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI-driven testing and automation of Tauri desktop applications through natural language, allowing users to interact with UI elements, capture screenshots, execute commands, and test application flows without manual clicking or complex scripts.98MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to build, test, and debug Tauri v2 applications with UI automation, IPC monitoring, mobile device management, and real-time access to screenshots, DOM state, and console logs.19337MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to automate and test Tauri desktop applications through the Model Context Protocol. It provides tools for app management, UI interaction, and state inspection across multiple platforms without requiring CDP dependencies.141MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with and debug Tauri desktop applications, providing tools for window management, user input simulation, and storage operations.MIT