Cron Scheduler MCP Server

7 tools for AI agent cron job scheduling with SQLite persistence, retry logic, and structured observability. MIT license.

Documentation

Cron Scheduler MCP Server

npm version npm downloads MCP Claude Desktop License: MIT Tests Glama Glama Score

MCP server for cron job scheduling with SQLite persistence, retry logic, and structured observability. Let AI agents create, manage, and monitor scheduled tasks through a clean tool interface.

Why This Exists

Most cron libraries are designed for applications to embed. This server exposes cron scheduling as an MCP tool — agents can schedule jobs, monitor execution, retry failures, and query logs without touching the filesystem or crontab directly.

Companion server: System Monitoring MCP for host health metrics. Together they give agents full infrastructure observability and control.

Why This Over mcp-cron?

Featurecron-scheduler-mcpmcp-cron
LicenseMITAGPL-3.0
StorageSQLite (persistent)In-memory
Retry logicConfigurable retries with backoffNone
ObservabilitySuccess rate, avg duration, error trendsNone
Systemd integrationYesNo
Webhook triggersYesNo
Tool count103

mcp-cron is AGPL — fine for personal use, problematic for enterprise agents and commercial deployments. This server uses MIT + SQLite persistence + retry logic for production workloads.

Features

  • 10 tools: list_jobs, create_job, update_job, delete_job, get_job, run_now, get_status, get_logs, list_executions, pause_resume
  • SQLite persistence — jobs survive server restarts
  • Retry logic — configurable retry count and delay with attempt tracking
  • Structured logs — stdout/stderr capture, duration, exit codes per execution
  • Observability — success rate, average duration, error history per job
  • Webhook triggers — fire HTTP callbacks on job completion
  • MIT license — enterprise-friendly, no copyleft restrictions

Quick Start

npx @supernova123/cron-scheduler-mcp-server

Claude Desktop

{
  "mcpServers": {
    "cron-scheduler": {
      "command": "npx",
      "args": ["-y", "@supernova123/cron-scheduler-mcp-server"]
    }
  }
}

Cursor / VS Code

Add to your MCP settings (.cursor/mcp.json or equivalent):

{
  "mcpServers": {
    "cron-scheduler": {
      "command": "npx",
      "args": ["-y", "@supernova123/cron-scheduler-mcp-server"]
    }
  }
}

Tools

list_jobs

List all scheduled jobs with status, next run time, and last run result.

ParameterTypeRequiredDescription
enabledbooleanNoFilter by enabled/disabled status
limitnumberNoMax jobs to return (1-100)

Returns: Array of jobs with id, name, schedule, command, enabled status, next run time, last run result, and aggregate stats (success rate, total runs, avg duration).

create_job

Create a new cron job with a schedule and shell command.

ParameterTypeRequiredDescription
namestringYesHuman-readable job name (1-128 chars)
schedulestringYesCron expression or interval (see Schedule Formats below)
commandstringYesShell command to execute
enabledbooleanNoWhether job is enabled (default: true)
retryCountnumberNoRetries on failure, 0-10 (default: 0)
retryDelayMsnumberNoDelay between retries in ms, 0-60000 (default: 1000)
timeoutMsnumberNoExecution timeout in ms, 1000-3600000 (default: 30000)

delete_job

Remove a scheduled job and its entire run history.

ParameterTypeRequiredDescription
jobIdUUIDYesJob ID to delete

run_now

Execute a job immediately, bypassing its schedule. Useful for testing or manual triggers.

ParameterTypeRequiredDescription
jobIdUUIDYesJob ID to execute

Returns: Run result with status, exit code, stdout/stderr (truncated to 2000 chars), and duration.

get_status

Get detailed job status including last run, next run, success rate, average duration, and recent error history.

ParameterTypeRequiredDescription
jobIdUUIDYesJob ID to check

Returns: Full job config, next scheduled run, whether currently running, aggregate stats, and last 10 runs with status/exit code/duration.

get_logs

Get execution logs for a job with full stdout, stderr, duration, and exit code.

ParameterTypeRequiredDescription
jobIdUUIDYesJob ID
limitnumberNoMax runs to return (1-100, default: 20)

pause_resume

Pause or resume a job without deleting it. Paused jobs retain their schedule but won't execute until resumed.

ParameterTypeRequiredDescription
jobIdUUIDYesJob ID to pause/resume
enabledbooleanYestrue to resume, false to pause

Schedule Formats

  • Cron expressions: Standard 5-field format
    • */5 * * * * — every 5 minutes
    • 0 9 * * 1-5 — weekdays at 9am
    • 30 2 * * 0 — Sundays at 2:30am
  • Intervals: Simple duration strings
    • 30s — every 30 seconds
    • 5m — every 5 minutes
    • 1h — every hour

Use Cases

  • Infrastructure automation: Schedule health checks, log rotation, cleanup scripts
  • Data pipelines: Periodic data pulls, report generation, cache invalidation
  • Agent workflows: Let AI agents schedule their own recurring tasks (monitoring, backups, notifications)
  • DevOps: Scheduled deployments, canary checks, post-deploy verification
  • Testing: Recurring integration tests, smoke checks, performance benchmarks

Configuration

Environment VariableDefaultDescription
CRON_SCHEDULER_DBcron-scheduler.dbSQLite database path (relative to CWD)

Storage

All job definitions and execution history are stored in a SQLite database. The database file persists across server restarts — jobs survive crashes and restarts without re-creation.

License

MIT