npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@hypothesi/tauri-plugin-mcp-bridge

v0.11.0

Published

A Tauri plugin that exposes an MCP server interface via WebSockets.

Readme

Tauri MCP Bridge Plugin

Crates.io npm Documentation License

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.

Overview

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.

Installation

cargo add tauri-plugin-mcp-bridge

Or add manually to your src-tauri/Cargo.toml:

[dependencies]
tauri-plugin-mcp-bridge = "0.2"

Optional: TypeScript Bindings

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

Usage

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");
}

Custom Configuration

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");
}

Features

1. IPC Monitoring

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');

2. Window Information

Get detailed window state:

const windowInfo = await invoke('plugin:mcp-bridge|get_window_info');
// Returns: { width, height, x, y, title, focused, visible }

3. Backend State

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 }

4. Event Emission

Trigger custom events for testing:

await invoke('plugin:mcp-bridge|emit_event', {
  eventName: 'custom-event',
  payload: { data: 'test' }
});

MCP Server Integration

This plugin is part of the larger MCP Server for Tauri, which provides 20 total MCP tools for comprehensive Tauri development and testing. The plugin specifically enables the following tools:

Mobile Development Tools (1)

  1. list_devices - List connected Android devices and iOS simulators

UI Automation & WebView Tools (14)

Tools for UI automation and webview interaction via the plugin's WebSocket connection:

  1. driver_session - Manage automation session (start, stop, or status)
  2. manage_window - List windows, get window info, or resize windows
  3. webview_find_element - Find elements by CSS selector, XPath, text, or ref ID
  4. read_logs - Read logs (console, Android logcat, iOS, system)
  5. webview_interact - Perform gestures (click, double-click, long-press, swipe, scroll, focus)
  6. webview_screenshot - Take screenshots (JPEG default, with optional resizing)
  7. webview_keyboard - Type text or simulate keyboard events with optional modifiers
  8. webview_wait_for - Wait for element selectors, text content, or IPC events
  9. webview_get_styles - Get computed CSS styles for element(s)
  10. webview_execute_js - Execute arbitrary JavaScript code in the webview context
  11. webview_dom_snapshot - Get structured DOM snapshot (accessibility or structure type)
  12. webview_select_element - Visual element picker — user clicks an element, returns metadata + screenshot
  13. webview_get_pointed_element - Retrieve metadata for element user Alt+Shift+Clicked
  14. get_setup_instructions - Get setup/update instructions for the MCP Bridge plugin

IPC Tools (5)

Tools that directly use the MCP Bridge plugin's Rust backend:

  1. ipc_execute_command - Execute any Tauri IPC command
  2. ipc_monitor - Manage IPC monitoring (start or stop)
  3. ipc_get_captured - Retrieve captured IPC traffic with optional filtering
  4. ipc_emit_event - Emit custom Tauri events for testing event handlers
  5. ipc_get_backend_state - Get backend application state and metadata

Architecture

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)

WebSocket Communication

The plugin runs a WebSocket server on port 9223 (or next available in range 9223-9322) for real-time communication with the MCP server.

Remote Device Development

By default, the WebSocket server binds to 0.0.0.0 (all network interfaces), enabling connections from:

  • iOS devices on the same network
  • Android devices on the same network or via adb reverse
  • Emulators/Simulators via localhost

Connecting from MCP Server

The 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)

Connection Strategy

The MCP server uses a fallback strategy:

  1. Try localhost:{port} first (most reliable for simulators/emulators/desktop)
  2. If localhost fails and a remote host is configured, try {host}:{port}
  3. Auto-discover apps on localhost if specific connection fails

Development

Building the Plugin

From the plugin directory:

cd packages/tauri-plugin-mcp-bridge
cargo build

Or from the workspace root:

npm run build:plugin

Documentation

View the comprehensive Rust API documentation:

npm run docs:rust

Or directly:

cd packages/tauri-plugin-mcp-bridge
cargo doc --open --no-deps

Testing

Run the MCP server tests which include plugin integration tests:

npm test

Permissions

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.

API Documentation

For detailed API documentation, including:

  • Complete function signatures and parameters
  • Rust examples for backend integration
  • TypeScript examples for frontend usage
  • Architecture and design details

Visit the docs.rs documentation or build locally with npm run docs:rust.

License

MIT © hypothesi


Trademark Notice

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.