app_launch
Launch desktop applications by name on Linux systems to open programs like Firefox or GNOME Terminal directly from AI assistants.
Instructions
Launch a desktop application by name
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_name | Yes | Application name (e.g., 'firefox', 'gnome-terminal') |
Implementation Reference
- src/linux_mcp/tools/__init__.py:195-216 (handler)The actual implementation of the app_launch tool logic.
def execute_app_launch(app_name: str) -> str: """Launch a desktop application.""" try: # Try common launch methods subprocess.Popen( [app_name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) return f"Launched: {app_name}" except FileNotFoundError: # Try with xdg-open as fallback try: subprocess.Popen( ["xdg-open", app_name], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, ) return f"Launched via xdg-open: {app_name}" except Exception as e: return f"Error: Could not launch '{app_name}': {e}" - Registration of the app_launch tool with its schema definition.
register_tool( name="app_launch", scope=PermissionLevel.SAFE, description="Launch a desktop application by name", params_schema={ "type": "object", "properties": { "app_name": {"type": "string", "description": "Application name (e.g., 'firefox', 'gnome-terminal')"}, }, "required": ["app_name"], }, )