@cronicorn/mcp-server 1.4.5 → 1.5.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.
@@ -0,0 +1,133 @@
1
+ ---
2
+ id: docs-readme
3
+ title: Cronicorn Documentation
4
+ description: Documentation overview and navigation guide
5
+ tags:
6
+ - user
7
+ - assistant
8
+ - essential
9
+ sidebar_position: 10
10
+ mcp:
11
+ uri: file:///docs/README.md
12
+ mimeType: text/markdown
13
+ priority: 1.0
14
+ lastModified: 2025-11-02T00:00:00Z
15
+ ---
16
+
17
+ # Cronicorn Documentation
18
+
19
+ Welcome to the Cronicorn documentation! This guide will help you find the right documentation for your needs.
20
+
21
+ ## Quick Navigation
22
+
23
+ ### 🚀 Getting Started (SaaS Users)
24
+
25
+ Using Cronicorn as a hosted service? Start here:
26
+
27
+ 1. **[Introduction](./introduction.md)** - What is Cronicorn and why use it
28
+ 2. **[Quick Start](./quick-start.md)** - Create your first scheduled job in 5 minutes
29
+ 3. **[Core Concepts](./core-concepts.md)** - Understand jobs, endpoints, and AI scheduling
30
+
31
+ **Perfect for:**
32
+ - SaaS developers monitoring APIs
33
+ - Teams running scheduled tasks
34
+ - Anyone using Cronicorn as a service
35
+
36
+ ### 🔧 Self-Hosting (Developers)
37
+
38
+ Want to deploy Cronicorn yourself? See technical docs:
39
+
40
+ 1. **[System Architecture](./technical/system-architecture.md)** - How Cronicorn works internally
41
+ 2. **[How Scheduling Works](./technical/how-scheduling-works.md)** - The governor algorithm
42
+ 3. **[How AI Adaptation Works](./technical/how-ai-adaptation-works.md)** - Optional AI features
43
+ 4. **[Configuration & Constraints](./technical/configuration-and-constraints.md)** - Safety and limits
44
+
45
+ **Perfect for:**
46
+ - DevOps engineers deploying Cronicorn
47
+ - Contributors to the open-source project
48
+ - Advanced users customizing the system
49
+
50
+ ### 🤖 AI Assistant Integration
51
+
52
+ Using Cronicorn with Claude, Cursor, or other AI assistants?
53
+
54
+ - **[MCP Server](https://www.npmjs.com/package/@cronicorn/mcp-server)** - Model Context Protocol integration
55
+ - Install with: `npm install -g @cronicorn/mcp-server`
56
+ - See [Quick Start MCP Section](./quick-start.md#using-with-ai-assistants) for setup
57
+
58
+ **Perfect for:**
59
+ - Claude Desktop users
60
+ - VS Code with GitHub Copilot
61
+ - Cursor, Cline, Continue users
62
+
63
+ ## Documentation Tags
64
+
65
+ Documents are tagged for different audiences:
66
+
67
+ - **`user`** - End users of the Cronicorn service
68
+ - **`assistant`** - AI assistants accessing via MCP
69
+ - **`essential`** - Core documentation everyone should read
70
+
71
+ ## Available Documentation
72
+
73
+ ### User Documentation
74
+ - ✅ [Introduction](./introduction.md) - Overview and key features
75
+ - ✅ [Core Concepts](./core-concepts.md) - Jobs, endpoints, scheduling, AI hints
76
+ - ✅ [Quick Start](./quick-start.md) - Get started in 5 minutes
77
+
78
+ ### Technical Documentation (Self-Hosting)
79
+ - ✅ [System Architecture](./technical/system-architecture.md) - Hexagonal architecture overview
80
+ - ✅ [How Scheduling Works](./technical/how-scheduling-works.md) - Governor algorithm details
81
+ - ✅ [How AI Adaptation Works](./technical/how-ai-adaptation-works.md) - AI planner internals
82
+ - ✅ [Coordinating Multiple Endpoints](./technical/coordinating-multiple-endpoints.md) - Advanced patterns
83
+ - ✅ [Configuration & Constraints](./technical/configuration-and-constraints.md) - Safety mechanisms
84
+ - ✅ [Technical Reference](./technical/reference.md) - API contracts and database schema
85
+
86
+ ## About This Documentation
87
+
88
+ This directory (`docs-v2/`) serves as the **single source of truth** for Cronicorn documentation, consumed by:
89
+
90
+ - **Docusaurus website** - Human-readable documentation site
91
+ - **MCP server** - AI assistants accessing documentation via Model Context Protocol
92
+
93
+ ### Frontmatter Structure
94
+
95
+ Each document includes metadata for both humans and AI:
96
+
97
+ ```yaml
98
+ ---
99
+ id: unique-identifier
100
+ title: Human-Readable Title
101
+ description: Brief description
102
+ tags:
103
+ - user # For end users
104
+ - assistant # For AI assistants
105
+ - essential # Core documentation
106
+ sidebar_position: 1
107
+ mcp:
108
+ uri: file:///docs/filename.md
109
+ mimeType: text/markdown
110
+ priority: 0.9 # 0.0-1.0, higher = more important
111
+ lastModified: 2025-11-02T00:00:00Z
112
+ ---
113
+ ```
114
+
115
+ ## Contributing
116
+
117
+ Found an issue or want to improve the docs?
118
+
119
+ 1. **Report issues**: [GitHub Issues](https://github.com/weskerllc/cronicorn/issues)
120
+ 2. **Suggest improvements**: [GitHub Discussions](https://github.com/weskerllc/cronicorn/discussions)
121
+ 3. **Submit PRs**: See our contributing guidelines on GitHub
122
+
123
+ ## Getting Help
124
+
125
+ - 📖 [Documentation Site](https://cronicorn.com/docs)
126
+ - 💬 [Discord Community](https://discord.gg/cronicorn)
127
+ - 📧 [Email Support](mailto:support@cronicorn.com)
128
+
129
+ ## Related Resources
130
+
131
+ - **[MCP Server Package](https://www.npmjs.com/package/@cronicorn/mcp-server)** - AI assistant integration
132
+ - **[GitHub Repository](https://github.com/weskerllc/cronicorn)** - Source code and issues
133
+ - **[API Documentation](https://app.cronicorn.com/docs/api)** - REST API reference
@@ -0,0 +1,233 @@
1
+ ---
2
+ id: core-concepts
3
+ title: Core Concepts
4
+ description: Key terminology for using Cronicorn
5
+ tags:
6
+ - user
7
+ - assistant
8
+ - essential
9
+ sidebar_position: 2
10
+ mcp:
11
+ uri: file:///docs/core-concepts.md
12
+ mimeType: text/markdown
13
+ priority: 0.95
14
+ lastModified: 2025-11-02T00:00:00Z
15
+ ---
16
+
17
+ # Core Concepts
18
+
19
+ Understand the key concepts for working with Cronicorn.
20
+
21
+ ## Jobs and Endpoints
22
+
23
+ ### Job
24
+
25
+ A **Job** is a container that groups related endpoints together.
26
+
27
+ **Example**: A "Data Sync" job might contain endpoints for syncing users, products, and orders from different APIs.
28
+
29
+ **Properties:**
30
+ - **Name**: Descriptive label (e.g., "API Health Checks")
31
+ - **Description**: Optional details about what this job does
32
+ - **Status**: Active, paused, or archived
33
+
34
+ ### Endpoint
35
+
36
+ An **Endpoint** is the actual work to be executed - an HTTP request that runs on a schedule.
37
+
38
+ **Example**: `POST https://api.example.com/sync/users` that runs every 5 minutes.
39
+
40
+ **Required:**
41
+ - **Name**: What this endpoint does (e.g., "Sync Users")
42
+ - **URL**: The HTTP endpoint to call
43
+ - **Method**: GET, POST, PUT, PATCH, or DELETE
44
+ - **Schedule**: Either a cron expression OR an interval in milliseconds
45
+
46
+ **Optional:**
47
+ - **Headers**: Custom HTTP headers
48
+ - **Body**: Request body (for POST/PUT/PATCH)
49
+ - **Min/Max Intervals**: Safety constraints (see below)
50
+ - **Timeout**: Maximum execution time
51
+
52
+ ## Scheduling
53
+
54
+ ### Baseline Schedule
55
+
56
+ Your **baseline schedule** is the default timing for an endpoint. You must choose ONE:
57
+
58
+ **Option 1: Cron Expression**
59
+ ```
60
+ "0 */5 * * *" // Every 5 minutes
61
+ "0 2 * * *" // Daily at 2am
62
+ "0 9 * * 1" // Mondays at 9am
63
+ ```
64
+
65
+ **Option 2: Interval (milliseconds)**
66
+ ```
67
+ 60000 // Every 60 seconds
68
+ 300000 // Every 5 minutes
69
+ 3600000 // Every hour
70
+ ```
71
+
72
+ The baseline schedule is always active and provides a fallback when AI hints expire.
73
+
74
+ ### AI Hints (Optional)
75
+
76
+ When AI is enabled, it can suggest temporary scheduling adjustments called **hints**:
77
+
78
+ **AI Interval Hint** - Adjust how often the endpoint runs:
79
+ - "Run every 30 seconds for the next hour" (instead of every 5 minutes)
80
+ - "Run every 15 minutes for the next 4 hours" (instead of every 5 minutes)
81
+ - Hints expire automatically (TTL) and revert to baseline
82
+
83
+ **AI One-Shot Hint** - Schedule a single immediate or future run:
84
+ - "Run once right now" (for immediate execution)
85
+ - "Run once at 2:30 PM" (for specific time)
86
+ - Happens once, then endpoint returns to baseline schedule
87
+
88
+ **How AI Decides:**
89
+ - Analyzes recent execution history (last 24 hours)
90
+ - Looks at success rates, failure patterns, response times
91
+ - Suggests adjustments while respecting your min/max constraints
92
+ - All hints have expiration times (TTL) - typically 15-60 minutes
93
+
94
+ ### Pause State
95
+
96
+ You can temporarily **pause** an endpoint:
97
+
98
+ - Stops all execution until a specified time
99
+ - Useful for maintenance windows or debugging
100
+ - Set to `null` to resume immediately
101
+ - Overrides all other scheduling (baseline and AI hints)
102
+
103
+ ## How Scheduling Works
104
+
105
+ The system picks the next run time using this priority order:
106
+
107
+ 1. **Paused?** → If yes, return the pause-until time
108
+ 2. **AI one-shot hint active?** → If yes, use that time
109
+ 3. **AI interval hint active?** → If yes, use last run + AI interval
110
+ 4. **Baseline cron configured?** → If yes, calculate next cron time
111
+ 5. **Baseline interval configured?** → Use last run + baseline interval
112
+
113
+ **Then apply safety constraints:**
114
+ - Clamp to minimum interval (if configured)
115
+ - Clamp to maximum interval (if configured)
116
+
117
+ This ensures AI suggestions always stay within your safety boundaries.
118
+
119
+ ## Safety Constraints
120
+
121
+ ### Minimum Interval
122
+
123
+ Prevents over-execution:
124
+
125
+ ```
126
+ minIntervalMs: 30000 // At least 30 seconds between runs
127
+ ```
128
+
129
+ **Use when:**
130
+ - Protecting API rate limits
131
+ - Preventing database overload
132
+ - Avoiding costs from too-frequent polling
133
+
134
+ **Example**: Health check every 5 minutes, but AI can't go faster than every 30 seconds.
135
+
136
+ ### Maximum Interval
137
+
138
+ Ensures timely execution:
139
+
140
+ ```
141
+ maxIntervalMs: 3600000 // At most 1 hour between runs
142
+ ```
143
+
144
+ **Use when:**
145
+ - Data must stay fresh (max 1 hour old)
146
+ - SLAs require regular checks
147
+ - Compliance needs frequent execution
148
+
149
+ **Example**: Sync every 5 minutes, but even if AI backs off, run at least every hour.
150
+
151
+ ### Execution Timeout
152
+
153
+ Maximum time for the HTTP request:
154
+
155
+ ```
156
+ timeoutMs: 30000 // Request must complete within 30 seconds
157
+ ```
158
+
159
+ If the request takes longer, it's cancelled and marked as timeout.
160
+
161
+ ## Execution Tracking
162
+
163
+ ### Run History
164
+
165
+ Every execution creates a **run** record with:
166
+
167
+ - **Status**: success, failure, timeout, or cancelled
168
+ - **Duration**: How long the execution took (milliseconds)
169
+ - **Timestamps**: When it started and finished
170
+ - **Error**: Error message (if failed)
171
+ - **Source**: Why it ran (baseline-cron, baseline-interval, ai-interval, ai-oneshot, etc.)
172
+
173
+ ### Failure Tracking
174
+
175
+ Endpoints track consecutive failures:
176
+
177
+ - **Failure count**: Increments on failure, resets to 0 on success
178
+ - **AI uses this**: To decide on backoff strategies
179
+ - **You see this**: In the UI for monitoring health
180
+
181
+ ## Multi-Tenancy
182
+
183
+ Every job and endpoint belongs to your account (tenant):
184
+
185
+ - **Complete isolation**: You only see your own jobs and data
186
+ - **Secure execution**: Endpoints run with your credentials
187
+ - **Per-account quotas**: Usage limits apply per account
188
+
189
+ ## Common Patterns
190
+
191
+ ### Health Check with Adaptive Frequency
192
+
193
+ ```
194
+ Baseline: Every 5 minutes (300000ms)
195
+ Min: 30 seconds (30000ms)
196
+ Max: 15 minutes (900000ms)
197
+
198
+ AI behavior:
199
+ - Normal: Runs every 5 minutes
200
+ - Errors detected: Increases to every 30 seconds
201
+ - All healthy: Backs off to every 15 minutes
202
+ ```
203
+
204
+ ### Daily Maintenance with Safety Net
205
+
206
+ ```
207
+ Baseline: "0 2 * * *" (daily at 2am)
208
+ Max: 26 hours
209
+
210
+ Behavior:
211
+ - Normally runs at 2am daily
212
+ - If it fails, max interval ensures retry within 26 hours
213
+ - Won't accidentally skip days
214
+ ```
215
+
216
+ ### API Polling with Rate Limit Protection
217
+
218
+ ```
219
+ Baseline: Every minute (60000ms)
220
+ Min: 30 seconds (30000ms) - protects rate limit
221
+ Max: 5 minutes (300000ms) - keeps data fresh
222
+
223
+ AI behavior:
224
+ - Adjusts between 30s and 5min based on data changes
225
+ - Never exceeds API rate limits (min)
226
+ - Ensures data freshness (max)
227
+ ```
228
+
229
+ ## Next Steps
230
+
231
+ - **[Introduction](./introduction.md)** - Why use Cronicorn
232
+ - **[Quick Start](./quick-start.md)** - Create your first job
233
+ - **[Technical Documentation](./technical/system-architecture.md)** - For developers and self-hosters
@@ -0,0 +1,152 @@
1
+ ---
2
+ id: introduction
3
+ title: Introduction to Cronicorn
4
+ description: AI-powered adaptive scheduling for modern applications
5
+ tags:
6
+ - user
7
+ - assistant
8
+ - essential
9
+ sidebar_position: 1
10
+ mcp:
11
+ uri: file:///docs/introduction.md
12
+ mimeType: text/markdown
13
+ priority: 0.9
14
+ lastModified: 2025-11-02T00:00:00Z
15
+ ---
16
+
17
+ # Introduction to Cronicorn
18
+
19
+ **Cronicorn** is an intelligent scheduler that automatically adapts to your application's behavior. Set baseline schedules and let AI optimize execution timing based on real-world patterns.
20
+
21
+ ## What is Cronicorn?
22
+
23
+ Cronicorn is a scheduling service that combines:
24
+
25
+ - **Traditional cron scheduling** - Set fixed intervals or cron expressions
26
+ - **AI-powered adaptation** (optional) - Automatically adjust timing based on success rates, failure patterns, and performance
27
+ - **HTTP endpoint execution** - Call any HTTP endpoint on your schedule
28
+ - **Real-time monitoring** - Track execution history, success rates, and performance
29
+
30
+ ## Why Use Cronicorn?
31
+
32
+ ### Problems with Static Schedulers
33
+
34
+ Traditional cron jobs have limitations:
35
+
36
+ - **Fixed timing** - Run every 5 minutes whether needed or not
37
+ - **No learning** - Repeated failures don't trigger automatic backoff
38
+ - **Manual intervention** - You adjust schedules manually based on metrics
39
+ - **Resource waste** - Over-polling wastes API rate limits and costs
40
+
41
+ ### How Cronicorn Helps
42
+
43
+ **For all users:**
44
+ - Set it and forget it - Define baseline schedules that just work
45
+ - Real-time visibility - Track all executions with detailed history
46
+ - Flexible scheduling - Use cron expressions or simple intervals
47
+ - Constraint protection - Set min/max intervals to prevent over/under execution
48
+
49
+ **With AI enabled (optional):**
50
+ - Automatic adaptation - Schedules adjust based on actual performance
51
+ - Intelligent backoff - Reduces frequency after failures automatically
52
+ - Dynamic optimization - Increases frequency when needed, decreases when idle
53
+ - Always respects your constraints - AI suggestions stay within your min/max limits
54
+
55
+ ## Key Features
56
+
57
+ ### 🗓️ Flexible Scheduling
58
+
59
+ - **Cron expressions**: `"0 */5 * * *"` for traditional cron syntax
60
+ - **Simple intervals**: `300000` (milliseconds) for straightforward timing
61
+ - **One-time runs**: Schedule immediate or future single executions
62
+ - **Pause/resume**: Temporarily disable endpoints for maintenance
63
+
64
+ ### 🤖 AI Adaptation (Optional)
65
+
66
+ When enabled, the AI planner:
67
+
68
+ - Analyzes execution patterns (success rates, failure streaks, response times)
69
+ - Suggests interval adjustments with expiration times (TTL)
70
+ - Respects your configured min/max constraints
71
+ - Gracefully degrades - baseline schedule continues if AI is unavailable
72
+
73
+ **Note**: Cronicorn works perfectly without AI. The baseline scheduler is production-ready and reliable.
74
+
75
+ ### 📊 Complete Visibility
76
+
77
+ - **Run history**: Every execution with timestamps, duration, status
78
+ - **Error tracking**: Detailed error messages for failures
79
+ - **Success metrics**: Track success rates and identify patterns
80
+ - **Scheduling transparency**: See why each run happened (baseline, AI hint, etc.)
81
+
82
+ ### 🛡️ Production Ready
83
+
84
+ - **Reliable execution**: Database-backed with distributed locking
85
+ - **Constraint protection**: Min/max intervals prevent runaway schedules
86
+ - **Multi-tenant isolation**: Secure separation between accounts
87
+ - **API & Web UI**: Manage jobs programmatically or visually
88
+
89
+ ## Use Cases
90
+
91
+ ### API Health Monitoring
92
+
93
+ Monitor your APIs with adaptive frequency:
94
+
95
+ - Baseline: Check every 5 minutes
96
+ - AI increases to every 30 seconds when errors detected
97
+ - AI backs off to every 15 minutes when stable
98
+ - Stays within your min (30s) and max (15min) constraints
99
+
100
+ ### Data Synchronization
101
+
102
+ Sync data between systems efficiently:
103
+
104
+ - Baseline: Sync every hour
105
+ - AI increases during business hours when changes are frequent
106
+ - AI decreases overnight when activity is low
107
+ - Respects API rate limits with max interval constraints
108
+
109
+ ### Scheduled Maintenance
110
+
111
+ Run cleanup and maintenance tasks:
112
+
113
+ - Baseline: Daily at 2am via cron expression
114
+ - Pause during known maintenance windows
115
+ - Monitor execution duration trends over time
116
+ - Track success/failure for audit compliance
117
+
118
+ ### Webhook Retry Logic
119
+
120
+ Retry failed webhooks intelligently:
121
+
122
+ - Baseline: Immediate retry, then exponential backoff
123
+ - AI adjusts retry timing based on downstream service patterns
124
+ - Automatic pause after sustained failures
125
+ - Resume when downstream recovers
126
+
127
+ ## How It Works
128
+
129
+ 1. **Create a Job** - Logical container for related endpoints
130
+ 2. **Add Endpoints** - HTTP endpoints with baseline schedules
131
+ 3. **Set Constraints** (optional) - Min/max intervals for safety
132
+ 4. **Enable AI** (optional) - Let AI optimize timing automatically
133
+ 5. **Monitor** - Track execution history and performance
134
+
135
+ ## Who Is Cronicorn For?
136
+
137
+ - **SaaS developers** monitoring API health across services
138
+ - **E-commerce teams** syncing inventory and order data
139
+ - **DevOps engineers** running scheduled maintenance tasks
140
+ - **Integration developers** managing webhook retries and polling
141
+
142
+ ## Getting Started
143
+
144
+ - **Using Cronicorn as a service**: See [Quick Start](./quick-start.md)
145
+ - **Self-hosting Cronicorn**: See [Technical Documentation](./technical/system-architecture.md)
146
+ - **AI assistant integration**: Use our [MCP Server](https://www.npmjs.com/package/@cronicorn/mcp-server)
147
+
148
+ ## Next Steps
149
+
150
+ - **[Core Concepts](./core-concepts.md)** - Understand jobs, endpoints, and scheduling
151
+ - **[Quick Start](./quick-start.md)** - Create your first scheduled job
152
+ - **[Technical Deep Dive](./technical/system-architecture.md)** - For developers and self-hosters