tauri-plugin-mcp
A Tauri plugin for interacting with MCP servers.
Install
This plugin requires a Rust version of at least 1.77.2
src-tauri/Cargo.toml
[]
= { = "0.4.27" }
# or
= { = "https://github.com/moeru-ai/airi", = "0.4.27" }
You can install the JavaScript Guest bindings using your preferred JavaScript package manager:
# or use @antfu/ni
Usage
First, you need to register the plugin with Tauri:
src-tauri/src/lib.rs
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()
Development
Source code of JavaScript bindings is located in packages/tauri-plugin-mcp.
These files are generated from tauri-plugin
crate:
permissions/autogenerated
permissions/schemas
TODO List
- Move to a single repository
- Server connection
- stdio
- SSE
- Tools
- List tools
- Simple: Names only
- With description, parameters, returns
- Call tool
- Simple: Name only
- With parameters
- Returns
- Image returns
- List tools
- Prompts...
- Resources...
- JavaScript package to call commands conveniently