tauri-plugin-mcp
Provides tools for controlling and debugging Tauri applications, including screenshot capture, DOM inspection, click simulation, text input, navigation, JavaScript execution, storage management, and window management.
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-mcpTake a screenshot of the main window"
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: Model Context Protocol (MCP)
A Tauri plugin and MCP server that allow AI agents such as Cursor and Claude Code to interact with and debug your Tauri application through screenshots, DOM access, input simulation, and more.
Install
npm (guest-js bindings)
npm install tauri-plugin-mcpMCP Server CLI
npm install -g tauri-plugin-mcp-server
# or run directly
npx tauri-plugin-mcp-serverRust (Cargo)
Coming soon to crates.io. For now, use a git dependency:
[dependencies]
tauri-plugin-mcp = { git = "https://github.com/P3GLEG/tauri-plugin-mcp" }Related MCP server: macOS Simulator MCP Server
Tools
The MCP server exposes 10 high-level tools to AI agents:
Tool | Description |
take_screenshot | Captures a screenshot of an application window. Saves full image to disk with small thumbnail inline (optimized for token efficiency). |
query_page | Inspects the current page. Modes: |
click | Clicks at x/y coordinates or via selector (ref, id, class, tag, text). Selector-based clicks auto-resolve element position. |
type_text | Types text into the page. Supports a |
mouse_action | Non-click mouse actions: |
navigate | Webview navigation: |
execute_js | Runs arbitrary JavaScript in the webview. Returns the result of the last statement or promise. |
manage_storage | localStorage operations (get/set/remove/clear/keys) and cookie management (get/clear). |
manage_window | Window control (list/focus/minimize/maximize/close/position/size/fullscreen), zoom, devtools, and webview state management. |
wait_for | Waits for a condition: text appearing/disappearing, element visible/hidden/attached/detached. Useful after async content loads. |
Setup
1. Register the plugin in your Tauri app
Only include the MCP plugin in development builds:
#[cfg(debug_assertions)]
{
builder = builder.plugin(tauri_plugin_mcp::init_with_config(
tauri_plugin_mcp::PluginConfig::new("APPLICATION_NAME".to_string())
.start_socket_server(true)
// IPC socket (default — recommended)
.socket_path("/tmp/tauri-mcp.sock")
// Or TCP socket
// .tcp_localhost(4000)
// For multi-webview apps where the webview label differs from the window label
// .default_webview_label("preview".to_string())
// Optional auth token for TCP connections
// .auth_token("my-secret-token".to_string())
));
}2. Configure your AI agent
IPC Mode (default, recommended)
{
"mcpServers": {
"tauri-mcp": {
"command": "npx",
"args": ["tauri-plugin-mcp-server"]
}
}
}With a custom socket path:
{
"mcpServers": {
"tauri-mcp": {
"command": "npx",
"args": ["tauri-plugin-mcp-server"],
"env": {
"TAURI_MCP_IPC_PATH": "/custom/path/to/socket"
}
}
}
}TCP Mode
For Docker, remote debugging, or when IPC doesn't work:
{
"mcpServers": {
"tauri-mcp": {
"command": "npx",
"args": ["tauri-plugin-mcp-server"],
"env": {
"TAURI_MCP_CONNECTION_TYPE": "tcp",
"TAURI_MCP_TCP_HOST": "127.0.0.1",
"TAURI_MCP_TCP_PORT": "4000"
}
}
}
}Make sure your Tauri app uses the same connection mode:
.plugin(tauri_plugin_mcp::init_with_config(
tauri_plugin_mcp::PluginConfig::new("MyApp".to_string())
.tcp_localhost(4000)
))Building from source
pnpm install
pnpm run build # JS guest bindings
cargo build --release # Rust plugin
# MCP server
cd mcp-server-ts
pnpm install && pnpm buildArchitecture
AI Agent (Claude, Cursor, etc.)
↕ MCP protocol (stdio)
MCP Server (tauri-plugin-mcp-server)
↕ IPC socket or TCP
Tauri Plugin (Rust)
↕ Tauri events with correlation IDs
Guest JS (webview)
↕ DOM APIs
Your ApplicationRust plugin (
src/) — Async socket server, command routing, native input injection (macOS), screenshot captureGuest JS (
guest-js/) — DOM interaction, element resolution, form filling, event handlingMCP Server (
mcp-server-ts/) — Translates MCP tool calls into socket commands
Security
Auth token support for TCP connections (constant-time comparison)
Token file written with
0o600permissions, deleted on shutdownNon-loopback TCP without auth token is rejected
Stale socket cleanup on startup
Platform notes
macOS: Native
NSEventinjection — no Accessibility permissions neededWindows/Linux: JS-based input fallback (
isTrusted=false, ~80% coverage)Screenshots: macOS/Windows use native capture; Linux uses
xcap
Troubleshooting
"Connection refused" — Ensure your Tauri app is running and the socket server started. Check that both sides use the same connection mode (IPC or TCP).
"Socket file not found" (IPC) — Check that the socket path exists (look in
/tmpon macOS/Linux). Try TCP mode as an alternative."Permission denied" — On Unix, check file permissions for the socket. TCP mode avoids file permission issues.
Testing your setup:
npx @modelcontextprotocol/inspector npx tauri-plugin-mcp-server
License
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/P3GLEG/tauri-plugin-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server