| Crates.io | tauri-mcp |
| lib.rs | tauri-mcp |
| version | 0.1.4 |
| created_at | 2025-07-01 11:40:17.123282+00 |
| updated_at | 2025-07-01 14:15:34.879197+00 |
| description | MCP server for testing and interacting with Tauri v2 applications |
| homepage | https://github.com/dirvine/tauri-mcp |
| repository | https://github.com/dirvine/tauri-mcp |
| max_upload_size | |
| id | 1733131 |
| size | 8,407,128 |
A Model Context Protocol (MCP) server for testing and interacting with Tauri v2 applications. This tool enables AI assistants to better understand, debug, and interact with Tauri apps during development.
The MCP protocol provides a standardized way for AI assistants to interact with external tools and systems. This server implements the MCP specification to expose Tauri application testing and debugging capabilities.
This server is fully compliant with the Model Context Protocol specification. It implements:
For more details about MCP:
Process Management
launch_app - Launch Tauri applications with argumentsstop_app - Gracefully stop running appsget_app_logs - Capture stdout/stderr outputmonitor_resources - Track CPU, memory, and disk usageWindow Manipulation
take_screenshot - Capture app window screenshotsget_window_info - Get window dimensions, position, and stateInput Simulation
send_keyboard_input - Simulate keyboard inputsend_mouse_click - Simulate mouse clicksDebugging Tools
execute_js - Execute JavaScript in the webviewget_devtools_info - Get DevTools connection infoIPC Interaction
list_ipc_handlers - List registered Tauri commandscall_ipc_command - Call Tauri IPC commands# Clone the repository
git clone https://github.com/dirvine/tauri-mcp.git
cd tauri-mcp
# Build and install
cargo install --path .
cargo install tauri-mcp
# Start the MCP server
tauri-mcp serve
# With custom host and port
tauri-mcp serve --host 127.0.0.1 --port 3000
# With a specific Tauri app
tauri-mcp --app-path ./my-tauri-app
Create a tauri-mcp.toml file for configuration:
auto_discover = true
session_management = true
event_streaming = false
performance_profiling = false
network_interception = false
TAURI_MCP_LOG_LEVEL - Set log level (trace, debug, info, warn, error)TAURI_MCP_CONFIG - Path to config file (default: tauri-mcp.toml)Add to your Claude Desktop configuration:
{
"mcpServers": {
"tauri-mcp": {
"command": "tauri-mcp",
"args": ["serve"],
"env": {
"TAURI_MCP_LOG_LEVEL": "info"
}
}
}
}
All tools are exposed through the MCP protocol and can be called by AI assistants:
// Launch a Tauri app
await use_mcp_tool("tauri-mcp", "launch_app", {
app_path: "/path/to/tauri-app",
args: ["--debug"]
});
// Take a screenshot
await use_mcp_tool("tauri-mcp", "take_screenshot", {
process_id: "uuid-here",
output_path: "./screenshot.png"
});
// Execute JavaScript
await use_mcp_tool("tauri-mcp", "execute_js", {
process_id: "uuid-here",
javascript_code: "window.location.href"
});
// Send keyboard input
await use_mcp_tool("tauri-mcp", "send_keyboard_input", {
process_id: "uuid-here",
keys: "cmd+a"
});
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
tauri-mcp/
├── src/
│ ├── main.rs # Entry point
│ ├── server.rs # MCP server implementation
│ ├── tools/ # Tool implementations
│ │ ├── process.rs # Process management
│ │ ├── window.rs # Window manipulation
│ │ ├── input.rs # Input simulation
│ │ ├── debug.rs # Debugging tools
│ │ └── ipc.rs # IPC interaction
│ └── utils/ # Utility modules
├── examples/ # Example Tauri apps
└── tests/ # Integration tests
# Launch the server
tauri-mcp serve
# In your AI assistant:
# 1. Launch the app
# 2. Take a screenshot
# 3. Send some input
# 4. Check the logs
# 5. Stop the app
import asyncio
from mcp import Client
async def test_tauri_app():
client = Client("tauri-mcp")
# Launch app
result = await client.call_tool("launch_app", {
"app_path": "./my-app",
"args": ["--test-mode"]
})
process_id = result["process_id"]
# Wait for app to start
await asyncio.sleep(2)
# Take screenshot
await client.call_tool("take_screenshot", {
"process_id": process_id,
"output_path": "./test-screenshot.png"
})
# Send input
await client.call_tool("send_keyboard_input", {
"process_id": process_id,
"keys": "Hello, Tauri!"
})
# Get logs
logs = await client.call_tool("get_app_logs", {
"process_id": process_id,
"lines": 50
})
print("App logs:", logs)
# Stop app
await client.call_tool("stop_app", {
"process_id": process_id
})
asyncio.run(test_tauri_app())
Permission Denied on macOS
Screenshot Fails
WebDriver Connection Failed
Enable debug logging:
TAURI_MCP_LOG_LEVEL=debug tauri-mcp serve
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.