Enables automated testing and interaction with Tauri desktop applications, providing tools to launch and stop apps, capture screenshots, navigate URLs, retrieve logs, and automate UI actions like clicking or filling input fields.
Click on "Install 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-plugin-mcplaunch the app and take a screenshot of the landing page"
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-plugin-mcp
Cross-platform Tauri test automation plugin via MCP (Model Context Protocol).
Enables AI assistants like Claude to interact with your Tauri desktop app for testing and automation.
Features
Cross-platform: Windows (Named Pipes) + macOS/Linux (Unix Sockets)
No CDP dependency: Works on all WebView backends including macOS WKWebView
MCP integration: Direct integration with Claude Code and other MCP clients
Prerequisites
Node.js >= 18
Tauri v2.x
pnpm (recommended) or npm
Rust with cargo
Quick Start
Add Rust plugin to
src-tauri/Cargo.tomlInstall npm package:
pnpm add github:DaveDev42/tauri-plugin-mcp#mainRegister plugin in
src-tauri/src/lib.rsAdd
mcp:defaultpermissionInitialize bridge in
main.tsxCreate
.mcp.jsonfor Claude Code
Installation
1. Rust Plugin (src-tauri/Cargo.toml)
2. Frontend API (package.json)
3. MCP Server
The MCP server is included in the package at:
Setup
1. Register the plugin (src-tauri/src/lib.rs)
2. Add permissions
Option A: In tauri.conf.json or config/*.json5 (recommended)
Option B: Separate file (src-tauri/capabilities/default.json)
3. Initialize the bridge (main.tsx)
MCP Server Configuration
Add to .mcp.json in your project root:
Available Tools
Tool | Parameters | Description |
| - | Check if app is running |
|
| Launch Tauri app via |
| - | Stop the app |
| - | Get accessibility tree (returns ref numbers) |
|
| Click element by ref or CSS selector |
|
| Fill input field |
|
| Press keyboard key |
|
| Navigate to URL |
| - | Take screenshot (uses html2canvas) |
|
| Execute custom JavaScript |
| - | Get console logs |
| - | Get network logs |
Using features parameter
To launch with Cargo features:
This runs: pnpm tauri dev --features my_feature
Usage Example
Typical testing workflow:
How It Works
Rust Plugin creates IPC server (Unix socket or Windows named pipe)
MCP Server connects to IPC and exposes tools to Claude
JS Bridge (
initMcpBridge()) enables DOM operations in WebView
Socket Paths
Unix:
{project_root}/.tauri-mcp.sockWindows:
\\.\pipe\tauri-mcp-{hash}(hash derived from project path)
Troubleshooting
"MCP bridge not initialized"
The JS bridge isn't running. Check:
initMcpBridge()is called in your frontend codeApp is running in dev mode (
import.meta.env.DEV)Check browser console for initialization errors
Socket connection failed
Ensure the app is running (
launch_appfirst)On Windows, check pipe path in logs:
[tauri-plugin-mcp] full_path: \\.\pipe\tauri-mcp-XXXXXOn Unix, check if
.tauri-mcp.sockexists in project root
App launch timeout
Increase
timeout_secs(default: 60)Check if
pnpm tauri devworks manuallyLook for build errors in terminal output
snapshot returns empty
Wait for app to fully load (use
wait_for_ready: true)Check if bridge initialized (look for
[MCP]logs in console)
License
MIT OR Apache-2.0