mcp-server-tauri

v0.14.3
io.github.Hushlor/mcp-server-tauri Checked 18 hours ago Published 1 month ago

A Model Context Protocol server for use with Tauri v2 applications

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

get_setup_instructions

Get instructions for setting up or updating the MCP Bridge plugin in a Tauri project. Call this tool when: (1) driver_session fails to connect, (2) you detect the plugin is not installed or outdated, or (3) the user asks about setup. Returns step-by-step guidance that you should follow to help the user configure their project. IMPORTANT: The instructions require you to examine the project first and ask for permission before making any changes.

list_devices

[Tauri Mobile Apps Only] List Android emulators/devices and iOS simulators. Use for Tauri mobile development (tauri android dev, tauri ios dev). Not needed for desktop-only Tauri apps or web projects.

driver_session

[Tauri Apps Only] Start/stop automation session to connect to a RUNNING Tauri app. Supports multiple concurrent app connections - each app runs on a unique port. The most recently connected app becomes the "default" app used when no appIdentifier is specified. Use action "status" to check connection state: returns single app format when 1 app connected, or array format with "isDefault" indicator when multiple apps connected. Action "stop" without appIdentifier stops ALL sessions; with appIdentifier stops only that app. The identifier field (e.g., "com.example.myapp") uniquely identifies each a…

ParameterTypeDescription
action *stringAction to perform: start or stop the session, or check status
appIdentifierstring | numberApp identifier (port number or bundle ID) to stop. Only used with action "stop". If omitted, stops all sessions.
hoststringHost address to connect to (e.g., 192.168.1.100). Falls back to MCP_BRIDGE_HOST or TAURI_DEV_HOST env vars
portnumberPort to connect to (default: 9223)

webview_find_element

[Tauri Apps Only] Find DOM elements in a running Tauri app's webview. Supports CSS selectors (default), XPath expressions, and text content matching via the strategy parameter. The "text" strategy first searches element text content, then falls back to placeholder, aria-label, and title attributes. Returns the element's HTML. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app. For browser pages or documentation sites, use Chrome DevTools MCP instead.

ParameterTypeDescription
selector *stringThe selector to find: CSS selector (default), XPath expression, text content, or ref ID (e.g., "ref=e3"). Interpretation depends on strategy.
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
strategystringSelector strategy: "css" (default) for CSS selectors, "xpath" for XPath expressions, "text" to find elements by text content, with fallback to placeholder, aria-label, and title attributes. Ref IDs (e…
windowIdstringWindow label to target (defaults to "main")

read_logs

[Tauri Apps Only] Read logs from various sources: "console" for webview JS logs, "android" for logcat, "ios" for simulator logs, "system" for desktop logs. Requires active driver_session for console logs. Use for debugging Tauri app issues at any level.

ParameterTypeDescription
source *stringLog source: "console" for webview JS logs, "android" for logcat, "ios" for simulator, "system" for desktop
appIdentifierstring | numberApp port or bundle ID for console logs. Defaults to the only connected app or the default app if multiple are connected.
filterstringRegex or keyword to filter logs
linesinteger
sincestringISO timestamp to filter logs since (e.g. 2023-10-27T10:00:00Z)
windowIdstringWindow label for console logs (defaults to "main")

webview_interact

[Tauri Apps Only] Click, scroll, swipe, focus, or perform gestures in a Tauri app webview. Supported actions: click, double-click, long-press, scroll, swipe, focus. Supports CSS selectors (default), XPath, and text content matching via the strategy parameter. Requires active driver_session. For browser interaction, use Chrome DevTools MCP instead.

ParameterTypeDescription
action *stringType of interaction to perform
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
durationnumberDuration in ms for long-press or swipe (default: 500ms for long-press, 300ms for swipe)
fromXnumberStarting X coordinate for swipe
fromYnumberStarting Y coordinate for swipe
scrollXnumberHorizontal scroll amount in pixels (positive = right)
scrollYnumberVertical scroll amount in pixels (positive = down)
selectorstringElement selector: CSS selector (default), XPath expression, text content, or ref ID (e.g., "ref=e3")
strategystringSelector strategy: "css" (default) for CSS selectors, "xpath" for XPath expressions, "text" to find elements by text content, with fallback to placeholder, aria-label, and title attributes. Ref IDs (e…
toXnumberEnding X coordinate for swipe
toYnumberEnding Y coordinate for swipe
windowIdstringWindow label to target (defaults to "main")
xnumberX coordinate for direct coordinate interaction
ynumberY coordinate for direct coordinate interaction

webview_screenshot

[Tauri Apps Only] Screenshot a running Tauri app's webview. Requires active driver_session. Captures only visible viewport. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app. For browser screenshots, use Chrome DevTools MCP instead. For Electron apps, this will NOT work.

ParameterTypeDescription
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
filePathstringFile path to save the screenshot to instead of returning as base64
formatstringImage format
maxWidthintegerMaximum width in pixels. Images wider than this will be scaled down proportionally. Can also be set via TAURI_MCP_SCREENSHOT_MAX_WIDTH environment variable.
qualitynumberJPEG quality (0-100, only for jpeg format)
windowIdstringWindow label to target (defaults to "main")

native_dialog_snapshot

[Windows Tauri Apps Only] Discover native message, confirmation, Open, or Save dialogs in the ownership chain of a targeted Tauri window. Returns a bounded semantic UI Automation snapshot with ownership depth, navigation and file-system controls, automation IDs, semantic roles, supported patterns, and ephemeral elementRef values. Set minOwnerDepth to 2 to wait for a child confirmation such as Save overwrite. Requires an active driver_session and an interactive Windows desktop. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID…

ParameterTypeDescription
appIdentifierstring | numberApp identifier (port or bundle ID) when multiple Tauri apps are connected
minOwnerDepthintegerMinimum owner-chain depth to return: 1 for direct dialogs, 2 for confirmations owned by another dialog
timeoutMsintegerBounded time to wait for the native operation, from 100 to 10000 milliseconds
windowIdstringTauri window label whose owned native dialog chain should be targeted

native_dialog_interact

[Windows Tauri Apps Only] Interact with an elementRef from the latest native_dialog_snapshot using UI Automation InvokePattern, ValuePattern, or SelectionItemPattern. Use invoke for dialog buttons, setValue with a complete absolute file or folder path, setPaths with complete absolute existing file paths for multi-select Open dialogs, and select for advertised navigation or file-system controls. References are session-bound, expire after 30 seconds, and are otherwise ephemeral; take a new snapshot after a stale-reference error. Requires an active driver_session and an interactive Windows deskto…

webview_keyboard

[Tauri Apps Only] Type text or send keyboard events in a Tauri app. The selector parameter (for "type" action) supports CSS selectors (default), XPath, and text content matching via the strategy parameter. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app. For browser keyboard input, use Chrome DevTools MCP instead.

ParameterTypeDescription
action *stringKeyboard action type: "type" for typing text into an element, "press/down/up" for key events
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
keystringKey to press (required for "press/down/up" actions, e.g., "Enter", "a", "Escape")
modifiersarrayModifier keys to hold
selectorstringElement selector for element to type into (required for "type" action): CSS selector (default), XPath, text content, or ref ID
strategystringSelector strategy: "css" (default) for CSS selectors, "xpath" for XPath expressions, "text" to find elements by text content, with fallback to placeholder, aria-label, and title attributes. Ref IDs (e…
textstringText to type (required for "type" action)
windowIdstringWindow label to target (defaults to "main")

webview_wait_for

[Tauri Apps Only] Wait for elements, text, or IPC events in a Tauri app. When type is "selector", supports CSS (default), XPath, and text strategies via the strategy parameter. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app. For browser waits, use Chrome DevTools MCP instead.

ParameterTypeDescription
type *stringWhat to wait for
value *stringSelector, text content, or IPC event name to wait for
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
strategystringSelector strategy (applies when type is "selector"): "css" (default), "xpath", or "text".
timeoutnumberTimeout in milliseconds (default: 5000ms)
windowIdstringWindow label to target (defaults to "main")

webview_get_styles

[Tauri Apps Only] Get computed CSS styles from elements in a Tauri app. Supports CSS selectors (default), XPath, and text content matching via the strategy parameter. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app. For browser style inspection, use Chrome DevTools MCP instead.

ParameterTypeDescription
selector *stringElement selector: CSS selector (default), XPath expression, text content, or ref ID
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
multiplebooleanWhether to get styles for all matching elements (true) or just the first (false)
propertiesarraySpecific CSS properties to retrieve. If omitted, returns all computed styles
strategystringSelector strategy: "css" (default) for CSS selectors, "xpath" for XPath expressions, "text" to find elements by text content, with fallback to placeholder, aria-label, and title attributes. Ref IDs (e…
windowIdstringWindow label to target (defaults to "main")

webview_execute_js

[Tauri Apps Only] Execute JavaScript in a Tauri app's webview context. Requires active driver_session. Has access to window.__TAURI__. If you need a return value, it must be JSON-serializable. For functions that return values, use an IIFE: "(() => { return 5; })()" not "() => { return 5; }". Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app. For browser JS execution, use Chrome DevTools MCP instead.

ParameterTypeDescription
script *stringJavaScript code to execute in the webview context. If returning a value, it must be JSON-serializable. For functions that return values, use IIFE syntax: "(() => { return value; })()" not "() => { ret…
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
argsarrayArguments to pass to the script
windowIdstringWindow label to target (defaults to "main")

webview_dom_snapshot

[Tauri Apps Only] Get a structured DOM snapshot of a Tauri app's webview. Supports different snapshot types for AI consumption. The "accessibility" type returns a YAML representation of the accessibility tree similar to Playwright's aria snapshots, including roles, names, states, and element refs. Use this for understanding UI semantics, finding interactive elements, or accessibility testing. The "structure" type returns a YAML representation of the DOM hierarchy with element tag names, IDs, CSS classes, and data-testid attributes (if present). Use this for understanding page layout, debugging…

ParameterTypeDescription
type *stringSnapshot type
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
selectorstringSelector to scope the snapshot: CSS selector (default), XPath, text content, or ref ID. If omitted, snapshots entire document.
strategystringSelector strategy: "css" (default) for CSS selectors, "xpath" for XPath expressions, "text" to find elements by text content, with fallback to placeholder, aria-label, and title attributes. Ref IDs (e…
windowIdstringWindow label to target (defaults to "main")

webview_select_element

[Tauri Apps Only] Activates an element picker overlay in the Tauri app. The user visually selects an element by clicking it, and the tool returns rich element metadata (tag, id, classes, attributes, text, bounding rect, CSS selector, computed styles, parent chain) plus an annotated screenshot with the element highlighted. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app.

ParameterTypeDescription
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
timeoutnumberTimeout in ms for user to pick an element (5000-120000, default 60000)
windowIdstringWindow label to target (defaults to "main")

webview_get_pointed_element

[Tauri Apps Only] Retrieves element metadata for an element the user previously pointed at via Alt+Shift+Click in the Tauri app. Returns the same rich metadata as webview_select_element (tag, id, classes, attributes, text, bounding rect, CSS selector, computed styles, parent chain) plus an annotated screenshot. The user must Alt+Shift+Click an element first before calling this tool. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app.

ParameterTypeDescription
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
windowIdstringWindow label to target (defaults to "main")

ipc_execute_command

[Tauri Apps Only] Execute Tauri IPC commands (invoke Rust backend functions). Requires active driver_session. This is Tauri-specific IPC, not browser APIs. For Electron IPC or browser APIs, use appropriate tools for those frameworks.

ParameterTypeDescription
command *string
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
args

ipc_monitor

[Tauri Apps Only] Monitor Tauri IPC calls between frontend and Rust backend. Requires active driver_session. Captures invoke() calls and responses. This is Tauri-specific; for browser network monitoring, use Chrome DevTools MCP.

ParameterTypeDescription
action *stringAction to perform: start or stop IPC monitoring
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.

ipc_get_captured

[Tauri Apps Only] Get captured Tauri IPC traffic (requires ipc_monitor started). Shows captured commands (invoke calls) and events with arguments and responses. For browser network requests, use Chrome DevTools MCP instead.

ParameterTypeDescription
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
filterstringFilter events by command name

ipc_emit_event

[Tauri Apps Only] Emit a Tauri event to test event handlers. Requires active driver_session. Events are Tauri-specific (not DOM events). For browser DOM events, use Chrome DevTools MCP instead.

ParameterTypeDescription
eventName *string
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
payload

ipc_get_backend_state

[Tauri Apps Only] Get Tauri backend state: app metadata, Tauri version, environment. Requires active driver_session. Use to verify you're connected to a Tauri app and get app info.

ParameterTypeDescription
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.

manage_window

[Tauri Apps Only] Manage Tauri windows. Actions: "list" - List all windows with labels, titles, URLs, and state. "info" - Get detailed info for a window (size, position, title, focus, visibility). "resize" - Resize a window (requires width/height, uses logical pixels by default). Requires active driver_session. For browser windows, use Chrome DevTools MCP instead.

ParameterTypeDescription
action *stringAction: "list" all windows, get "info" for one window, or "resize" a window
appIdentifierstring | numberApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
heightintegerHeight in pixels (required for "resize" action)
logicalbooleanUse logical pixels (true, default) or physical pixels (false). Only for "resize"
widthintegerWidth in pixels (required for "resize" action)
windowIdstringWindow label to target (defaults to "main"). Required for "info", optional for "resize"