launchd-mcp
Provides tools to manage macOS launchd jobs, including creating, listing, updating, and removing scheduled tasks with various scheduling and runtime options, as well as accessing log files.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@launchd-mcp create a python task to backup files daily"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
launchd-mcp
Manage macOS launchd jobs from MCP tools.
This project provides:
An MCP server (
main.py) that wrapslaunchctlTask management tools for Python-script jobs (
link.igtm.launchd-mcp.*)Per-task log management and retrieval
A reusable Agent Skill at
skills/launchctl/SKILL.mdfor users who prefer raw CLI workflows (no MCP server implementation)
Features
Basic launchctl operations:
list,print,kickstart,bootstrap,bootout,enable,disableManaged task lifecycle:
create_or_update_python_tasklist_python_tasksget_python_task_logsremove_python_task
Scheduling and event options:
StartInterval(seconds)StartCalendarIntervalWatchPathsQueueDirectories
Runtime tuning options:
KeepAlive,ThrottleInterval,ProcessType,Nice,Umask,HardResourceLimits
Related MCP server: agent-scheduler
Requirements
macOS (Darwin) for launchctl execution
Python 3.13+
uv
Install
git clone git@github.com:igtm/launchd-mcp.git
cd launchd-mcp
uv syncRun MCP Server
uv run main.pyClaude Desktop Example
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"launchd": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/launchd-mcp",
"run",
"main.py"
]
}
}
}Logs
Managed task logs are written to:
~/.local/share/launchd-mcp/logs/{label}.out.log~/.local/share/launchd-mcp/logs/{label}.err.log
Tests
uv run pytestAgent Skill (CLI-first)
If you prefer managing launchd directly with shell/launchctl/plist files (without MCP server implementation), use:
skills/launchctl/SKILL.md
This Skill follows the same label, task, and log conventions as this repository.
Safety Notes
For stdio MCP servers, never print to stdout except protocol messages.
Treat
python_scriptinput as untrusted unless validated.Validate generated plist files (
plutil -lint) beforelaunchctl bootstrap.
Available Tools
12 toolsbootout_serviceC
Unload or remove a service/domain via launchctl bootout.
Args: target: Service or domain target accepted by launchctl bootout.
Inputs: target (required). Returns: result
bootstrap_serviceA
Load a launchd plist into a domain via launchctl bootstrap.
Args: domain_target: Domain like "system", "user/501", or "gui/501". plist_path: Absolute path to a LaunchAgent/LaunchDaemon plist.
Inputs: plist_path (required), domain_target (required). Returns: result
create_or_update_python_taskA
Create/update a LaunchAgent from a Python script string and load it.
Args: task_name: Human friendly task name. Will be sanitized for label suffix. python_script: Python source code to execute. label_prefix: Reverse-domain prefix (e.g. "link.igtm.launchd-mcp"). run_at_load: Whether to run immediately after load. start_interval_seconds: Optional StartInterval in seconds. start_calendar: Optional object/array for StartCalendarInterval. watch_paths_csv: Optional comma-separated list for WatchPaths. queue_directories_csv: Optional comma-separated list for QueueDirectories. working_directory: Optional WorkingDirectory. Defaults to task directory. python_bin: Optional python executable path. Defaults to python3 on PATH. extra_path_csv: Optional comma-separated PATH entries prepended in plist. keep_alive: Optional KeepAlive (bool or object). throttle_interval_seconds: Optional ThrottleInterval in seconds. process_type: Optional ProcessType (Background/Standard/Adaptive/Interactive). nice: Optional Nice value. umask: Optional octal umask like "022" or "0o022". hard_resource_limits: Optional HardResourceLimits object. replace_existing: If true, bootout existing service first.
Inputs: task_name (required), python_script (required), nice, umask, +14 more. Returns: result
disable_serviceA
Disable a service via launchctl disable.
Args: service_target: Service target like "system/com.example.daemon" or "gui/501/com.example.agent".
Inputs: service_target (required). Returns: result
enable_serviceC
Enable a service via launchctl enable.
Args: service_target: Service target like "system/com.example.daemon" or "gui/501/com.example.agent".
Inputs: service_target (required). Returns: result
get_python_task_logsA
Fetch per-task execution logs (stdout/stderr).
Args: task_name: Optional original task name. If omitted, return logs for all matching tasks. label_prefix: Reverse-domain prefix used for managed task labels. lines: Number of tail lines to return from each log file. include_stdout: Include stdout logs. include_stderr: Include stderr logs.
Inputs: lines, task_name, label_prefix, include_stderr, +1 more. Returns: result
kickstart_serviceA
Start or restart a service via launchctl kickstart.
Args:
target: A launchd target, e.g. "gui/501/com.example.app".
kill_existing: If true, pass -k to kill any running instance first.
Inputs: target (required), kill_existing. Returns: result
list_plistsB
List available launchd plist files from common locations.
Args: scope: "all", "system", or "user".
Inputs: scope. Returns: result
list_python_tasksA
List managed tasks matching {label_prefix}.*.
Args: label_prefix: Reverse-domain prefix used for managed task labels.
Inputs: label_prefix. Returns: result
list_servicesA
List launchd services from launchctl list.
Args: label_filter: Optional substring filter for the service label.
Inputs: label_filter. Returns: result
print_serviceA
Print detailed state for a launchd target via launchctl print.
Args: target: A launchd target, e.g. "system/com.apple.cfprefsd.xpc.daemon" or "gui/501/com.example.app".
Inputs: target (required). Returns: result
remove_python_taskA
Unload and remove a task created by create_or_update_python_task.
Args: task_name: The original task name. label_prefix: Reverse-domain prefix used for task label. delete_files: If true, remove script/plist/log files.
Inputs: task_name (required), delete_files, label_prefix. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
The generic launchctl tools and the managed Python-task tools are clearly separated into distinct groups. There is minor potential confusion between bootstrap_service and create_or_update_python_task since both load a plist, but the descriptions clarify that one is a raw launchctl wrapper and the other is a higher-level task manager.
All tool names follow a consistent verb_noun snake_case pattern, such as list_services, kickstart_service, bootout_service, and create_or_update_python_task. The naming convention is uniform across both the generic launchctl operations and the managed Python-task operations.
With 12 tools, the server is well-scoped for its launchd administration purpose. The generic service lifecycle tools and the higher-level Python-task management tools each earn their place without unnecessary redundancy or bloat.
The server covers the full launchd lifecycle: listing, inspecting, loading, unloading, starting, enabling, and disabling services. The Python-task workflow adds create/update/remove/list/logs, providing complete coverage for both the low-level and high-level use cases.
Maintenance
Related MCP Connectors
Read and write Mission Control state via MCP — projects, tasks, subtasks, templates, status updates.
Task management your AI agents can actually run. One line becomes a context-ready task over MCP.
Schedule and manage recurring or one-shot tasks
Project management MCP for AI agents with safe task reads and writes.
Related MCP Servers
- AlicenseAqualityAmaintenanceAn MCP server that surfaces scheduled-job state and detects silent failures (exit 0 but no useful output) for cron, systemd timers, and OpenClaw schedulers, enabling AI agents to query job health and overdue status directly.6MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for scheduling tasks with cron-like recurring jobs, one-time tasks, priority queues, retry logic, and job dependencies.MIT
- AlicenseNot gradedqualityDmaintenanceEnables running and managing automated tasks with retry loops and machine-checkable success criteria via MCP tools.MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that lets AI agents manage cron jobs through natural language — adding, listing, pausing, removing, running, and viewing logs of scheduled jobs with plain-English schedule parsing, automatic log capture, missed-run detection, and failure alerts.MIT