A Tauri plugin and MCP server that allow AI Agents such as Cursor and Claude Code to debug within your tauri application.
The Tauri MCP Plugin provides a comprehensive set of tools that allow AI models and external applications to interact with Tauri applications:
pnpm i
pnpm run build && pnpm run build-plugin
Follow instructions at https://v2.tauri.app/start/create-project/
in src-tauri/cargo.toml add
tauri-plugin-mcp = { path = "../../tauri-plugin-mcp" }
In package.json
"tauri-plugin-mcp": "file:../tauri-mcp",
Then, register the plugin in your Tauri application:
#[cfg(debug_assertions)]
{
info!("Development build detected, enabling MCP plugin");
tauri::Builder::default()
.plugin(tauri_mcp::init_with_config(
tauri_mcp::PluginConfig::new("APPLICATION_NAME".to_string())
.start_socket_server(true)
// For IPC socket (default)
.socket_path("/tmp/tauri-mcp.sock")
// Or for TCP socket
// .tcp("127.0.0.1", 9999)
// For multi-webview architectures where the window label differs
// from the webview label (e.g., window "main" contains webview "preview")
// .default_webview_label("preview".to_string())
));
}
First, build the MCP server:
cd mcp-server-ts
pnpm i
pnpm build
This is the default mode using platform-specific local sockets:
{
"mcpServers": {
"tauri-mcp": {
"command": "node",
"args": ["C:\\Users\\Pegleg\\workspace\\tauri-plugin-mcp\\mcp-server-ts\\build\\index.js"]
}
}
}
Or with a custom socket path:
{
"mcpServers": {
"tauri-mcp": {
"command": "node",
"args": ["C:\\Users\\Pegleg\\workspace\\tauri-plugin-mcp\\mcp-server-ts\\build\\index.js"],
"env": {
"TAURI_MCP_IPC_PATH": "/custom/path/to/socket"
}
}
}
}
For TCP connections (useful for Docker, remote debugging, or when IPC doesn't work):
{
"mcpServers": {
"tauri-mcp": {
"command": "node",
"args": ["C:\\Users\\Pegleg\\workspace\\tauri-plugin-mcp\\mcp-server-ts\\build\\index.js"],
"env": {
"TAURI_MCP_CONNECTION_TYPE": "tcp",
"TAURI_MCP_TCP_HOST": "127.0.0.1",
"TAURI_MCP_TCP_PORT": "4000"
}
}
}
}
Important: Make sure your Tauri app is configured to use the same connection mode and settings:
// For TCP mode in your Tauri app
.plugin(tauri_mcp::init_with_config(
PluginConfig::new("MyApp".to_string())
.tcp("127.0.0.1".to_string(), 4000)
))
The Tauri MCP plugin supports both IPC and TCP socket communication to expose Tauri application functionality to external clients:
The socket_server.rs component:
The client.ts component:
For TCP, verify the port number matches on both sides
"Socket file not found" (IPC mode)
/tmp on macOS/Linux)Try using TCP mode as an alternative
"Permission denied" errors
Consider using TCP mode which avoids file permission issues
Connection drops after each request
You can test your MCP server configuration using the MCP Inspector:
# For IPC mode (default)
cd mcp-server-ts
npx @modelcontextprotocol/inspector node build/index.js
# For TCP mode
cd mcp-server-ts
set TAURI_MCP_CONNECTION_TYPE=tcp&& set TAURI_MCP_TCP_HOST=127.0.0.1&& set TAURI_MCP_TCP_PORT=4000&& npx @modelcontextprotocol/inspector node build\index.js
$ claude mcp add tauri-plugin-mcp \
-- python -m otcore.mcp_server <graph>