Launch App
launch_appLaunch an application on macOS using its name or bundle ID.
Instructions
Launch an application by name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Application name (e.g. 'Safari', 'Xcode') or bundle ID |
Implementation Reference
- src/system/tools.ts:584-602 (registration)Registration of the 'launch_app' tool on the MCP server with input schema (name as string) and handler that calls launchAppScript via runJxa.
server.registerTool( "launch_app", { title: "Launch App", description: "Launch an application by name. Lightweight — just activates the app without reading its accessibility tree.", inputSchema: { name: z.string().min(1).max(500).describe("Application name (e.g. 'Safari', 'Xcode') or bundle ID"), }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true }, }, async ({ name }) => { try { return ok(await runJxa(launchAppScript(name))); } catch (e) { return errJxaFor("launch app", e); } }, ); - src/system/tools.ts:595-601 (handler)Handler function that executes the launch_app tool: runs a JXA script generated by launchAppScript to activate the given application.
async ({ name }) => { try { return ok(await runJxa(launchAppScript(name))); } catch (e) { return errJxaFor("launch app", e); } }, - src/system/tools.ts:586-593 (schema)Zod-based input schema for launch_app: expects a 'name' string (1-500 chars) representing the app name or bundle ID.
{ title: "Launch App", description: "Launch an application by name. Lightweight — just activates the app without reading its accessibility tree.", inputSchema: { name: z.string().min(1).max(500).describe("Application name (e.g. 'Safari', 'Xcode') or bundle ID"), }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true }, - src/system/scripts.ts:307-313 (helper)Helper function that generates a JXA script string to launch and activate a macOS application by name (using AppleScript/JXA Application and activate()).
export function launchAppScript(name: string): string { return ` const app = Application('${esc(name)}'); app.activate(); JSON.stringify({launched: true, name: '${esc(name)}'}); `; }