The MCP Tauri Automation server enables AI models like Claude to test, debug, and automate Tauri desktop applications through natural language commands.
Application Management: Launch and close Tauri apps with optional environment variables and command-line arguments, and check current application state and session information.
UI Interaction: Click elements and type text into input fields using CSS selectors, wait for elements to appear with configurable timeouts for async content, and extract text content from UI elements.
Visual Testing: Capture screenshots of the application window as base64-encoded PNG data or save them to disk with custom or auto-generated filenames.
Backend Integration: Execute custom Tauri IPC commands exposed in your Rust backend code with optional arguments for complex operations.
Use Cases: Automate testing workflows, debug visual issues, verify backend responses, perform regression testing, and test complete end-to-end scenarios combining UI interactions and backend calls.
Enables automation and testing of Tauri desktop applications through natural language commands, providing tools for launching apps, clicking UI elements, capturing screenshots, typing text, waiting for elements, reading element text, executing Tauri IPC commands, and checking app state via WebDriver protocol.
MCP Tauri Automation
Automate Tauri desktop apps with AI. An MCP server that lets Claude Code test, debug, and interact with your Tauri applications through natural language.
What is this?
Testing Tauri apps usually means:
❌ Manually clicking through UIs for every change
❌ Writing complex test scripts for simple interactions
❌ Taking screenshots manually to debug visual issues
❌ Switching between code editor and running app constantly
With this MCP server:
✅ Ask Claude to "click the submit button and check the result"
✅ Get instant screenshots of your app state
✅ Test UI flows through natural language
✅ Automate repetitive testing while you code
Quick Start
1. Install tauri-driver
2. Install this MCP server
3. Add to your MCP config
Use the Claude Code CLI to register the server:
Replace /absolute/path/to/mcp-tauri-automation with the actual path where you cloned this repo. For example:
Linux/macOS:
~/projects/mcp-tauri-automation/dist/index.jsWindows:
C:/Users/YourName/projects/mcp-tauri-automation/dist/index.js
Optional: Set a default app path
If you mainly work with one Tauri app, you can set it as the default:
💡 Can I test multiple apps? Yes! The
TAURI_APP_PATHis just a convenience default. You can still launch any other Tauri app by specifying its path when you ask Claude (e.g., "Launch my calculator app at ~/projects/calculator-app/target/debug/calculator").
Advanced: Customize defaults
All environment variables have sensible defaults and are optional:
TAURI_APP_PATH: No default (specify when launching, or set here for convenience)TAURI_SCREENSHOT_DIR:./screenshots(relative to where you run Claude Code)TAURI_WEBDRIVER_PORT:4444(where tauri-driver listens)TAURI_DEFAULT_TIMEOUT:5000ms (how long to wait for UI elements)
Managing servers:
Alternative: JSON format
Scope options:
--scope user: Available to you across all projects (recommended)--scope local(default): Available only to you in the current project--scope project: Shared with everyone in the project via.mcp.jsonfile
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Optional: Add environment variables
Edit ~/.config/claude-code/mcp_config.json:
Optional: Add environment variables
Note: Using the claude mcp add command (see "Claude Code (Recommended)" above) is easier and less error-prone than manual editing.
Any MCP client that supports stdio transport can use this server. Pass the environment variables via the client's configuration mechanism.
4. Start tauri-driver
Before using the MCP server, start tauri-driver in a separate terminal:
Why is tauri-driver separate?
tauri-driveris a standalone WebDriver server that controls Tauri apps. Keeping it separate means:
✅ You can restart your MCP server without losing app state
✅ Multiple tools can connect to the same driver instance
✅ It runs on a known port (4444) that's easy to configure
Future improvement: This MCP server could be enhanced to auto-start tauri-driver if it's not running. Interested in contributing? See Contributing below!
5. Use with Claude
Or if you didn't set a default app path:
Available Tools
Tool | Description |
| Launch your Tauri application |
| Close the running application |
| Take a screenshot (returns base64 PNG) |
| Click UI elements by CSS selector |
| Type into input fields |
| Wait for elements to appear |
| Read text from elements |
| Call your Tauri IPC commands |
| Check if app is running and get session info |
Configuration
All environment variables are optional with sensible defaults:
Variable | Description | Default | When to set |
| Path to your Tauri app binary | None | Set if you mainly work with one app (but you can still launch others) |
| Where to save screenshots |
| Change if you want screenshots in a different location |
| Port where tauri-driver runs |
| Only if you're running tauri-driver on a custom port |
| Element wait timeout in ms |
| Increase for slow-loading apps, decrease for faster feedback |
| Path to tauri-driver binary |
| Only if tauri-driver isn't in your PATH |
Finding Your Tauri App Binary
After building your Tauri app, the binary is located at:
Development build:
your-tauri-project/src-tauri/target/debug/your-app-nameRelease build:
your-tauri-project/src-tauri/target/release/your-app-namemacOS apps: Add
.appextension (e.g.,your-app-name.app)Windows apps: Add
.exeextension
Build your app first:
Usage Examples
Basic Testing Workflow
Debugging UI Issues
Testing Tauri Commands
Architecture
Troubleshooting
"Failed to launch application: connect ECONNREFUSED"
Solution: Make sure tauri-driver is running before using the MCP server.
"Element not found: #my-button"
Solutions:
Use
wait_for_elementfirst for dynamically loaded contentVerify the selector in your browser DevTools (Tauri apps use web technologies)
Increase timeout for slow-loading UIs
"Application path not found"
Solutions:
Build your Tauri app first:
cargo buildUse absolute path to the binary
Make sure the binary is executable:
chmod +x /path/to/appOn macOS, use the
.appbundle path
Port conflicts (Port 4444 already in use)
Solution: Use a custom port:
Then update your MCP config:
Screenshots not appearing
Solutions:
Ensure the app is actually running: ask Claude to check with
get_app_stateCheck that the screenshots directory exists and is writable
For base64 screenshots (default), ensure your MCP client supports image display
How It Works
This server uses the WebDriver protocol to control Tauri applications. Here's what happens:
tauri-driver acts as a WebDriver server for Tauri apps
This MCP server translates Claude's requests into WebDriver commands
WebDriverIO handles the low-level WebDriver communication
Your Tauri app responds to automation commands
The server maintains a single active session and ensures proper cleanup when closing apps or on shutdown.
Advanced Usage
Calling Custom Tauri Commands
First, expose commands in your src-tauri/src/main.rs:
Then ask Claude:
Multiple Test Runs
The server can launch and close apps multiple times in a session:
Development
Requirements
Node.js 18+
Rust/Cargo (for tauri-driver)
tauri-driver installed and running
A built Tauri application to test
License
MIT
Acknowledgments
Built with @modelcontextprotocol/sdk
Powered by WebDriverIO
Made for Tauri applications