caldav-mcp 0.2.1 → 0.2.2
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
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
🗓️ A CalDAV Model Context Protocol (MCP) server to expose calendar operations as tools for AI assistants.
|
|
6
6
|
|
|
7
|
+
[](https://github.com/dominik1001/caldav-mcp/actions/workflows/release.yml)
|
|
8
|
+
[](https://www.npmjs.com/package/caldav-mcp)
|
|
7
9
|
[](https://choosealicense.com/licenses/mit/)
|
|
8
10
|
[](https://github.com/prettier/prettier)
|
|
9
11
|
[](https://modelcontextprotocol.io)
|
|
@@ -14,8 +16,10 @@
|
|
|
14
16
|
## ✨ Features
|
|
15
17
|
|
|
16
18
|
- Connect to CalDAV servers
|
|
17
|
-
-
|
|
19
|
+
- List calendars
|
|
18
20
|
- List calendar events within a specific timeframe
|
|
21
|
+
- Create calendar events
|
|
22
|
+
- Delete calendar events by UID
|
|
19
23
|
|
|
20
24
|
## Setup
|
|
21
25
|
|
|
@@ -38,7 +42,7 @@
|
|
|
38
42
|
}
|
|
39
43
|
```
|
|
40
44
|
|
|
41
|
-
##
|
|
45
|
+
## Development
|
|
42
46
|
|
|
43
47
|
1. Compile TypeScript to JavaScript:
|
|
44
48
|
```bash
|
|
@@ -47,7 +51,7 @@ npx tsc
|
|
|
47
51
|
|
|
48
52
|
2. Run the MCP server:
|
|
49
53
|
```bash
|
|
50
|
-
node index.js
|
|
54
|
+
node dist/index.js
|
|
51
55
|
```
|
|
52
56
|
|
|
53
57
|
## Available Tools
|
|
@@ -71,9 +75,34 @@ Lists events within a specified timeframe.
|
|
|
71
75
|
Parameters:
|
|
72
76
|
- `start`: DateTime string - Start of the timeframe
|
|
73
77
|
- `end`: DateTime string - End of the timeframe
|
|
78
|
+
- `calendarUrl`: String - URL of the calendar
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
- A list of events that fall within the given timeframe, each containing:
|
|
82
|
+
- `uid`: Unique identifier for the event (required for deletion)
|
|
83
|
+
- `summary`: Event title/summary
|
|
84
|
+
- `start`: Event start time
|
|
85
|
+
- `end`: Event end time
|
|
86
|
+
|
|
87
|
+
### delete-event
|
|
88
|
+
|
|
89
|
+
Deletes an event from the calendar.
|
|
90
|
+
|
|
91
|
+
Parameters:
|
|
92
|
+
- `uid`: String - Unique identifier of the event to delete (obtained from list-events)
|
|
93
|
+
- `calendarUrl`: String - URL of the calendar
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
- Confirmation message when the event is successfully deleted
|
|
97
|
+
|
|
98
|
+
### list-calendars
|
|
99
|
+
|
|
100
|
+
Lists all available calendars.
|
|
101
|
+
|
|
102
|
+
Parameters: none
|
|
74
103
|
|
|
75
104
|
Returns:
|
|
76
|
-
-
|
|
105
|
+
- List of all available calendars
|
|
77
106
|
|
|
78
107
|
## License
|
|
79
108
|
|
|
@@ -9,12 +9,15 @@ const recurrenceRuleSchema = z.object({
|
|
|
9
9
|
bymonth: z.array(z.number()).optional(),
|
|
10
10
|
});
|
|
11
11
|
export function registerCreateEvent(client, server) {
|
|
12
|
-
server.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
server.registerTool("create-event", {
|
|
13
|
+
description: "Creates an event in the calendar specified by its URL",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
summary: z.string(),
|
|
16
|
+
start: z.string().datetime(),
|
|
17
|
+
end: z.string().datetime(),
|
|
18
|
+
calendarUrl: z.string(),
|
|
19
|
+
recurrenceRule: recurrenceRuleSchema.optional(),
|
|
20
|
+
},
|
|
18
21
|
}, async ({ calendarUrl, summary, start, end, recurrenceRule }) => {
|
|
19
22
|
const event = await client.createEvent(calendarUrl, {
|
|
20
23
|
summary: summary,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerDeleteEvent(client, server) {
|
|
3
|
-
server.
|
|
3
|
+
server.registerTool("delete-event", {
|
|
4
|
+
description: "Deletes an event in the calendar specified by its URL",
|
|
5
|
+
inputSchema: { uid: z.string(), calendarUrl: z.string() },
|
|
6
|
+
}, async ({ uid, calendarUrl }) => {
|
|
4
7
|
await client.deleteEvent(calendarUrl, uid);
|
|
5
8
|
return {
|
|
6
9
|
content: [{ type: "text", text: "Event deleted" }],
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export async function registerListCalendars(client, server) {
|
|
2
2
|
const calendars = await client.getCalendars();
|
|
3
|
-
server.
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
server.registerTool("list-calendars", {
|
|
4
|
+
description: "List all calendars returning both name and URL",
|
|
5
|
+
inputSchema: {},
|
|
6
|
+
}, async () => {
|
|
7
|
+
return { content: [{ type: "text", text: JSON.stringify(calendars) }] };
|
|
6
8
|
});
|
|
7
9
|
}
|
|
@@ -3,13 +3,21 @@ const dateString = z.string().refine((val) => !isNaN(Date.parse(val)), {
|
|
|
3
3
|
message: "Invalid date string",
|
|
4
4
|
});
|
|
5
5
|
export function registerListEvents(client, server) {
|
|
6
|
-
server.
|
|
6
|
+
server.registerTool("list-events", {
|
|
7
|
+
description: "List all events between start and end date in the calendar specified by its URL",
|
|
8
|
+
inputSchema: {
|
|
9
|
+
start: dateString,
|
|
10
|
+
end: dateString,
|
|
11
|
+
calendarUrl: z.string(),
|
|
12
|
+
},
|
|
13
|
+
}, async ({ calendarUrl, start, end }) => {
|
|
7
14
|
const options = {
|
|
8
15
|
start: new Date(start),
|
|
9
16
|
end: new Date(end),
|
|
10
17
|
};
|
|
11
18
|
const allEvents = await client.getEvents(calendarUrl, options);
|
|
12
19
|
const data = allEvents.map((e) => ({
|
|
20
|
+
uid: e.uid,
|
|
13
21
|
summary: e.summary,
|
|
14
22
|
start: e.start,
|
|
15
23
|
end: e.end,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "caldav-mcp",
|
|
3
3
|
"description": "A CalDAV client using Model Context Protocol (MCP) to expose calendar operations as tools for AI assistants.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.2",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"prepare": "npm run build && husky",
|
|
16
16
|
"test": "vitest run",
|
|
17
17
|
"test:watch": "vitest",
|
|
18
|
+
"test:coverage": "vitest run --coverage",
|
|
18
19
|
"lint": "eslint src/",
|
|
19
20
|
"lint:fix": "eslint src/ --fix",
|
|
20
21
|
"watch": "tsc --watch",
|
|
@@ -32,27 +33,33 @@
|
|
|
32
33
|
"homepage": "https://github.com/dominik1001/caldav-mcp#readme",
|
|
33
34
|
"author": "Dominik Grusemann",
|
|
34
35
|
"license": "MIT",
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18.0.0",
|
|
38
|
+
"npm": ">=9.0.0"
|
|
39
|
+
},
|
|
35
40
|
"dependencies": {
|
|
36
41
|
"@modelcontextprotocol/sdk": "^1.13.0",
|
|
37
42
|
"dotenv": "^16.5.0",
|
|
38
|
-
"ts-caldav": "^0.2.
|
|
43
|
+
"ts-caldav": "^0.2.7"
|
|
39
44
|
},
|
|
40
45
|
"devDependencies": {
|
|
41
46
|
"@eslint/js": "^9.29.0",
|
|
42
47
|
"@semantic-release/changelog": "^6.0.3",
|
|
43
48
|
"@semantic-release/git": "^10.0.1",
|
|
44
49
|
"@semantic-release/github": "^11.0.3",
|
|
50
|
+
"@semantic-release/npm": "^13.1.4",
|
|
45
51
|
"@types/node": "^24.0.3",
|
|
52
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
46
53
|
"eslint": "^9.29.0",
|
|
47
54
|
"eslint-config-prettier": "^10.1.5",
|
|
48
55
|
"husky": "^9.1.7",
|
|
49
56
|
"lint-staged": "^16.1.2",
|
|
50
57
|
"prettier": "3.5.3",
|
|
51
|
-
"semantic-release": "^
|
|
58
|
+
"semantic-release": "^25.0.3",
|
|
52
59
|
"shx": "^0.4.0",
|
|
53
60
|
"typescript": "^5.8.3",
|
|
54
61
|
"typescript-eslint": "^8.34.1",
|
|
55
|
-
"vitest": "^3.
|
|
62
|
+
"vitest": "^3.2.4"
|
|
56
63
|
},
|
|
57
64
|
"lint-staged": {
|
|
58
65
|
"src/**/*.{ts,tsx,js,jsx}": [
|