@moor-sh/mcp 0.27.2 → 0.28.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.
- package/README.md +2 -2
- package/dist/index.js +13 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,8 +119,8 @@ The server registers 53 tools. Regenerate this section with `bun run docs` after
|
|
|
119
119
|
| --- | --- | --- |
|
|
120
120
|
| `moor_env_list` | List Environment Variables | List all environment variables set for a project. |
|
|
121
121
|
| `moor_env_set` | Set Environment Variables | Set environment variables for a project. Merges with existing vars. Automatically restarts the container if running. |
|
|
122
|
-
| `moor_cron_create` | Create Cron | Creates a cron schedule on a project. Schedule is a 5-field crontab string with numeric values only (no jan/sun/etc.). Day-of-week uses 0=Sunday through 6=Saturday; 7 is not accepted. |
|
|
123
|
-
| `moor_cron_update` | Update Cron | Updates a cron's fields by id. Schedule
|
|
122
|
+
| `moor_cron_create` | Create Cron | Creates a cron schedule on a project. Schedule is a 5-field crontab string with numeric values only (no jan/sun/etc.). Day-of-week uses 0=Sunday through 6=Saturday; 7 is not accepted. timeout_ms defaults to 10 minutes and supports up to 7 days. |
|
|
123
|
+
| `moor_cron_update` | Update Cron | Updates a cron's fields by id, including timeout_ms. Schedule and timeout are validated if provided. |
|
|
124
124
|
| `moor_cron_delete` | Delete Cron | Deletes a cron by id. |
|
|
125
125
|
| `moor_cron_run` | Run Cron Now | Triggers a cron to run immediately. Requires the project's container to be running. |
|
|
126
126
|
| `moor_env_delete` | Delete Environment Variables | Removes one or more environment variables from a project. Restarts the container only if at least one key was actually deleted AND the project was running. |
|
package/dist/index.js
CHANGED
|
@@ -130,6 +130,8 @@ var CRON_PART_PATTERNS = [
|
|
|
130
130
|
/^\*\/(\d+)$/,
|
|
131
131
|
/^(\d+)-(\d+)\/(\d+)$/
|
|
132
132
|
];
|
|
133
|
+
var CRON_TIMEOUT_MIN_MS = 60000;
|
|
134
|
+
var CRON_TIMEOUT_MAX_MS = 604800000;
|
|
133
135
|
function validateCronSchedule(schedule) {
|
|
134
136
|
const parts = schedule.trim().split(/\s+/);
|
|
135
137
|
if (parts.length !== 5) {
|
|
@@ -748,14 +750,15 @@ function registerEnvTools(server, client2) {
|
|
|
748
750
|
});
|
|
749
751
|
server.registerTool("moor_cron_create", {
|
|
750
752
|
title: "Create Cron",
|
|
751
|
-
description: "Creates a cron schedule on a project. Schedule is a 5-field crontab string with numeric values only (no jan/sun/etc.). Day-of-week uses 0=Sunday through 6=Saturday; 7 is not accepted.",
|
|
753
|
+
description: "Creates a cron schedule on a project. Schedule is a 5-field crontab string with numeric values only (no jan/sun/etc.). Day-of-week uses 0=Sunday through 6=Saturday; 7 is not accepted. timeout_ms defaults to 10 minutes and supports up to 7 days.",
|
|
752
754
|
inputSchema: z3.object({
|
|
753
755
|
project: z3.string().describe("Project name or ID"),
|
|
754
756
|
name: z3.string().min(1).describe("Human-readable name for the cron"),
|
|
755
757
|
schedule: z3.string().describe('5-field crontab, e.g. "0 3 * * *" for 03:00 daily'),
|
|
756
|
-
command: z3.string().min(1).describe("Shell command to run inside the project's container")
|
|
758
|
+
command: z3.string().min(1).describe("Shell command to run inside the project's container"),
|
|
759
|
+
timeout_ms: z3.number().int().min(CRON_TIMEOUT_MIN_MS).max(CRON_TIMEOUT_MAX_MS).optional().describe("Maximum run time in milliseconds. Defaults to 10 minutes; maximum is 7 days.")
|
|
757
760
|
})
|
|
758
|
-
}, async ({ project, name, schedule, command }) => {
|
|
761
|
+
}, async ({ project, name, schedule, command, timeout_ms }) => {
|
|
759
762
|
const err = validateCronSchedule(schedule);
|
|
760
763
|
if (err)
|
|
761
764
|
throw new Error(`Invalid schedule: ${err}`);
|
|
@@ -763,7 +766,8 @@ function registerEnvTools(server, client2) {
|
|
|
763
766
|
const res = await apiResponse.post(`/api/projects/${p.id}/crons`, {
|
|
764
767
|
name,
|
|
765
768
|
schedule,
|
|
766
|
-
command
|
|
769
|
+
command,
|
|
770
|
+
...timeout_ms === undefined ? {} : { timeout_ms }
|
|
767
771
|
});
|
|
768
772
|
if (!res.ok)
|
|
769
773
|
throw new Error(`Failed to create cron: ${await readErrorMessage(res)}`);
|
|
@@ -772,15 +776,16 @@ function registerEnvTools(server, client2) {
|
|
|
772
776
|
});
|
|
773
777
|
server.registerTool("moor_cron_update", {
|
|
774
778
|
title: "Update Cron",
|
|
775
|
-
description: "Updates a cron's fields by id. Schedule
|
|
779
|
+
description: "Updates a cron's fields by id, including timeout_ms. Schedule and timeout are validated if provided.",
|
|
776
780
|
inputSchema: z3.object({
|
|
777
781
|
cron_id: z3.number().int().positive().describe("Cron ID"),
|
|
778
782
|
name: z3.string().min(1).optional(),
|
|
779
783
|
schedule: z3.string().optional(),
|
|
780
784
|
command: z3.string().min(1).optional(),
|
|
785
|
+
timeout_ms: z3.number().int().min(CRON_TIMEOUT_MIN_MS).max(CRON_TIMEOUT_MAX_MS).optional(),
|
|
781
786
|
enabled: z3.boolean().optional().describe("Enable or disable the cron")
|
|
782
787
|
})
|
|
783
|
-
}, async ({ cron_id, name, schedule, command, enabled }) => {
|
|
788
|
+
}, async ({ cron_id, name, schedule, command, timeout_ms, enabled }) => {
|
|
784
789
|
if (schedule !== undefined) {
|
|
785
790
|
const err = validateCronSchedule(schedule);
|
|
786
791
|
if (err)
|
|
@@ -793,6 +798,8 @@ function registerEnvTools(server, client2) {
|
|
|
793
798
|
body.schedule = schedule;
|
|
794
799
|
if (command !== undefined)
|
|
795
800
|
body.command = command;
|
|
801
|
+
if (timeout_ms !== undefined)
|
|
802
|
+
body.timeout_ms = timeout_ms;
|
|
796
803
|
if (enabled !== undefined)
|
|
797
804
|
body.enabled = enabled ? 1 : 0;
|
|
798
805
|
if (Object.keys(body).length === 0) {
|
package/package.json
CHANGED