Skip to main content

Task scheduling for AI agents — cron, intervals, delays via MCP

Project description

schedulermcp

Task scheduling for AI agents -- cron, intervals, delays via MCP

Part of the MCP AI Suite.

Features

  • Cron scheduling -- 5-field cron expressions (*, */N, N-M, N,M; weekday 0 = Monday) for recurring jobs
  • Interval and one-shot jobs -- fixed-interval repeats or single delayed execution
  • Watch jobs -- event-driven triggers that monitor shell commands and fire on condition changes
  • Condition evaluation -- rich condition syntax with numeric comparisons, contains, and variable interpolation
  • Pluggable executors -- log, webhook, or kernel (routes job goals through kernelmcp)
  • Pluggable stores -- in-memory or SQLite for job persistence across restarts
  • Exponential backoff retry with configurable max failures
  • Job lifecycle -- create, pause, resume, cancel, delete with full history tracking

Installation

pip install mcpaisuite-schedulermcp
# Optional extras:
pip install mcpaisuite-schedulermcp[dev]       # Development tools
pip install mcpaisuite-schedulermcp[all]       # All integrations
pip install mcpaisuite-schedulermcp[kernel]    # KernelMCP executor integration
pip install mcpaisuite-schedulermcp[webhook]   # Webhook executor

Quick Start

from schedulermcp import SchedulerFactory

scheduler = SchedulerFactory.create(store="sqlite", sqlite_path="scheduler.db")
job = await scheduler.schedule(
    goal="Generate daily status report",
    job_type="cron",
    cron="0 9 * * *",
)
scheduler.start()  # Start background tick loop

MCP Server

schedulermcp serve

Configuration

Variable Default Description
SCHEDULERMCP_STORE memory Job store: memory or sqlite
SCHEDULERMCP_EXECUTOR log Executor: log, webhook, or kernel
SCHEDULERMCP_SQLITE_PATH scheduler.db SQLite database path
SCHEDULERMCP_TICK_INTERVAL 15 Seconds between scheduler ticks

API Reference

SchedulerPipeline

Manages scheduled jobs -- create, execute, track, persist.

await scheduler.schedule(goal, job_type="once", cron="", interval_seconds=0,
                         delay_seconds=0, namespace="default") -> Job
await scheduler.cancel(job_id) -> bool
await scheduler.pause(job_id) -> bool
await scheduler.resume(job_id) -> bool
await scheduler.list_jobs(namespace="", status="") -> list[Job]
await scheduler.get_history(job_id) -> list[JobResult]
await scheduler.stats(namespace="") -> SchedulerStats
scheduler.start()   # Start background loop
scheduler.stop()    # Stop background loop

SchedulerFactory

SchedulerFactory.default()               # SQLite store, log executor
SchedulerFactory.from_env()              # Build from environment variables
SchedulerFactory.create(store="sqlite", executor="kernel", kernel_pipeline=kernel, ...)

Architecture

SchedulerPipeline runs a background tick loop that checks for due jobs on each tick. Time-based jobs (cron, interval, once) are evaluated against their next_run timestamp. Watch jobs execute a shell command and evaluate a condition expression against the output. The pluggable executor system allows routing job execution through a simple logger (dev), a webhook endpoint, or the full kernelmcp pipeline for autonomous agent-driven execution.

Testing

pip install -e ".[dev]"
pytest tests/ -v

License

AGPL-3.0 — see LICENSE.

Open source for individuals and open-source projects. For commercial use in closed-source products, a commercial license is available — contact contact@mcpaisuite.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcpaisuite_schedulermcp-1.0.5.tar.gz (43.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcpaisuite_schedulermcp-1.0.5-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file mcpaisuite_schedulermcp-1.0.5.tar.gz.

File metadata

  • Download URL: mcpaisuite_schedulermcp-1.0.5.tar.gz
  • Upload date:
  • Size: 43.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mcpaisuite_schedulermcp-1.0.5.tar.gz
Algorithm Hash digest
SHA256 67be6c39a63e46f8f761abfeb42acfb162247b10b194bc625cc3d7459f0b068c
MD5 e6bace5bad6a5328c498910d113a8502
BLAKE2b-256 00d096e14a3693a3b215e3b8abf7a926bd7ec2c48a8cff7dfaae100706e96d91

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpaisuite_schedulermcp-1.0.5.tar.gz:

Publisher: release.yml on gashel01/schedulermcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mcpaisuite_schedulermcp-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mcpaisuite_schedulermcp-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f2a699bb79b4168d0045905e5e205ace898a8d2a642ce987807033f96ad567c5
MD5 91d7f782fc52247fcd204b4ede5faa9a
BLAKE2b-256 8b7d0076b19dbb8b2bff58bad86510a01ae3cffecf70bcf976444cb76a440727

See more details on using hashes here.

Provenance

The following attestation bundles were made for mcpaisuite_schedulermcp-1.0.5-py3-none-any.whl:

Publisher: release.yml on gashel01/schedulermcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page