| Crates.io | tauri-plugin-mcp-bridge |
| lib.rs | tauri-plugin-mcp-bridge |
| version | 0.8.1 |
| created_at | 2025-11-27 04:18:49.18822+00 |
| updated_at | 2026-01-25 15:01:19.966624+00 |
| description | MCP Bridge plugin for use with Tauri applications - enables IPC monitoring and backend inspection |
| homepage | https://github.com/hypothesi/mcp-server-tauri |
| repository | https://github.com/hypothesi/mcp-server-tauri |
| max_upload_size | |
| id | 1953047 |
| size | 312,976 |
A Tauriยฎ plugin that bridges the Model Context Protocol (MCP) with Tauri applications, enabling deep inspection and interaction with Tauri's IPC layer, backend state, and window management.
๐ฆ This npm package is optional. It provides TypeScript bindings for calling the plugin from your app's frontend code. If you're just using the MCP Server for Tauri, you only need the Rust crate (
tauri-plugin-mcp-bridge)โthe MCP server communicates with it directly via WebSocket.
The MCP Bridge plugin extends MCP servers with direct access to Tauri internals. It provides real-time IPC monitoring, window state inspection, backend state access, and event emission capabilities.
cargo add tauri-plugin-mcp-bridge
Or add manually to your src-tauri/Cargo.toml:
[dependencies]
tauri-plugin-mcp-bridge = "0.2"
If you want to call the plugin from your app's frontend code (not required for MCP server functionality):
npm install --save-exact @hypothesi/tauri-plugin-mcp-bridge
Register the plugin in your Tauri application:
fn main() {
let mut builder = tauri::Builder::default();
#[cfg(debug_assertions)]
{
builder = builder.plugin(tauri_plugin_mcp_bridge::init());
}
builder
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
By default, the plugin binds to 0.0.0.0 (all interfaces) to support remote device development. For localhost-only access:
use tauri_plugin_mcp_bridge::Builder;
fn main() {
tauri::Builder::default()
.plugin(Builder::new().bind_address("127.0.0.1").build())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Monitor all Tauri IPC calls in real-time with timing and argument capture:
// Start monitoring
await invoke('plugin:mcp-bridge|start_ipc_monitor');
// Execute some commands to generate IPC traffic
await invoke('greet', { name: 'World' });
// Get captured events
const events = await invoke('plugin:mcp-bridge|get_ipc_events');
Get detailed window state:
const windowInfo = await invoke('plugin:mcp-bridge|get_window_info');
// Returns: { width, height, x, y, title, focused, visible }
Inspect application backend state:
const state = await invoke('plugin:mcp-bridge|get_backend_state');
// Returns: { app: { name, identifier, version }, tauri: { version },
// environment: { debug, os, arch, family }, windows: [...], timestamp }
Trigger custom events for testing:
await invoke('plugin:mcp-bridge|emit_event', {
eventName: 'custom-event',
payload: { data: 'test' }
});
This plugin is part of the larger MCP Server for Tauri, which provides 18 total MCP tools for comprehensive Tauri development and testing. The plugin specifically enables the following tools:
Tools for UI automation and webview interaction via the plugin's WebSocket connection:
Tools that directly use the MCP Bridge plugin's Rust backend:
MCP Server (Node.js)
โ
โโโ Native IPC (via plugin) โโโโ> Tauri App Webview (DOM/UI)
โ โ
โโโ Plugin Client โโโโโโโโโโโโโโโโโโโโโโโผโโ> Plugin Commands
(WebSocket port 9223) โ
โ
mcp-bridge Plugin
(Rust Backend)
The plugin runs a WebSocket server on port 9223 (or next available in range 9223-9322) for real-time communication with the MCP server.
By default, the WebSocket server binds to 0.0.0.0 (all network interfaces), enabling connections from:
adb reverseThe MCP server supports connecting to remote Tauri apps via the driver_session tool:
// Connect to a Tauri app on a remote device
driver_session({ action: 'start', host: '192.168.1.100' })
// Or use environment variables:
// MCP_BRIDGE_HOST=192.168.1.100 npx mcp-server-tauri
// TAURI_DEV_HOST=192.168.1.100 npx mcp-server-tauri (same as Tauri CLI uses)
The MCP server uses a fallback strategy:
localhost:{port} first (most reliable for simulators/emulators/desktop){host}:{port}From the plugin directory:
cd packages/tauri-plugin-mcp-bridge
cargo build
Or from the workspace root:
npm run build:plugin
View the comprehensive Rust API documentation:
npm run docs:rust
Or directly:
cd packages/tauri-plugin-mcp-bridge
cargo doc --open --no-deps
Run the MCP server tests which include plugin integration tests:
npm test
Add the plugin's default permission to your Tauri capabilities file (src-tauri/capabilities/default.json):
{
"permissions": [
"mcp-bridge:default"
]
}
This grants all permissions required by the MCP server. The plugin is designed to work as a complete unitโpartial permissions are not recommended as the MCP server expects all commands to be available.
For detailed API documentation, including:
Visit the docs.rs documentation or build locally with npm run docs:rust.
MIT ยฉ hypothesi
TAURIยฎ is a registered trademark of The Tauri Programme within the Commons Conservancy. https://tauri.app/
This project is not affiliated with, endorsed by, or sponsored by The Tauri Programme within the Commons Conservancy.