Crates.io | tauri-plugin-mcp |
lib.rs | tauri-plugin-mcp |
version | 0.7.2-beta.3 |
created_at | 2025-04-30 07:32:56.419032+00 |
updated_at | 2025-09-11 07:21:05.196831+00 |
description | A Tauri plugin for interacting with MCP servers |
homepage | |
repository | https://github.com/moeru-ai/airi |
max_upload_size | |
id | 1654575 |
size | 140,884 |
tauri-plugin-mcp
A Tauri plugin for interacting with MCP servers.
This plugin requires a Rust version of at least 1.77.2
src-tauri/Cargo.toml
[dependencies]
tauri-plugin-mcp = { version = "0.4.27" }
# or
tauri-plugin-mcp = { git = "https://github.com/moeru-ai/airi", tag = "0.4.27" }
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
pnpm add @proj-airi/tauri-plugin-mcp
# or use @antfu/ni
ni @proj-airi/tauri-plugin-mcp
First, you need to register the plugin with Tauri:
src-tauri/src/lib.rs
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_mcp::Builder.build())
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
import { callTool, connectServer, disconnectServer, listTools } from '@proj-airi/tauri-plugin-mcp'
// Sample: Connect to a container running AIRI Android
await connectServer('docker', 'run -i --rm -e ADB_HOST=host.docker.internal ghcr.io/lemonnekogh/airi-android:v0.1.0')
console.log(await listTools())
// [
// {
// description: 'Get the battery level of the device',
// inputSchema: {
// required: [],
// title: 'battery_level',
// type: 'object',
// },
// name: 'battery_level',
// },
// ]
console.log(await callTool('battery_level', {}))
// {
// content: [
// {
// type: 'text',
// text: '100',
// },
// ],
// isError: false,
// }
await disconnectServer()
Source code of JavaScript bindings is located in packages/tauri-plugin-mcp.
These files are generated from tauri-plugin
crate:
permissions/autogenerated
permissions/schemas