Skip to main content
Glama

Windows Automation MCP Server

launch_application

Launch applications on Windows systems by specifying the executable path, with options for command-line arguments and waiting for process completion.

Instructions

启动应用程序

Input Schema

NameRequiredDescriptionDefault
pathYes应用程序路径或命令
argsNo命令行参数(可选)
waitNo是否等待程序结束(可选)

Input Schema (JSON Schema)

{ "properties": { "args": { "description": "命令行参数(可选)", "items": { "type": "string" }, "type": "array" }, "path": { "description": "应用程序路径或命令", "type": "string" }, "wait": { "description": "是否等待程序结束(可选)", "type": "boolean" } }, "required": [ "path" ], "type": "object" }

Implementation Reference

  • The primary handler function implementing the launch_application tool. It constructs a command from the appPath and args, then uses execAsync if wait is true or spawn otherwise, returning success status and relevant output or error.
    async launchApplication(appPath, args = [], wait = false) { try { const command = args.length > 0 ? `"${appPath}" ${args.join(' ')}` : `"${appPath}"`; if (wait) { const { stdout, stderr } = await execAsync(command); return { success: true, path: appPath, output: stdout, error: stderr }; } else { spawn(command, { shell: true, detached: true, stdio: 'ignore' }).unref(); return { success: true, path: appPath, message: '应用程序已启动' }; } } catch (error) { return { success: false, error: error.message }; } }
  • The input schema definition for the launch_application tool, specifying required 'path' and optional 'args' array and 'wait' boolean.
    { name: 'launch_application', description: '启动应用程序', inputSchema: { type: 'object', properties: { path: { type: 'string', description: '应用程序路径或命令' }, args: { type: 'array', items: { type: 'string' }, description: '命令行参数(可选)' }, wait: { type: 'boolean', description: '是否等待程序结束(可选)' }, }, required: ['path'], }, },
  • The tool dispatcher (executeTool method) that registers and routes 'launch_application' calls to the specific launchApplication handler.
    async executeTool(name, args) { switch (name) { case 'launch_application': return await this.launchApplication(args.path, args.args, args.wait); case 'kill_process': return await this.killProcess(args.name, args.force); case 'list_processes': return await this.listProcesses(args.filter); case 'get_process_info': return await this.getProcessInfo(args.name); default: throw new Error(`未知工具: ${name}`); } }
  • The canHandle method registers 'launch_application' by including it in the list of supported tools for capability checking.
    canHandle(toolName) { const tools = ['launch_application', 'kill_process', 'list_processes', 'get_process_info']; return tools.includes(toolName); }

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/eva-wanxin-git/windows-automation-mcp'

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