Mcp Server Tauri

io.github.hypothesi由 GitHub 帳號 hypothesi 發布v0.13.2更新於 Oct 29, 2026

A Model Context Protocol server for use with Tauri v2 applications

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

一個 MCP 伺服器,讓 AI 助理透過 WebSocket 橋接外掛操控、檢視並偵錯執行中的 Tauri v2 桌面與行動應用程式。

可以做什麼
  • 啟動、停止並查看針對一個或多個執行中 Tauri 應用程式的自動化工作階段,可用連接埠或 bundle ID 指定目標
  • 尋找元素、點擊、輸入、捲動、等待元素或事件、擷取 webview 截圖,並讀取 DOM 或無障礙快照
  • 在 webview 中執行 JavaScript、讀取計算樣式,並使用視覺化元素挑選器或 Alt+Shift+點擊取元素
  • 執行 Tauri IPC 指令、監控並取得擷取的 IPC 流量、發出事件,以及讀取後端應用程式狀態
  • 管理視窗(列出、資訊、調整大小、聚焦),讀取主控台、Android、iOS 與系統日誌,並列出 Android 模擬器與 iOS 模擬器
  • 取得安裝或更新 MCP Bridge 外掛的設定說明
適用情境
適合在開發 Tauri v2 應用程式時,讓助理針對執行中的建置重現介面流程、檢視元素、偵錯 IPC 呼叫或查看日誌,而不是只憑原始碼推測。也適用於需要列出模擬器與仿真器的 Tauri 行動開發。
執行需求
透過 npm 套件 @hypothesi/tauri-mcp-server 以 stdio 在本機執行(需要 Node.js)。Tauri 應用程式需整合 tauri-plugin-mcp-bridge Rust 外掛,且應用程式需在執行中、橋接可透過 WebSocket 連接埠存取。僅支援桌面端;未宣告帳號、API 金鑰或環境變數。
安裝前請注意
助理可在應用程式 webview 中執行 JavaScript 並呼叫 Tauri IPC 指令,可能變更應用程式資料或觸發後端副作用,也可調整視窗大小與聚焦。依設定範例,橋接外掛應只在偵錯建置中啟用。它透過 WebSocket 連接本機執行的應用程式,該連接埠需可信。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Mcp Server Tauri,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

@hypothesi/tauri-mcp-server

[npm version] [License: MIT]

A Model Context Protocol (MCP) server that enables AI assistants like Claude, Cursor, and Windsurf to build, test, and debug Tauri® v2 applications.

📖 Full Documentation

Features

CategoryCapabilities
🎯 UI AutomationScreenshots, clicks, typing, scrolling, element finding, visual element picker
🔍 IPC MonitoringCapture and inspect Tauri IPC calls in real-time
📱 Mobile DevList Android emulators & iOS simulators
📋 LogsStream console, Android logcat, iOS, and system logs

Quick Start

1. Add the MCP Bridge Plugin to Your Tauri App

bash
cargo add tauri-plugin-mcp-bridge
rust
// src-tauri/src/main.rsfn main() {    let mut builder = tauri::Builder::default();
    #[cfg(debug_assertions)]    {        builder = builder.plugin(tauri_plugin_mcp_bridge::init());    }
    builder        .run(tauri::generate_context!())        .expect("error while running tauri application");}

Note: The npm package @hypothesi/tauri-plugin-mcp-bridge is optional—only needed if you want to call the plugin from your app's frontend code. The MCP server communicates with the Rust plugin directly via WebSocket.

2. Configure Your AI Assistant

Use aix to add the server to your AI assistant:

bash
npx -y @a1st/aix add mcp tauri --command 'npx @hypothesi/tauri-mcp-server' --user

Supported clients: claude-code, cursor, windsurf, vscode, cline, roo-cline, claude, zed, goose, warp, codex

Terminal CLI

If you want to call the same tools directly from a shell, install the companion CLI package:

bash
npm install -g @hypothesi/tauri-mcp-clitauri-mcp driver-session start --port 9223tauri-mcp driver-session status --json

The CLI keeps the underlying MCP server warm in the background so stateful commands such as driver_session work across separate invocations.

Multi-App Support

The MCP server supports connecting to multiple Tauri apps simultaneously. Each app runs on a unique port, and the most recently connected app becomes the "default" app.

Key Features:

  • Connect to multiple apps on different ports
  • Default app used when no appIdentifier specified
  • Target specific apps using port number or bundle ID
  • Stop individual sessions or all sessions at once

Example Usage:

javascript
// Connect to first appawait driver_session({ action: "start", port: 9223 })
// Connect to second appawait driver_session({ action: "start", port: 9224 })
// Check status - shows both apps with default indicatorawait driver_session({ action: "status" })
// Use default app (most recent - port 9224)await webview_screenshot()
// Target specific app by portawait webview_screenshot({ appIdentifier: 9223 })
// Stop specific appawait driver_session({ action: "stop", appIdentifier: 9223 })
// Stop all appsawait driver_session({ action: "stop" })

Available Tools (20 total)

Setup & Configuration

ToolDescription
get_setup_instructionsGet setup/update instructions for the MCP Bridge plugin

UI Automation

ToolDescription
driver_sessionStart/stop/status automation session
webview_find_elementFind elements by CSS selector, XPath, text, or ref ID
read_logsRead console, Android, iOS, or system logs
webview_interactClick, scroll, swipe, focus, long-press
webview_screenshotCapture webview screenshots (JPEG default)
webview_keyboardType text or send key events
webview_wait_forWait for elements, text, or events
webview_get_stylesGet computed CSS styles
webview_execute_jsExecute JavaScript in webview
webview_dom_snapshotGet structured DOM snapshot (accessibility or structure)
webview_select_elementVisual element picker — user clicks an element, returns metadata + screenshot
webview_get_pointed_elementGet metadata for element user Alt+Shift+Clicked
manage_windowList windows, get info, or resize

IPC & Plugin

ToolDescription
ipc_execute_commandExecute Tauri IPC commands
ipc_get_backend_stateGet app metadata and state
ipc_monitorStart/stop IPC monitoring
ipc_get_capturedGet captured IPC traffic
ipc_emit_eventEmit custom events

Mobile Development

ToolDescription
list_devicesList Android devices and iOS simulators

Links

License

MIT © hypothesi


Trademark Notice

TAURI® is a registered trademark of The Tauri Programme within the Commons Conservancy. https://tauri.app/

This project is not affiliated with, endorsed by, or sponsored by The Tauri Programme within the Commons Conservancy.

來源:packages/mcp-server/README.md,提交 4451b2b

工具

19

get_setup_instructions

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

List Mobile 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

Manage Tauri 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 app. REQUIRED before using other webview_* or ipc_* tools. Connects via WebSocket to the MCP Bridge plugin in the Tauri app. For browser automation, use Chrome DevTools MCP instead. For Electron apps, this tool will NOT work.

輸入參數hostportaction必填appIdentifier

webview_find_element

Find Element in Tauri Webview

[Tauri Apps Only] Find elements in a running Tauri app's webview and return their geometry, text, accessible name, attributes, visibility, and optionally their computed styles. Supports CSS selectors (default), XPath expressions, and text content matching via the strategy parameter. The "text" strategy searches element text content (not just direct text nodes), prefers exact matches over substring matches, prefers innermost elements, and prefers interactive ancestors. Returns structured JSON with totalMatches, returned count, and array of matches each containing: nth index, ref ID, tag, trimmed text, accessible name, attributes, bounding rect, visibility, interactability, optional computed styles, and optional truncated outerHTML. Use this instead of webview_execute_js for querySelector, getBoundingClientRect, textContent, and getComputedStyle reads. 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.

輸入參數nthlimitselector必填strategywindowIdpropertiesincludeHtmlvisibleOnlyappIdentifier

read_logs

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.

輸入參數levellinessincefiltersource必填maxCharswindowIdappIdentifiermaxCharsPerEntry

webview_interact

Interact with Tauri Webview

[Tauri Apps Only] Click, hover, right-click, scroll, swipe, focus, or perform gestures in a Tauri app webview. Supported actions: click, double-click, long-press, scroll, swipe, focus, hover, right-click. Supports CSS selectors (default), XPath, and text content matching via the strategy parameter. When using a text selector that matches multiple visible elements, you must provide the nth parameter to disambiguate, or the tool will throw an error listing the candidates. Requires active driver_session. For browser interaction, use Chrome DevTools MCP instead.

輸入參數xynthtoXtoYfromXfromYaction必填scrollXscrollYdurationselector另有 3 個

webview_screenshot

Screenshot Tauri Webview

[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.

輸入參數formatqualityfilePathmaxWidthwindowIdappIdentifierallowScreenCapture

webview_keyboard

Keyboard Input in Tauri

[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.

輸入參數keynthtextaction必填selectorstrategywindowIdmodifiersappIdentifier

webview_wait_for

Wait for Condition in Tauri

[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.

輸入參數type必填value必填timeoutstrategywindowIdappIdentifier

webview_execute_js

Execute JS in Tauri Webview

[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; }". Accepts an optional timeout parameter (milliseconds) for long-running scripts. Timeout errors will identify which layer timed out (transport, script self-race, or Rust eval). 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.

輸入參數argsscript必填timeoutwindowIdappIdentifier

webview_dom_snapshot

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 CSS selectors, or locating elements by class/ID. Use the optional selector parameter to scope the snapshot to a subtree. The selector supports CSS (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.

輸入參數type必填selectorstrategywindowIdappIdentifier

webview_select_element

Select Element (Visual Picker)

[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.

輸入參數timeoutwindowIdappIdentifier

webview_get_pointed_element

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.

輸入參數windowIdappIdentifier

ipc_execute_command

Execute Tauri IPC Command

[Tauri Apps Only] Execute Tauri IPC commands (invoke Rust backend functions). Requires active driver_session. This is Tauri-specific IPC, not browser APIs. Plugin commands (plugin:mcp-bridge|*) are routed through the bridge; all other commands are executed via the webview using window.__TAURI_INTERNALS__.invoke, which keeps the application's Tauri capability rules in force. For Electron IPC or browser APIs, use appropriate tools for those frameworks.

輸入參數argscommand必填windowIdappIdentifier

ipc_monitor

Monitor Tauri IPC

[Tauri Apps Only] Monitor Tauri IPC calls between frontend and Rust backend. Requires active driver_session. Captures invoke() calls made through window.__TAURI__.core. Bridge-internal commands (plugin:mcp-bridge|*) are excluded from capture. This is Tauri-specific; for browser network monitoring, use Chrome DevTools MCP.

輸入參數action必填appIdentifier

ipc_get_captured

Get Captured IPC Traffic

[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.

輸入參數filterappIdentifier

ipc_emit_event

Emit Tauri 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.

輸入參數payloadeventName必填appIdentifier

ipc_get_backend_state

Get Tauri 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.

輸入參數appIdentifier

manage_window

Manage Tauri 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). "focus" - Focus a window (bring to front). "minimize" - Minimize a window. "maximize" - Maximize a window. Desktop-only actions (focus, minimize, maximize) require tauri-plugin-mcp-bridge 0.13.0+ and return a version error on older plugins. Requires active driver_session. For browser windows, use Chrome DevTools MCP instead.

輸入參數widthaction必填heightlogicalwindowIdappIdentifier

版本歷史

3
  1. v0.13.2最新Oct 22, 2026
  2. v0.13.1Oct 9, 2026
  3. v0.13.0Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分