@jnss95/ical-mcp 1.0.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 +250 -0
- package/build/calendar/calendar.d.ts +69 -0
- package/build/calendar/calendar.d.ts.map +1 -0
- package/build/calendar/calendar.js +455 -0
- package/build/calendar/calendar.js.map +1 -0
- package/build/calendar/index.d.ts +3 -0
- package/build/calendar/index.d.ts.map +1 -0
- package/build/calendar/index.js +3 -0
- package/build/calendar/index.js.map +1 -0
- package/build/calendar/loader.d.ts +32 -0
- package/build/calendar/loader.d.ts.map +1 -0
- package/build/calendar/loader.js +179 -0
- package/build/calendar/loader.js.map +1 -0
- package/build/index.d.ts +13 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +707 -0
- package/build/index.js.map +1 -0
- package/build/types/calendar.d.ts +176 -0
- package/build/types/calendar.d.ts.map +1 -0
- package/build/types/calendar.js +5 -0
- package/build/types/calendar.js.map +1 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/index.js +2 -0
- package/build/types/index.js.map +1 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# iCal MCP Server
|
|
2
|
+
|
|
3
|
+
A modern Model Context Protocol (MCP) server for managing iCalendar files. This server allows AI assistants to interact with calendar data through a standardized protocol.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Load calendars** from:
|
|
8
|
+
- Local files (`.ics`)
|
|
9
|
+
- HTTP/HTTPS URLs
|
|
10
|
+
- Raw iCal strings
|
|
11
|
+
- **Query events** with filters for:
|
|
12
|
+
- Date ranges
|
|
13
|
+
- Search text (summary, description, location)
|
|
14
|
+
- Location
|
|
15
|
+
- Recurring event expansion
|
|
16
|
+
- **Full CRUD operations**:
|
|
17
|
+
- Create new events
|
|
18
|
+
- Update existing events
|
|
19
|
+
- Delete events
|
|
20
|
+
- **Multiple calendar support**: Load and manage multiple calendars simultaneously
|
|
21
|
+
- **Read-only mode**: HTTP calendars are automatically read-only
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
### Using npx (recommended)
|
|
26
|
+
|
|
27
|
+
You can run the server directly without installation:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @jonas/ical-mcp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Global Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g @jonas/ical-mcp
|
|
37
|
+
ical-mcp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Local Development
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
git clone https://github.com/jnss95/ical-mcp.git
|
|
44
|
+
cd ical-mcp
|
|
45
|
+
npm install
|
|
46
|
+
npm run build
|
|
47
|
+
npm start
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
### Environment Variables
|
|
53
|
+
|
|
54
|
+
You can pre-configure calendars using environment variables:
|
|
55
|
+
|
|
56
|
+
| Variable | Description |
|
|
57
|
+
|----------|-------------|
|
|
58
|
+
| `ICAL_URL` | URL to an iCal calendar (http/https) |
|
|
59
|
+
| `ICAL_FILE` | Path to a local .ics file |
|
|
60
|
+
| `ICAL_ALIAS` | Alias for the calendar (default: "default") |
|
|
61
|
+
| `ICAL_CALENDARS` | JSON array for multiple calendars |
|
|
62
|
+
|
|
63
|
+
**Multiple calendars example:**
|
|
64
|
+
```bash
|
|
65
|
+
ICAL_CALENDARS='[{"alias":"work","source":"https://example.com/work.ics"},{"alias":"personal","source":"/path/to/personal.ics"}]'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### VS Code MCP Configuration
|
|
69
|
+
|
|
70
|
+
Add to your VS Code settings (`.vscode/mcp.json`):
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"servers": {
|
|
75
|
+
"ical": {
|
|
76
|
+
"type": "stdio",
|
|
77
|
+
"command": "npx",
|
|
78
|
+
"args": ["@jnss95/ical-mcp"],
|
|
79
|
+
"env": {
|
|
80
|
+
"ICAL_URL": "https://example.com/your-calendar.ics"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Claude Desktop Configuration
|
|
88
|
+
|
|
89
|
+
Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
90
|
+
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"mcpServers": {
|
|
94
|
+
"ical": {
|
|
95
|
+
"command": "npx",
|
|
96
|
+
"args": ["@jnss95/ical-mcp"],
|
|
97
|
+
"env": {
|
|
98
|
+
"ICAL_URL": "https://example.com/your-calendar.ics"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Available Tools
|
|
106
|
+
|
|
107
|
+
### Calendar Management
|
|
108
|
+
|
|
109
|
+
| Tool | Description |
|
|
110
|
+
|------|-------------|
|
|
111
|
+
| `load_calendar` | Load a calendar from a file path or URL |
|
|
112
|
+
| `create_calendar` | Create a new empty calendar file |
|
|
113
|
+
| `list_loaded_calendars` | List all currently loaded calendars |
|
|
114
|
+
| `unload_calendar` | Unload a calendar from memory |
|
|
115
|
+
| `export_calendar` | Export calendar as iCal string |
|
|
116
|
+
| `get_calendar_info` | Get metadata about a loaded calendar |
|
|
117
|
+
|
|
118
|
+
### Event Operations
|
|
119
|
+
|
|
120
|
+
| Tool | Description |
|
|
121
|
+
|------|-------------|
|
|
122
|
+
| `list_events` | List all events in a calendar |
|
|
123
|
+
| `search_events` | Search events with filters |
|
|
124
|
+
| `get_event` | Get details of a specific event |
|
|
125
|
+
| `create_event` | Create a new event |
|
|
126
|
+
| `update_event` | Update an existing event |
|
|
127
|
+
| `delete_event` | Delete an event |
|
|
128
|
+
|
|
129
|
+
## Tool Examples
|
|
130
|
+
|
|
131
|
+
### Load a Calendar
|
|
132
|
+
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"tool": "load_calendar",
|
|
136
|
+
"arguments": {
|
|
137
|
+
"source": "/path/to/calendar.ics",
|
|
138
|
+
"alias": "work"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Search Events
|
|
144
|
+
|
|
145
|
+
```json
|
|
146
|
+
{
|
|
147
|
+
"tool": "search_events",
|
|
148
|
+
"arguments": {
|
|
149
|
+
"calendarId": "work",
|
|
150
|
+
"startDate": "2024-01-01T00:00:00Z",
|
|
151
|
+
"endDate": "2024-01-31T23:59:59Z",
|
|
152
|
+
"searchText": "meeting",
|
|
153
|
+
"expandRecurring": true
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Create Event
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"tool": "create_event",
|
|
163
|
+
"arguments": {
|
|
164
|
+
"calendarId": "work",
|
|
165
|
+
"summary": "Team Meeting",
|
|
166
|
+
"start": "2024-01-15T10:00:00Z",
|
|
167
|
+
"end": "2024-01-15T11:00:00Z",
|
|
168
|
+
"description": "Weekly team sync",
|
|
169
|
+
"location": "Conference Room A"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Create Recurring Event
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"tool": "create_event",
|
|
179
|
+
"arguments": {
|
|
180
|
+
"calendarId": "work",
|
|
181
|
+
"summary": "Daily Standup",
|
|
182
|
+
"start": "2024-01-15T09:00:00Z",
|
|
183
|
+
"end": "2024-01-15T09:15:00Z",
|
|
184
|
+
"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Update Event
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"tool": "update_event",
|
|
194
|
+
"arguments": {
|
|
195
|
+
"calendarId": "work",
|
|
196
|
+
"eventId": "event-uid@example.com",
|
|
197
|
+
"summary": "Updated Meeting Title",
|
|
198
|
+
"location": "New Location"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Development
|
|
204
|
+
|
|
205
|
+
### Running Tests
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# Run all tests
|
|
209
|
+
npm test
|
|
210
|
+
|
|
211
|
+
# Run tests with coverage
|
|
212
|
+
npm run test:coverage
|
|
213
|
+
|
|
214
|
+
# Run tests in watch mode
|
|
215
|
+
npm run test:watch
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Building
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Build TypeScript
|
|
222
|
+
npm run build
|
|
223
|
+
|
|
224
|
+
# Watch mode
|
|
225
|
+
npm run watch
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Project Structure
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
ical_mcp/
|
|
232
|
+
├── src/
|
|
233
|
+
│ ├── index.ts # MCP server entry point
|
|
234
|
+
│ ├── calendar/
|
|
235
|
+
│ │ ├── calendar.ts # Calendar class (CRUD operations)
|
|
236
|
+
│ │ ├── loader.ts # Calendar loading utilities
|
|
237
|
+
│ │ └── index.ts # Module exports
|
|
238
|
+
│ └── types/
|
|
239
|
+
│ ├── calendar.ts # Type definitions
|
|
240
|
+
│ ├── ical.d.ts # ical.js type declarations
|
|
241
|
+
│ └── index.ts # Type exports
|
|
242
|
+
├── build/ # Compiled JavaScript
|
|
243
|
+
├── package.json
|
|
244
|
+
├── tsconfig.json
|
|
245
|
+
└── vitest.config.ts
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## License
|
|
249
|
+
|
|
250
|
+
MIT
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar class for parsing and manipulating iCal data
|
|
3
|
+
*/
|
|
4
|
+
import type { CalendarEvent, CalendarMetadata, CreateEventOptions, UpdateEventOptions, QueryEventsOptions, QueryResult, CalendarSource } from '../types/calendar.js';
|
|
5
|
+
/**
|
|
6
|
+
* Manages calendar operations including parsing, querying, and modifying events
|
|
7
|
+
*/
|
|
8
|
+
export declare class Calendar {
|
|
9
|
+
private vcalendar;
|
|
10
|
+
private source;
|
|
11
|
+
constructor(source: CalendarSource);
|
|
12
|
+
/**
|
|
13
|
+
* Load and parse iCal data from a string
|
|
14
|
+
*/
|
|
15
|
+
loadFromString(icalString: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Get the raw iCal string representation
|
|
18
|
+
*/
|
|
19
|
+
toString(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Get calendar metadata
|
|
22
|
+
*/
|
|
23
|
+
getMetadata(): CalendarMetadata;
|
|
24
|
+
/**
|
|
25
|
+
* Get all events in the calendar
|
|
26
|
+
*/
|
|
27
|
+
getAllEvents(): CalendarEvent[];
|
|
28
|
+
/**
|
|
29
|
+
* Get a single event by UID
|
|
30
|
+
*/
|
|
31
|
+
getEvent(uid: string): CalendarEvent | null;
|
|
32
|
+
/**
|
|
33
|
+
* Query events with various filters
|
|
34
|
+
*/
|
|
35
|
+
queryEvents(options?: QueryEventsOptions): QueryResult;
|
|
36
|
+
/**
|
|
37
|
+
* Create a new event
|
|
38
|
+
*/
|
|
39
|
+
createEvent(options: CreateEventOptions): CalendarEvent;
|
|
40
|
+
/**
|
|
41
|
+
* Update an existing event
|
|
42
|
+
*/
|
|
43
|
+
updateEvent(uid: string, options: UpdateEventOptions): CalendarEvent;
|
|
44
|
+
/**
|
|
45
|
+
* Delete an event by UID
|
|
46
|
+
*/
|
|
47
|
+
deleteEvent(uid: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Get the calendar source configuration
|
|
50
|
+
*/
|
|
51
|
+
getSource(): CalendarSource;
|
|
52
|
+
/**
|
|
53
|
+
* Check if the calendar is writable
|
|
54
|
+
*/
|
|
55
|
+
isWritable(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Parse a VEVENT component into a CalendarEvent
|
|
58
|
+
*/
|
|
59
|
+
private parseVEvent;
|
|
60
|
+
/**
|
|
61
|
+
* Parse a date/time string into an ICAL.Time
|
|
62
|
+
*/
|
|
63
|
+
private parseDateTime;
|
|
64
|
+
/**
|
|
65
|
+
* Expand recurring events within a date range
|
|
66
|
+
*/
|
|
67
|
+
private expandRecurringEvents;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/calendar/calendar.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACf,MAAM,sBAAsB,CAAC;AAE9B;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,MAAM,CAAiB;gBAEnB,MAAM,EAAE,cAAc;IAQlC;;OAEG;IACH,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAKxC;;OAEG;IACH,QAAQ,IAAI,MAAM;IAIlB;;OAEG;IACH,WAAW,IAAI,gBAAgB;IAc/B;;OAEG;IACH,YAAY,IAAI,aAAa,EAAE;IAK/B;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI;IAc3C;;OAEG;IACH,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW;IAoF1D;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,aAAa;IAsFvD;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,aAAa;IA6HpE;;OAEG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAkBjC;;OAEG;IACH,SAAS,IAAI,cAAc;IAI3B;;OAEG;IACH,UAAU,IAAI,OAAO;IAIrB;;OAEG;IACH,OAAO,CAAC,WAAW;IAoDnB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;OAEG;IACH,OAAO,CAAC,qBAAqB;CA8D9B"}
|