@cronicorn/mcp-server 1.19.0 → 1.19.1

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 CHANGED
@@ -1,296 +1,143 @@
1
1
  # Cronicorn MCP Server
2
2
 
3
- Model Context Protocol server that enables AI agents to manage cron jobs through Cronicorn.
3
+ [![npm version](https://badge.fury.io/js/@cronicorn%2Fmcp-server.svg)](https://www.npmjs.com/package/@cronicorn/mcp-server)
4
4
 
5
- ## Overview
5
+ MCP server for managing cron jobs through AI assistants (Claude, Copilot, Cursor, etc.).
6
6
 
7
- This MCP server provides tools for AI assistants (like Claude Desktop, Cline, etc.) to:
8
- - Create and manage cron jobs
9
- - List existing jobs and their schedules
10
- - Pause/unpause jobs
11
- - View job execution history
7
+ ## Setup
12
8
 
13
- Authentication uses OAuth 2.0 Device Authorization Grant (RFC 8628) to securely connect to your Cronicorn account.
14
-
15
- ## Installation
16
-
17
- ### Published Package (Recommended)
9
+ <details open>
10
+ <summary><strong>Claude Code (CLI)</strong></summary>
18
11
 
19
12
  ```bash
20
- npm install -g @cronicorn/mcp-server
21
- # or
22
- pnpm add -g @cronicorn/mcp-server
13
+ claude mcp add cronicorn -- npx -y @cronicorn/mcp-server
23
14
  ```
15
+ </details>
24
16
 
25
- ### From Source (Development)
26
-
27
- ```bash
28
- # From monorepo root
29
- pnpm install
30
- pnpm --filter @cronicorn/mcp-server build
31
-
32
- # Link globally (optional)
33
- cd apps/mcp-server
34
- pnpm link --global
35
- ```
36
-
37
- ## Usage
38
-
39
- ### Claude Desktop
17
+ <details>
18
+ <summary><strong>Claude Desktop</strong></summary>
40
19
 
41
- Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
20
+ `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
42
21
 
43
22
  ```json
44
23
  {
45
24
  "mcpServers": {
46
25
  "cronicorn": {
47
- "command": "cronicorn-mcp"
26
+ "command": "npx",
27
+ "args": ["-y", "@cronicorn/mcp-server"]
48
28
  }
49
29
  }
50
30
  }
51
31
  ```
32
+ </details>
52
33
 
53
- ### VS Code / GitHub Copilot
54
-
55
- **Option 1: VS Code with GitHub Copilot (Native MCP Support)**
56
-
57
- GitHub Copilot in VS Code supports MCP through [agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode). Configure in your VS Code settings:
34
+ <details>
35
+ <summary><strong>VS Code / GitHub Copilot</strong></summary>
58
36
 
59
- 1. Open VS Code Settings (JSON) via `Cmd+Shift+P` → "Preferences: Open User Settings (JSON)"
60
-
61
- 2. Add the MCP server configuration:
37
+ In VS Code settings (JSON):
62
38
 
63
39
  ```json
64
40
  {
65
41
  "github.copilot.chat.mcp.servers": {
66
42
  "cronicorn": {
67
- "command": "cronicorn-mcp"
43
+ "command": "npx",
44
+ "args": ["-y", "@cronicorn/mcp-server"]
68
45
  }
69
46
  }
70
47
  }
71
48
  ```
72
49
 
73
- Alternatively, create an `mcp.json` file in your workspace or user config directory:
74
-
75
- **User config** (`~/.vscode/mcp.json`):
76
- ```json
77
- {
78
- "mcpServers": {
79
- "cronicorn": {
80
- "command": "cronicorn-mcp"
81
- }
82
- }
83
- }
84
- ```
50
+ Or create `~/.vscode/mcp.json`:
85
51
 
86
- **Workspace config** (`.vscode/mcp.json` in project root):
87
52
  ```json
88
53
  {
89
54
  "mcpServers": {
90
55
  "cronicorn": {
91
- "command": "cronicorn-mcp"
56
+ "command": "npx",
57
+ "args": ["-y", "@cronicorn/mcp-server"]
92
58
  }
93
59
  }
94
60
  }
95
61
  ```
62
+ </details>
96
63
 
97
- **Option 2: VS Code Extensions**
98
-
99
- Popular VS Code extensions with MCP support:
100
-
101
- **[Cline](https://github.com/cline/cline)** - Autonomous coding agent
102
- ```json
103
- // In Cline's MCP settings
104
- {
105
- "mcpServers": {
106
- "cronicorn": {
107
- "command": "cronicorn-mcp"
108
- }
109
- }
110
- }
111
- ```
64
+ <details>
65
+ <summary><strong>Cursor / Cline / Continue</strong></summary>
112
66
 
113
- **[Continue](https://github.com/continuedev/continue)** - AI code assistant
114
67
  ```json
115
- // In Continue's config.json
116
68
  {
117
69
  "mcpServers": {
118
70
  "cronicorn": {
119
- "command": "cronicorn-mcp"
120
- }
121
- }
122
- }
123
- ```
124
-
125
- **[Cursor](https://docs.cursor.com/context/mcp)** - AI code editor (VS Code fork)
126
- ```json
127
- // In Cursor's MCP settings
128
- {
129
- "mcpServers": {
130
- "cronicorn": {
131
- "command": "cronicorn-mcp"
71
+ "command": "npx",
72
+ "args": ["-y", "@cronicorn/mcp-server"]
132
73
  }
133
74
  }
134
75
  }
135
76
  ```
77
+ </details>
136
78
 
137
- ### First Run - OAuth Device Flow
138
-
139
- On first run, the server will:
140
-
141
- 1. Display a device code and user code
142
- 2. Open your browser to https://cronicorn.com/device/approve
143
- 3. Enter the user code and approve access
144
- 4. Store credentials securely in `~/.cronicorn/credentials.json`
145
-
146
- Subsequent runs will use the stored access token automatically.
147
-
148
- ## Prompts (Slash Commands)
149
-
150
- Prompts are interactive conversation starters that guide you through common Cronicorn workflows. They're triggered using slash commands in your AI assistant.
151
-
152
- ### Available Prompts
153
-
154
- #### `/setup-first-job` - Get Started with Cronicorn
155
-
156
- Interactive guide for creating your first scheduled job. Works for all scenarios including new users and migrations from other cron systems.
157
-
158
- **Optional Arguments:**
159
- - `task_description`: What the job should do
160
- - `endpoint_url`: HTTP endpoint to call
161
- - `schedule_type`: "interval" or "cron"
162
-
163
- **Example Usage (GitHub Copilot):**
164
-
165
- In GitHub Copilot Chat, type:
166
- ```
167
- @cronicorn /setup-first-job
168
- ```
169
-
170
- Or with arguments:
171
- ```
172
- @cronicorn /setup-first-job task_description="check API health every 5 minutes" endpoint_url="https://api.myapp.com/health"
173
- ```
174
-
175
- The prompt will guide you through:
176
- 1. Understanding jobs vs endpoints
177
- 2. Creating a job container
178
- 3. Adding your HTTP endpoint
179
- 4. Configuring baseline schedules
180
- 5. Setting safety constraints
181
- 6. Enabling AI adaptation
182
-
183
- **What You'll Learn:**
184
- - Jobs vs endpoints (containers vs execution units)
185
- - Baseline schedules (cron vs interval)
186
- - AI hints for dynamic scheduling
187
- - Safety constraints (min/max intervals)
188
- - Response body instrumentation
79
+ ## Authentication
189
80
 
190
- ---
81
+ On first run, the server starts OAuth device flow:
191
82
 
192
- #### `/troubleshoot-failures` - Debug Failing Endpoints
83
+ 1. Opens browser to `https://cronicorn.com/device/approve`
84
+ 2. Enter the displayed user code
85
+ 3. Credentials stored in `~/.cronicorn/credentials.json`
193
86
 
194
- Debug failing job executions and identify solutions.
87
+ Tokens are valid for 30 days. Re-authentication is automatic when expired.
195
88
 
196
- **Optional Arguments:**
197
- - `job_or_endpoint_name`: Name/ID of failing endpoint
198
- - `error_description`: Error symptoms
199
- - `when_started`: "just-now", "today", "this-week", or "longer"
89
+ ## Tools
200
90
 
201
- **Example Usage (GitHub Copilot):**
91
+ ### Jobs
92
+ | Tool | Description |
93
+ |------|-------------|
94
+ | `createJob` | Create a new job container |
95
+ | `getJob` | Get job details |
96
+ | `listJobs` | List all jobs |
97
+ | `updateJob` | Update job properties |
98
+ | `archiveJob` | Archive a job (soft delete) |
99
+ | `pauseJob` | Pause job execution |
100
+ | `resumeJob` | Resume paused job |
202
101
 
203
- ```
204
- @cronicorn /troubleshoot-failures job_or_endpoint_name="payment-processor" error_description="timeout errors" when_started="today"
205
- ```
102
+ ### Endpoints
103
+ | Tool | Description |
104
+ |------|-------------|
105
+ | `addEndpoint` | Add HTTP endpoint to a job |
106
+ | `getEndpoint` | Get endpoint details |
107
+ | `listEndpoints` | List endpoints for a job |
108
+ | `updateEndpoint` | Update endpoint config |
109
+ | `archiveEndpoint` | Archive an endpoint |
110
+ | `pauseResumeEndpoint` | Pause/unpause endpoint |
206
111
 
207
- The prompt will guide you through:
208
- 1. Identifying the failing endpoint
209
- 2. Reviewing run history for patterns
210
- 3. Analyzing error details (status codes, messages)
211
- 4. Checking AI hints and scheduling state
212
- 5. Inspecting response bodies
213
- 6. Applying fixes (constraints, pausing, configuration)
112
+ ### AI Scheduling
113
+ | Tool | Description |
114
+ |------|-------------|
115
+ | `applyIntervalHint` | Suggest new interval |
116
+ | `scheduleOneShot` | Trigger immediate run |
117
+ | `clearHints` | Remove pending hints |
118
+ | `resetFailures` | Reset failure count |
214
119
 
215
- **Common Issues Covered:**
216
- - Timeout errors (increase timeout/execution time)
217
- - Rate limiting (429 errors, adjust min interval)
218
- - Service unavailable (500/503, pause endpoint)
219
- - Authentication failures (401/403, fix headers)
220
- - Network issues (connection refused, DNS)
221
- - Response body problems (size limits, structure)
120
+ ### Monitoring
121
+ | Tool | Description |
122
+ |------|-------------|
123
+ | `listEndpointRuns` | Get execution history |
124
+ | `getRunDetails` | Get specific run details |
125
+ | `getEndpointHealth` | Get health summary |
126
+ | `getDashboardStats` | Get account-wide stats |
222
127
 
223
- ---
128
+ ## Prompts
224
129
 
225
- ### Using Prompts in GitHub Copilot
130
+ Interactive guides available via slash commands:
226
131
 
227
- **In VS Code with GitHub Copilot Chat:**
132
+ | Prompt | Description |
133
+ |--------|-------------|
134
+ | `/setup-first-job` | Step-by-step guide for creating your first job |
135
+ | `/troubleshoot-failures` | Debug failing endpoints |
228
136
 
229
- 1. Open GitHub Copilot Chat (Click the chat icon or `Ctrl+Shift+I` / `Cmd+Shift+I`)
230
-
231
- 2. Use the `@cronicorn` agent with a slash command:
232
- ```
233
- @cronicorn /setup-first-job
234
- ```
235
-
236
- 3. Copilot will run the prompt and guide you through the workflow
237
-
238
- 4. Provide arguments inline:
239
- ```
240
- @cronicorn /migrate-from-cron current_system="vercel-cron" job_count="10"
241
- ```
242
-
243
- 5. Follow the interactive guidance to complete your task
244
-
245
- **Tips for Best Results:**
246
-
247
- - **Start broad**: Use prompts without arguments to get full guidance
248
- - **Provide context**: Include arguments when you have specific info
249
- - **Follow suggestions**: Prompts reference specific tools to use next
250
- - **Check resources**: Prompts include doc links for deeper learning
251
-
252
- **Note:** GitHub Copilot doesn't automatically load bundled resources like Claude Desktop does, but prompts include embedded summaries and hosted doc URLs for universal access.
253
-
254
- ---
255
-
256
- ### Using Prompts in Claude Desktop
257
-
258
- **In Claude Desktop:**
259
-
260
- 1. Type a slash command in the chat:
261
- ```
262
- /setup-first-job
263
- ```
264
-
265
- 2. Claude will execute the prompt and start guiding you
266
-
267
- 3. Prompts can reference bundled documentation resources:
268
- ```
269
- file:///docs/quick-start.md
270
- file:///docs/core-concepts.md
271
- ```
272
-
273
- 4. Claude automatically loads these resources for additional context
274
-
275
- ---
276
-
277
- ## Keeping Updated
278
-
279
- The MCP server does not automatically update. When using `npx` or global installation, you'll continue using the cached version until you manually update.
280
-
281
- ### Check Current Version
282
-
283
- ```bash
284
- npx @cronicorn/mcp-server --version
285
- # or for global install
286
- cronicorn-mcp --version
287
- ```
137
+ ## Updating
288
138
 
289
- ### Update Methods
139
+ Use `@latest` tag to always get the newest version:
290
140
 
291
- **For npx users (recommended):**
292
-
293
- Option 1: Use the `@latest` tag to always get the newest version
294
141
  ```json
295
142
  {
296
143
  "mcpServers": {
@@ -302,225 +149,29 @@ Option 1: Use the `@latest` tag to always get the newest version
302
149
  }
303
150
  ```
304
151
 
305
- Option 2: Clear npm cache and reinstall
306
- ```bash
307
- npm cache clean --force
308
- npx @cronicorn/mcp-server
309
- ```
310
-
311
- **For global installations:**
312
-
313
- ```bash
314
- npm update -g @cronicorn/mcp-server
315
- # or
316
- pnpm update -g @cronicorn/mcp-server
317
- ```
318
-
319
- ### Why Update?
320
-
321
- Regular updates ensure you have:
322
- - Latest bug fixes and security patches
323
- - New features and tools
324
- - Performance improvements
325
- - Compatibility with latest MCP clients
326
-
327
- **Note:** Using `@latest` in your configuration ensures you always run the newest version, but be aware this may occasionally introduce breaking changes. For production use, consider pinning to a specific version and updating manually after reviewing the [changelog](https://github.com/weskerllc/cronicorn/releases).
328
-
329
- ## Available Tools
330
-
331
- ### `create_job`
332
-
333
- Create a new cron job.
334
-
335
- **Parameters:**
336
- - `name` (string, required): Job name
337
- - `endpoint` (object, required):
338
- - `url` (string): HTTP endpoint URL
339
- - `method` (string): HTTP method (GET, POST, etc.)
340
- - `headers` (object, optional): HTTP headers
341
- - `body` (string, optional): Request body
342
- - `schedule` (string, required): Cron expression (e.g., "0 9 * * *")
343
- - `timezone` (string, optional): IANA timezone (e.g., "America/New_York")
344
-
345
- **Example:**
346
- ```
347
- Please create a job that checks my website health every 5 minutes
348
- ```
349
-
350
- ### `list_jobs`
351
-
352
- List all jobs for the authenticated user.
353
-
354
- **Parameters:**
355
- - `status` (string, optional): Filter by status (active, paused, all)
356
-
357
- **Example:**
358
- ```
359
- Show me all my active cron jobs
360
- ```
361
-
362
- ### `pause_job`
363
-
364
- Pause or unpause a job.
365
-
366
- **Parameters:**
367
- - `job_id` (string, required): Job ID
368
- - `paused` (boolean, required): true to pause, false to unpause
369
-
370
- **Example:**
371
- ```
372
- Pause the job named "website-health-check"
373
- ```
374
-
375
- ### `get_job_history`
376
-
377
- Get execution history for a job.
378
-
379
- **Parameters:**
380
- - `job_id` (string, required): Job ID
381
- - `limit` (number, optional): Number of recent runs to return (default: 10)
382
-
383
- **Example:**
384
- ```
385
- Show me the last 5 runs of my backup job
386
- ```
387
-
388
- ## Configuration
389
-
390
- ### Token Lifetime
391
-
392
- Access tokens are valid for **30 days** from authentication. The server automatically:
393
- - Checks token expiry on startup
394
- - Displays expiry information and days remaining
395
- - Triggers re-authentication when tokens expire
396
-
397
- **When tokens expire:**
398
- - You'll see: `⚠️ Token expired at [timestamp]`
399
- - Server automatically starts device flow
400
- - Complete authorization in browser to get new 30-day token
401
-
402
- **Monitoring token expiry:**
403
- - On startup, server logs: `📅 Token expires: [ISO timestamp] (in ~X days)`
404
- - Tokens are refreshed weekly to maintain session
405
- - Manual re-auth required every 30 days
406
-
407
- This follows industry standards (AWS CLI, GitHub CLI use similar lifetimes).
408
-
409
- ### Credentials Storage
410
-
411
- Credentials are stored in `~/.cronicorn/credentials.json` with permissions `0600` (owner read/write only).
412
-
413
- **File structure:**
414
- ```json
415
- {
416
- "access_token": "...",
417
- "refresh_token": "...",
418
- "expires_at": 1234567890000
419
- }
420
- ```
421
-
422
- ### Environment Variables
152
+ ## Environment Variables
423
153
 
424
- - `CRONICORN_API_URL`: Override API base URL (default: `https://api.cronicorn.com`)
425
- - `CRONICORN_WEB_URL`: Override web UI URL (default: `https://cronicorn.com`)
154
+ | Variable | Default | Description |
155
+ |----------|---------|-------------|
156
+ | `CRONICORN_API_URL` | `https://cronicorn.com/api` | API base URL |
157
+ | `CRONICORN_WEB_URL` | `https://cronicorn.com` | Web UI URL |
426
158
 
427
159
  ## Development
428
160
 
429
161
  ```bash
430
- # Build
431
- pnpm build
432
-
433
- # Watch mode
434
- pnpm watch
435
-
436
- # Type check
437
- pnpm typecheck
438
- ```
439
-
440
- ## Publishing
441
-
442
- The MCP server is published as a **bundled package** - all dependencies (including `@cronicorn/api-contracts`) are bundled into a single executable. See [BUNDLING.md](./BUNDLING.md) for technical details.
443
-
444
- ### Release Workflow
445
-
446
- ```bash
447
- # 1. Update version
448
- cd apps/mcp-server
449
- npm version patch|minor|major
450
-
451
- # 2. Build the bundle
452
- pnpm build
453
-
454
- # 3. Verify bundle contents
455
- pnpm pack
456
- tar -tzf cronicorn-mcp-server-*.tgz
457
-
458
- # 4. Publish to npm
459
- pnpm publish --access public
460
-
461
- # 5. Tag and push
462
- git add package.json
463
- git commit -m "chore(mcp-server): release v0.1.x"
464
- git tag mcp-server-v0.1.x
465
- git push --follow-tags
466
- ```
467
-
468
- ### What Gets Published
469
-
470
- - `dist/index.js` (470KB bundled executable)
471
- - `dist/index.js.map` (source maps)
472
- - `package.json`
473
- - `README.md`
474
-
475
- **Note**: Only production dependency is `@modelcontextprotocol/sdk` - everything else is bundled.
476
-
477
- ## Alternative: Context7 Documentation Access
478
-
479
- If you have the [Context7 MCP server](https://context7.com) installed alongside Cronicorn MCP, you can access Cronicorn documentation directly in your AI assistant:
480
-
481
- ```
482
- @context7 /weskerllc/cronicorn
162
+ # From monorepo root
163
+ pnpm install
164
+ pnpm --filter @cronicorn/mcp-server build
165
+ pnpm --filter @cronicorn/mcp-server dev
483
166
  ```
484
167
 
485
- This provides an alternative way to access up-to-date Cronicorn documentation without leaving your conversation. Context7 complements the Cronicorn MCP server's prompts and bundled resources.
486
-
487
- **Use cases:**
488
- - Quick doc lookups while working with Cronicorn MCP tools
489
- - Access to the latest documentation updates
490
- - Cross-reference between different sections of the docs
491
-
492
- ## Security
493
-
494
- - OAuth 2.0 Device Authorization Grant for secure authentication
495
- - Credentials stored locally with strict file permissions
496
- - No API keys or secrets stored in server code
497
- - Uses standard MCP stdio transport (no network exposure)
498
-
499
168
  ## Troubleshooting
500
169
 
501
- ### Token expired
170
+ **"No credentials found"** - Delete `~/.cronicorn/credentials.json` and re-authenticate.
502
171
 
503
- **Symptom:** Server shows `⚠️ Token expired at [timestamp]`
172
+ **Browser doesn't open** - Manually visit the URL shown in terminal.
504
173
 
505
- **Solution:** Automatic - server triggers device flow for re-authentication. Complete authorization in browser.
506
-
507
- **Manual test:** Run `pnpm test:expiry` to check current token status and test expiry handling.
508
-
509
- ### "No credentials found" error
510
-
511
- Delete `~/.cronicorn/credentials.json` and re-authenticate.
512
-
513
- ### Browser doesn't open automatically
514
-
515
- Manually visit the URL shown in the terminal and enter the user code.
516
-
517
- ### "Invalid grant" error
518
-
519
- Your access token may have expired or been revoked. Delete credentials and re-authenticate:
520
-
521
- ```bash
522
- rm ~/.cronicorn/credentials.json
523
- ```
174
+ **"Invalid grant" error** - Token revoked. Delete credentials and re-authenticate.
524
175
 
525
176
  ## License
526
177