quit_application
Close specified macOS applications using the MCP Mac Apps Server. Provide the app name to terminate running processes.
Instructions
Закрывает указанное приложение
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appName | Yes | Имя приложения для закрытия |
Implementation Reference
- src/index.ts:475-498 (handler)The handler function that implements the quit_application tool by running an AppleScript to quit the macOS application named appName.private async quitApplication(appName: string) { try { const appleScript = ` tell application "${appName}" quit end tell `; await execAsync(`osascript -e '${appleScript.replace(/'/g, "'\\''")}'`); return { content: [ { type: "text", text: `Приложение "${appName}" закрыто`, }, ], }; } catch (error) { throw new Error( `Не удалось закрыть приложение "${appName}": ${error instanceof Error ? error.message : String(error)}` ); } }
- src/server.py:348-356 (handler)The handler function that implements the quit_application tool by running an AppleScript to quit the macOS application named app_name.def quit_application(app_name: str) -> str: """Closes application""" apple_script = f'tell application "{app_name}"\nquit\nend tell' apple_script_escaped = apple_script.replace("'", "'\\''") stdout, stderr = exec_command(f"osascript -e '{apple_script_escaped}'") if stderr: raise Exception(f'Failed to close application "{app_name}": {stderr}') return f'Application "{app_name}" closed'
- src/index.ts:99-111 (schema)Input schema definition for the quit_application tool in the tools list.name: "quit_application", description: "Закрывает указанное приложение", inputSchema: { type: "object", properties: { appName: { type: "string", description: "Имя приложения для закрытия", }, }, required: ["appName"], }, },
- src/server.py:86-98 (schema)Input schema definition for the quit_application tool in the tools list."name": "quit_application", "description": "Closes specified application", "inputSchema": { "type": "object", "properties": { "appName": { "type": "string", "description": "Application name to close", }, }, "required": ["appName"], }, },
- src/index.ts:320-322 (registration)Dispatch/registration case in the tool request handler switch statement.case "quit_application": return await this.quitApplication(args?.appName as string);