Skip to main content
Glama

tauri_driver_session

Idempotent

Manage automation sessions for Tauri applications by starting, stopping, or checking connection status to enable UI testing and debugging through WebSocket connections.

Instructions

[Tauri Apps Only] Start/stop automation session to connect to a RUNNING Tauri app. Supports multiple concurrent app connections - each app runs on a unique port. The most recently connected app becomes the "default" app used when no appIdentifier is specified. Use action "status" to check connection state: returns single app format when 1 app connected, or array format with "isDefault" indicator when multiple apps connected. Action "stop" without appIdentifier stops ALL sessions; with appIdentifier stops only that app. The identifier field (e.g., "com.example.myapp") uniquely identifies each app. REQUIRED before using other tauri_webview_* or tauri_plugin_* tools. Connects via WebSocket to the MCP Bridge plugin in the Tauri app. For browser automation, use Chrome DevTools MCP instead. For Electron apps, this tool will NOT work.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesAction to perform: start or stop the session, or check status
hostNoHost address to connect to (e.g., 192.168.1.100). Falls back to MCP_BRIDGE_HOST or TAURI_DEV_HOST env vars
portNoPort to connect to (default: 9223)
appIdentifierNoApp identifier (port number or bundle ID) to stop. Only used with action "stop". If omitted, stops all sessions.

Implementation Reference

  • Core handler function implementing the tauri_driver_session tool logic for starting, stopping, and checking status of Tauri driver sessions.
    export async function manageDriverSession(
       action: 'start' | 'stop' | 'status',
       host?: string,
       port?: number,
       appIdentifier?: string | number
    ): Promise<string> {
       switch (action) {
          case 'status': {
             return handleStatusAction();
          }
    
          case 'start': {
             return handleStartAction(host, port);
          }
    
          case 'stop': {
             return handleStopAction(appIdentifier);
          }
    
          default: {
             return handleStopAction(appIdentifier);
          }
       }
    }
  • Zod schema defining input parameters for the tauri_driver_session tool.
    export const ManageDriverSessionSchema = z.object({
       action: z.enum([ 'start', 'stop', 'status' ]).describe('Action to perform: start or stop the session, or check status'),
       host: z.string().optional().describe(
          'Host address to connect to (e.g., 192.168.1.100). Falls back to MCP_BRIDGE_HOST or TAURI_DEV_HOST env vars'
       ),
       port: z.number().optional().describe('Port to connect to (default: 9223)'),
       appIdentifier: z.union([ z.string(), z.number() ]).optional().describe(
          'App identifier (port number or bundle ID) to stop. Only used with action "stop". If omitted, stops all sessions.'
       ),
    });
  • Registration of the tauri_driver_session tool in the tools registry, including metadata, schema reference, annotations, and handler wrapper that delegates to the core implementation.
    {
       name: 'tauri_driver_session',
       description:
          '[Tauri Apps Only] Start/stop automation session to connect to a RUNNING Tauri app. ' +
          'Supports multiple concurrent app connections - each app runs on a unique port. ' +
          'The most recently connected app becomes the "default" app used when no appIdentifier is specified. ' +
          'Use action "status" to check connection state: returns single app format when 1 app connected, ' +
          'or array format with "isDefault" indicator when multiple apps connected. ' +
          'Action "stop" without appIdentifier stops ALL sessions; with appIdentifier stops only that app. ' +
          'The identifier field (e.g., "com.example.myapp") uniquely identifies each app. ' +
          'REQUIRED before using other tauri_webview_* or tauri_plugin_* tools. ' +
          'Connects via WebSocket to the MCP Bridge plugin in the Tauri app. ' +
          'For browser automation, use Chrome DevTools MCP instead. ' +
          'For Electron apps, this tool will NOT work.',
       category: TOOL_CATEGORIES.UI_AUTOMATION,
       schema: ManageDriverSessionSchema,
       annotations: {
          title: 'Manage Tauri Session',
          readOnlyHint: false,
          destructiveHint: false,
          idempotentHint: true,
          openWorldHint: false,
       },
       handler: async (args) => {
          const parsed = ManageDriverSessionSchema.parse(args);
    
          return await manageDriverSession(parsed.action, parsed.host, parsed.port, parsed.appIdentifier);
       },
    },
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds valuable behavioral context beyond annotations: it explains that multiple concurrent connections are supported, the most recent becomes default, how status action returns different formats, and that stop without appIdentifier stops ALL sessions. While annotations cover idempotency and non-destructive nature, the description provides practical session management details that aren't captured in structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose. Each sentence adds distinct value: session management, multi-app support, status behavior, stop behavior, identifier explanation, prerequisites, and exclusions. While slightly dense, there's minimal redundancy and all information appears necessary for understanding this complex tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a session management tool with no output schema, the description provides substantial context about connection behavior, default app selection, status format variations, and stop semantics. It covers the tool's role in the broader workflow and specifies technology boundaries. The main gap is lack of explicit information about return values or error conditions, but given the behavioral details provided, it's mostly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema description coverage, the input schema already documents all parameters thoroughly. The description adds minimal parameter-specific information beyond the schema - it mentions that appIdentifier can be 'port number or bundle ID' and clarifies stop behavior, but most parameter semantics are already covered in the schema descriptions. This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Start/stop automation session to connect to a RUNNING Tauri app.' It specifies the verb (start/stop), resource (automation session), and target (Tauri app). It distinguishes from siblings by explicitly stating this tool is REQUIRED before using other tauri_webview_* or tauri_plugin_* tools, establishing its foundational role in the workflow.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool vs alternatives: 'REQUIRED before using other tauri_webview_* or tauri_plugin_* tools' establishes its prerequisite role. It also specifies exclusions: 'For browser automation, use Chrome DevTools MCP instead. For Electron apps, this tool will NOT work.' This gives clear boundaries for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypothesi/mcp-server-tauri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server