MCP Cron

by jolks

24 646 downloads Not rated yet

About

MCP server for scheduling and running AI prompts, HTTP/webhook requests, and shell commands

Explore

- Schedule shell command or prompt to AI tasks using cron expressions
- AI can have access to MCP servers
- Manage tasks via MCP protocol
- Task execution with command output capture
- Task persistence across restarts (SQLite)
- Multi-instance safe — multiple instances can share the same database without duplicate execution
- Support multiple isolated instances with different --db-path

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Cron
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

- Go 1.24.0 or higher


A more complete setup with AI provider, model selection, and sleep prevention:

json
{
"mcpServers": {
"mcp-cron": {
"command": "npx",
"args": [
"-y", "mcp-cron",
"--transport", "stdio",
"--prevent-sleep",
"--ai-provider", "anthropic",
"--ai-model", "claude-sonnet-4-5-20250929"
],
"env": {
"ANTHROPIC_API_KEY": "your-api-key"
}
}
}
}
``

The following environment variables are supported:

| Environment Variable | Description | Default |
|----------------------|-------------|---------|
|
MCP_CRON_SERVER_ADDRESS | The address to bind the server to | localhost |
|
MCP_CRON_SERVER_PORT | The port to bind the server to | 8080 |
|
MCP_CRON_SERVER_TRANSPORT | Transport mode: http or stdio | http |
|
MCP_CRON_SERVER_NAME | Deprecated — ignored; the server name is fixed to ensure self-reference detection works correctly | - |
|
MCP_CRON_SERVER_VERSION | Deprecated — ignored; version is set at build time via ldflags | - |
|
MCP_CRON_SCHEDULER_DEFAULT_TIMEOUT | Default timeout for task execution | 10m |
|
MCP_CRON_LOGGING_LEVEL | Logging level: debug, info, warn, error, fatal | info |
|
MCP_CRON_LOGGING_FILE | Log file path | stdout |
|
MCP_CRON_AI_PROVIDER | AI provider: openai or anthropic | openai |
|
MCP_CRON_AI_BASE_URL | Custom base URL for OpenAI-compatible endpoints (e.g. Ollama, vLLM, Groq, LiteLLM) | Not set |
|
MCP_CRON_AI_API_KEY | Generic fallback API key (used when provider-specific key is not set) | Not set |
|
OPENAI_API_KEY | OpenAI API key for AI tasks | Not set |
|
ANTHROPIC_API_KEY | Anthropic API key for AI tasks | Not set |
|
MCP_CRON_ENABLE_OPENAI_TESTS | Enable OpenAI integration tests | false |
|
MCP_CRON_AI_MODEL | LLM model to use for AI tasks | gpt-4o |
|
MCP_CRON_AI_MAX_TOOL_ITERATIONS | Maximum iterations for tool-enabled tasks | 20 |
|
MCP_CRON_MCP_CONFIG_FILE_PATH | Path to MCP configuration file | ~/.cursor/mcp.json |
|
MCP_CRON_STORE_DB_PATH | Path to SQLite database for result history | ~/.mcp-cron/results.db |
|
MCP_CRON_PREVENT_SLEEP | Prevent system from sleeping while mcp-cron is running (macOS and Windows) | false |
|
MCP_CRON_POLL_INTERVAL | How often to check for due tasks (Go duration format) | 1s` |

The server exposes several tools through the MCP protocol:

1. list_tasks - Lists all tasks (scheduled and on-demand)
2. get_task - Gets a specific task by ID
3. add_task - Adds a new shell command task (provide schedule for recurring, or omit for on-demand)
4. add_ai_task - Adds a new AI (LLM) task with a prompt (provide schedule for recurring, or omit for on-demand)
5. add_http_task - Adds a new HTTP (webhook) task that issues an HTTP request to a url (provide schedule for recurring, or omit for on-demand)
6. update_task - Updates an existing task
7. remove_task - Removes a task by ID
8. run_task - Executes a task by ID, waits for completion, and returns the result (for on-demand tasks or ad-hoc runs of scheduled tasks)
9. enable_task - Enables a task so it runs on its schedule or can be triggered via run_task
10. disable_task - Disables a task so it stops running and cannot be triggered
11. get_task_result - Gets execution results for a task (latest by default, or recent history with limit)
12. query_task_result - Runs a read-only SQL query against the database (SELECT only, capped at 1000 rows)

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp cron": {
            "mcp-cron": {
                "command": "npx",
                "args": [
                    "-y",
                    "mcp-cron"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-cron": {
        "command": "npx",
        "args": [
            "-y",
            "mcp-cron"
        ]
    }
}

Model Context Protocol (MCP) server for scheduling and managing tasks through a standardized API. The server provides task scheduling capabilities supporting both shell commands and AI-powered tasks, all accessible via the MCP protocol.

Features

- Schedule shell command or prompt to AI tasks using cron expressions
- AI can have access to MCP servers
- Manage tasks via MCP protocol
- Task execution with command output capture
- Task persistence across restarts (SQLite)
- Multi-instance safe — multiple instances can share the same database without duplicate execution
- Support multiple isolated instances with different --db-path

Installation

npm (recommended)

npx -y mcp-cron
Claude Code
claude mcp add mcp-cron -- npx -y mcp-cron
Cursor / Claude Desktop
{
  "mcpServers": {
    "mcp-cron": {
      "command": "npx",
      "args": ["-y", "mcp-cron", "--transport", "stdio"]
    }
  }
}
Recommended Configuration

A more complete setup with AI provider, model selection, and sleep prevention:

{
  "mcpServers": {
    "mcp-cron": {
      "command": "npx",
      "args": [
        "-y", "mcp-cron",
        "--transport", "stdio",
        "--prevent-sleep",
        "--ai-provider", "anthropic",
        "--ai-model", "claude-sonnet-4-5-20250929"
      ],
      "env": {
        "ANTHROPIC_API_KEY": "your-api-key"
      }
    }
  }
}
Using LiteLLM

To route AI tasks through a LiteLLM proxy:

{
  "mcpServers": {
    "mcp-cron": {
      "command": "npx",
      "args": [
        "-y", "mcp-cron",
        "--transport", "stdio",
        "--prevent-sleep",
        "--ai-base-url", "https://litellm.yourcompany.com",
        "--ai-model", "claude-sonnet-4-5-20250929"
      ],
      "env": {
        "MCP_CRON_AI_API_KEY": "sk-your-litellm-key"
      }
    }
  }
}

> The --ai-model value should match a model name in your LiteLLM proxy config. LiteLLM exposes an OpenAI-compatible API, so --ai-provider can be omitted (defaults to openai). When a custom base URL is set, mcp-cron automatically uses the Chat Completions API instead of the Responses API. The Responses API is only used for direct OpenAI (api.openai.com) and Azure OpenAI (*.openai.azure.com) endpoints.

> See Command Line Arguments and Environment Variables for all available options.

Building from Source

Prerequisites
- Go 1.24.0 or higher

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.