CLI Usage
Use @hypothesi/tauri-mcp-cli when you want to call the Tauri MCP tools from a terminal, script, or CI pipeline instead of from an MCP client.
Install
npm install -g @hypothesi/tauri-mcp-cliOr run without a permanent install:
npx @hypothesi/tauri-mcp-cli <command>Prerequisites
- A Tauri v2 app running in development mode (
cargo tauri dev) - The
tauri-plugin-mcp-bridgeplugin installed in the app withGlobalTauri: trueinsrc-tauri/tauri.conf.json
Session Workflow
1. Start a session
tauri-mcp driver-session start --port 9223The --port must match the WebSocket port the MCP Bridge plugin is listening on (default: 9223).
2. Call tools in separate invocations
tauri-mcp webview-screenshot --file screenshot.png
tauri-mcp webview-click --selector "#submit-btn"
tauri-mcp webview-execute-script --script "document.title"
tauri-mcp driver-session status --json3. Stop the session
tauri-mcp driver-session stopKeep-Alive Behavior
The CLI uses MCPorter keep-alive mode. That means:
- each
tauri-mcp ...command exits normally after it completes - the underlying MCP server process stays warm in the background
driver_sessionstate survives across separate CLI invocations
This makes it suitable for scripted workflows where each step is a separate command.
Output
- Image tools write image files to disk by default.
- Default filename:
<tool-name>-<timestamp>.pngin the current directory. - Use
--file <path>to control the image filename. - Use
--jsonfor structured JSON output. Images are still written to disk; the JSON includes their file paths. - Use
--raw <json>to pass raw JSON arguments directly to the underlying tool.
Daemon Management
Manage the keep-alive daemon directly when troubleshooting:
tauri-mcp daemon status # Show daemon status
tauri-mcp daemon stop # Stop the daemon
tauri-mcp daemon start # Start or prewarm the daemon
tauri-mcp daemon restart # Restart the daemonTroubleshooting
"No active session" error
The daemon restarted and lost session state. Re-run the session start:
tauri-mcp driver-session start --port 9223Connection refused or stale daemon
tauri-mcp daemon restart
tauri-mcp driver-session start --port 9223Check current state
tauri-mcp daemon status
tauri-mcp driver-session status --jsonStale daemon config
MCPorter reads ~/.mcporter/tauri-mcp-cli.json. If it becomes corrupted, delete it and run any tauri-mcp command to regenerate it.
Agent Skills
This package ships one bundled Agent Skill that AI coding agents can load automatically. After installing the package, run:
npx @tanstack/intent@latest installThis wires the CLI's bundled tauri-mcp-cli skill into your agent config (CLAUDE.md, .cursorrules, etc.) so agents understand session lifecycle, screenshot patterns, IPC debugging, and device workflows without extra prompting.
See the Agent Skills guide for the full skills inventory.