Skip to content

Commit fdc0f0b

Browse files
committed
README - Add MCP Server documentation section
Document the built-in MCP server for AI integration with Claude Code, Cursor, Cline, Windsurf, and other MCP-compatible tools. Includes quick setup guide, available tools reference, example prompts, human-readable schedule syntax, and multi-instance support. Links to detailed docs in docs/ folder.
1 parent 2b56744 commit fdc0f0b

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,91 @@ cronitor configure --users user1,user2
7979
```
8080
For systemd and Docker examples, and security best‑practices, see the full [Dashboard documentation](https://crontab.guru/dashboard.html).
8181

82+
## MCP Server (AI Integration)
83+
84+
The Cronitor CLI includes a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server, enabling integration with AI-powered development tools like Claude Code, Cursor, Cline, Windsurf, and others. Manage your cron jobs using natural language directly from your editor or terminal.
85+
86+
### Quick Setup
87+
88+
1. **Set dashboard credentials** (if not already configured):
89+
```bash
90+
cronitor configure --dash-username USER --dash-password PASS
91+
```
92+
93+
2. **Configure your MCP client** to run the Cronitor MCP server:
94+
```
95+
Command: cronitor
96+
Args: dash --mcp-instance default
97+
```
98+
99+
Example configuration for tools using `mcp.json`:
100+
```json
101+
{
102+
"mcpServers": {
103+
"cronitor": {
104+
"command": "cronitor",
105+
"args": ["dash", "--mcp-instance", "default"]
106+
}
107+
}
108+
}
109+
```
110+
111+
3. **Start using natural language** to manage your cron jobs!
112+
113+
### Available Tools
114+
115+
| Tool | Description |
116+
|------|-------------|
117+
| `create_cronjob` | Create a new cron job with name, command, and schedule |
118+
| `list_cronjobs` | List all cron jobs with optional filtering |
119+
| `update_cronjob` | Update an existing job's schedule, command, or status |
120+
| `delete_cronjob` | Delete a cron job |
121+
| `run_cronjob_now` | Execute a cron job immediately |
122+
| `get_cronitor_instance` | Get info about the current Cronitor instance |
123+
124+
### Example Prompts
125+
126+
- "Create a database backup job that runs every night at 2 AM"
127+
- "List all cron jobs containing 'backup'"
128+
- "Suspend the cleanup job"
129+
- "Run the backup job now"
130+
131+
### Human-Readable Schedules
132+
133+
The MCP server understands natural language schedules:
134+
- `"every 15 minutes"``*/15 * * * *`
135+
- `"every day at noon"``0 12 * * *`
136+
- `"every Monday at 10:30"``30 10 * * 1`
137+
- `"hourly"`, `"daily"`, `"weekly"`, `"monthly"`
138+
139+
### Multi-Instance Support
140+
141+
Connect to multiple Cronitor dashboards (dev, staging, production) by configuring instances in `~/.cronitor/cronitor.json`:
142+
143+
```json
144+
{
145+
"mcp_instances": {
146+
"production": {
147+
"url": "http://prod-server:9000",
148+
"username": "admin",
149+
"password": "password"
150+
}
151+
}
152+
}
153+
```
154+
155+
Then configure separate MCP servers in your client for each instance.
156+
157+
### Resources
158+
159+
The MCP server also exposes resources for programmatic access:
160+
- `cronitor://crontabs` - All crontab files as JSON
161+
- `cronitor://jobs` - All cron jobs as JSON
162+
163+
For complete documentation including SSH tunneling, custom prompts, and troubleshooting, see:
164+
- [MCP Integration Guide](docs/MCP_INTEGRATION.md)
165+
- [MCP Prompts Configuration](docs/MCP_PROMPTS.md)
166+
82167
## Uninstall CronitorCLI
83168
First, you will need to update any crontab files that were edited to include Cronitor to remove the reference to `cronitor exec MONITOR_KEY` that were added when you created monitors.
84169

0 commit comments

Comments
 (0)