Skip to main content
Glama
by Radek44

launch_app

Start a Tauri desktop application for automated testing using tauri-driver, allowing programmatic interaction with UI elements and application workflows.

Instructions

Launch a Tauri application via tauri-driver. The tauri-driver must be running on the configured port (default: 4444).

Input Schema

NameRequiredDescriptionDefault
appPathYesPath to the Tauri application binary
argsNoOptional command-line arguments to pass to the application
envNoOptional environment variables to set for the application

Input Schema (JSON Schema)

{ "properties": { "appPath": { "description": "Path to the Tauri application binary", "type": "string" }, "args": { "description": "Optional command-line arguments to pass to the application", "items": { "type": "string" }, "type": "array" }, "env": { "additionalProperties": { "type": "string" }, "description": "Optional environment variables to set for the application", "type": "object" } }, "required": [ "appPath" ], "type": "object" }

Implementation Reference

  • The main handler function for the 'launch_app' MCP tool. It invokes the TauriDriver's launchApp method, retrieves the app state, and formats the ToolResponse.
    export async function launchApp( driver: TauriDriver, params: LaunchAppParams ): Promise<ToolResponse<{ message: string; sessionId?: string }>> { try { await driver.launchApp(params); const state = driver.getAppState(); return { success: true, data: { message: `Application launched successfully: ${params.appPath}`, sessionId: state.sessionId, }, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : String(error), }; } }
  • src/index.ts:53-75 (registration)
    Registration of the 'launch_app' tool in the MCP server's ListTools handler, including name, description, and input schema.
    name: 'launch_app', description: 'Launch a Tauri application via tauri-driver. The tauri-driver must be running on the configured port (default: 4444).', inputSchema: { type: 'object', properties: { appPath: { type: 'string', description: 'Path to the Tauri application binary', }, args: { type: 'array', items: { type: 'string' }, description: 'Optional command-line arguments to pass to the application', }, env: { type: 'object', additionalProperties: { type: 'string' }, description: 'Optional environment variables to set for the application', }, }, required: ['appPath'], }, },
  • src/index.ts:208-218 (registration)
    Dispatch handler in the MCP server's CallToolRequestSchema that invokes the launchApp tool handler.
    case 'launch_app': { const result = await launchApp(driver, args as any); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • TypeScript interface defining the input parameters for launching the app, used by the handler.
    export interface LaunchAppParams { /** Path to the Tauri application binary */ appPath: string; /** Optional additional arguments to pass to the app */ args?: string[]; /** Optional environment variables */ env?: Record<string, string>; }
  • Core implementation in TauriDriver class that launches the Tauri app using WebDriver remote connection to tauri-driver.
    async launchApp(params: LaunchAppParams): Promise<void> { if (this.appState.isRunning) { throw new Error('Application is already running. Close it first.'); } const appPath = params.appPath || this.config.appPath; if (!appPath) { throw new Error('Application path is required'); } try { // Ensure screenshot directory exists await fs.mkdir(this.config.screenshotDir, { recursive: true }); // Connect to tauri-driver via WebDriver const browser = await remote({ capabilities: { 'tauri:options': { application: appPath, args: params.args || [], env: params.env || {}, }, } as any, logLevel: 'error', port: this.config.webdriverPort, }); this.appState.browser = browser; this.appState.isRunning = true; this.appState.appPath = appPath; this.appState.sessionId = browser.sessionId; // Set default timeout await browser.setTimeout({ implicit: this.config.defaultTimeout, }); } catch (error) { this.appState.isRunning = false; this.appState.browser = null; throw new Error(`Failed to launch application: ${error instanceof Error ? error.message : String(error)}`); } }

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/Radek44/mcp-tauri-automation'

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