Skip to main content
Glama
Radek44

MCP Tauri Automation

by Radek44

launch_app

Launch Tauri desktop applications for automated testing and interaction by specifying the application binary path and optional arguments or environment variables.

Instructions

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

Input Schema

TableJSON 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

Implementation Reference

  • The primary handler function for the 'launch_app' MCP tool. It calls the underlying TauriDriver.launchApp, retrieves the app state, and formats the response as a 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),
        };
      }
    }
  • Type definition for the input parameters of the launch_app tool.
    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>;
    }
  • src/index.ts:53-75 (registration)
    Registration of the 'launch_app' tool in the MCP server's listTools response, 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)
    The switch case in the CallToolRequestHandler that invokes the launchApp handler function for 'launch_app' calls.
    case 'launch_app': {
      const result = await launchApp(driver, args as any);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Core implementation in TauriDriver class that performs the actual application launch 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)}`);
      }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the dependency on tauri-driver and the default port, which adds useful context. However, it lacks critical details such as whether this operation is idempotent, what happens if the app is already running, error conditions, or the expected output format, leaving significant gaps for a tool that likely involves system-level interactions.

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

Conciseness5/5

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

The description is highly concise and front-loaded, consisting of only two sentences that directly convey the core functionality and a key prerequisite. Every sentence earns its place by providing essential information without redundancy or unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of launching an application (involving system dependencies and potential side-effects), no annotations, no output schema, and 100% schema coverage, the description is insufficient. It fails to explain what the tool returns, error handling, or behavioral nuances like whether it waits for the app to be ready, making it incomplete for safe and effective use by an AI agent.

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?

The input schema has 100% description coverage, so the schema already documents all three parameters (appPath, args, env) adequately. The description doesn't add any additional meaning or examples beyond what the schema provides, such as typical values for appPath or common use cases for args and env, resulting in a baseline score of 3.

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

Purpose4/5

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

The description clearly states the action ('Launch') and target ('a Tauri application via tauri-driver'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'close_app' or 'get_app_state', which would require mentioning this is specifically for starting applications rather than managing or querying them.

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

Usage Guidelines3/5

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

The description provides some context by mentioning that 'tauri-driver must be running on the configured port (default: 4444)', which implies a prerequisite for usage. However, it doesn't offer explicit guidance on when to use this tool versus alternatives like 'close_app' or 'execute_tauri_command', nor does it specify scenarios where it should or shouldn't be used.

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

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