mcp-cron 0.2.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +18 -8
  2. package/package.json +7 -7
package/README.md CHANGED
@@ -9,6 +9,7 @@ Model Context Protocol (MCP) server for scheduling and managing tasks through a
9
9
  - [Manage tasks](#available-mcp-tools) via MCP protocol
10
10
  - Task execution with command output capture
11
11
  - Task persistence across restarts (SQLite)
12
+ - Multi-instance safe — multiple instances can share the same database without duplicate execution
12
13
 
13
14
  ## Installation
14
15
 
@@ -173,6 +174,7 @@ The following command line arguments are supported:
173
174
  | `--mcp-config-path` | Path to MCP configuration file | `~/.cursor/mcp.json` |
174
175
  | `--db-path` | Path to SQLite database for result history | `~/.mcp-cron/results.db` |
175
176
  | `--prevent-sleep` | Prevent system from sleeping while mcp-cron is running (macOS and Windows) | `false` |
177
+ | `--poll-interval` | How often to check for due tasks | `1s` |
176
178
 
177
179
  ### Environment Variables
178
180
 
@@ -199,6 +201,7 @@ The following environment variables are supported:
199
201
  | `MCP_CRON_MCP_CONFIG_FILE_PATH` | Path to MCP configuration file | `~/.cursor/mcp.json` |
200
202
  | `MCP_CRON_STORE_DB_PATH` | Path to SQLite database for result history | `~/.mcp-cron/results.db` |
201
203
  | `MCP_CRON_PREVENT_SLEEP` | Prevent system from sleeping while mcp-cron is running (macOS and Windows) | `false` |
204
+ | `MCP_CRON_POLL_INTERVAL` | How often to check for due tasks (Go duration format) | `1s` |
202
205
 
203
206
  ### Sleep Prevention
204
207
 
@@ -234,15 +237,16 @@ When running with stdio transport, logs are redirected to a `mcp-cron.log` log f
234
237
 
235
238
  The server exposes several tools through the MCP protocol:
236
239
 
237
- 1. `list_tasks` - Lists all scheduled tasks
240
+ 1. `list_tasks` - Lists all tasks (scheduled and on-demand)
238
241
  2. `get_task` - Gets a specific task by ID
239
- 3. `add_task` - Adds a new scheduled task
240
- 4. `add_ai_task` - Adds a new scheduled AI (LLM) task with a prompt
242
+ 3. `add_task` - Adds a new shell command task (provide `schedule` for recurring, or omit for on-demand)
243
+ 4. `add_ai_task` - Adds a new AI (LLM) task with a prompt (provide `schedule` for recurring, or omit for on-demand)
241
244
  5. `update_task` - Updates an existing task
242
245
  6. `remove_task` - Removes a task by ID
243
- 7. `enable_task` - Enables a disabled task
244
- 8. `disable_task` - Disables an enabled task
245
- 9. `get_task_result` - Gets execution results for a task (latest by default, or recent history with `limit`)
246
+ 7. `run_task` - Immediately executes a task by ID (for on-demand tasks or ad-hoc runs of scheduled tasks)
247
+ 8. `enable_task` - Enables a task so it runs on its schedule or can be triggered via `run_task`
248
+ 9. `disable_task` - Disables a task so it stops running and cannot be triggered
249
+ 10. `get_task_result` - Gets execution results for a task (latest by default, or recent history with `limit`)
246
250
 
247
251
  ### Task Format
248
252
 
@@ -270,6 +274,12 @@ For shell command tasks, use the `command` field to specify the command to execu
270
274
  For AI tasks, use the `prompt` field to specify what the AI should do.
271
275
  The `type` field can be either `shell_command` (default) or `AI`.
272
276
 
277
+ **Scheduled vs on-demand tasks:**
278
+ - **Scheduled**: Provide a `schedule` (cron expression) — the task runs automatically on that schedule.
279
+ - **On-demand**: Omit `schedule` — the task sits idle until triggered via `run_task`.
280
+
281
+ `run_task` also works on scheduled tasks for ad-hoc execution outside their normal schedule. After execution, scheduled tasks resume their normal schedule; on-demand tasks return to idle.
282
+
273
283
  ### Task Status
274
284
 
275
285
  The tasks can have the following status values:
@@ -281,7 +291,7 @@ The tasks can have the following status values:
281
291
 
282
292
  ### Cron Expression Format
283
293
 
284
- The scheduler uses the [github.com/robfig/cron/v3](https://github.com/robfig/cron) library for parsing cron expressions. The format includes seconds:
294
+ Cron expressions are required for scheduled tasks and omitted for on-demand tasks. The scheduler uses the [github.com/robfig/cron/v3](https://github.com/robfig/cron) library for parsing. The format includes seconds:
285
295
 
286
296
  ```
287
297
  ┌───────────── second (0 - 59) (Optional)
@@ -341,4 +351,4 @@ See [docs/testing.md](docs/testing.md) for the full testing guide, including int
341
351
  ## Acknowledgments
342
352
 
343
353
  - [modelcontextprotocol/go-sdk](https://github.com/modelcontextprotocol/go-sdk) - Official Go SDK for the Model Context Protocol
344
- - [robfig/cron](https://github.com/robfig/cron) - Cron library for Go
354
+ - [robfig/cron](https://github.com/robfig/cron) - Cron expression parsing for Go
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-cron",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
4
  "description": "MCP server for cron task scheduling (shell commands and AI prompts)",
5
5
  "license": "AGPL-3.0-only",
6
6
  "bin": {
@@ -11,11 +11,11 @@
11
11
  "url": "git+https://github.com/jolks/mcp-cron.git"
12
12
  },
13
13
  "optionalDependencies": {
14
- "mcp-cron-darwin-amd64": "0.2.2",
15
- "mcp-cron-darwin-arm64": "0.2.2",
16
- "mcp-cron-linux-amd64": "0.2.2",
17
- "mcp-cron-linux-arm64": "0.2.2",
18
- "mcp-cron-windows-amd64": "0.2.2",
19
- "mcp-cron-windows-arm64": "0.2.2"
14
+ "mcp-cron-darwin-amd64": "0.4.0",
15
+ "mcp-cron-darwin-arm64": "0.4.0",
16
+ "mcp-cron-linux-amd64": "0.4.0",
17
+ "mcp-cron-linux-arm64": "0.4.0",
18
+ "mcp-cron-windows-amd64": "0.4.0",
19
+ "mcp-cron-windows-arm64": "0.4.0"
20
20
  }
21
21
  }