dav-mcp 3.0.5 → 3.0.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dav-mcp",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"mcpName": "io.github.PhilflowIO/dav-mcp",
|
|
5
5
|
"description": "Complete DAV integration for AI - Calendar (CalDAV), Contacts (CardDAV), and Tasks (VTODO) management via MCP protocol",
|
|
6
6
|
"type": "module",
|
package/src/server-stdio.js
CHANGED
|
@@ -108,7 +108,7 @@ async function startStdioServer() {
|
|
|
108
108
|
/**
|
|
109
109
|
* Create MCP Server with tool handlers
|
|
110
110
|
*/
|
|
111
|
-
function createMCPServer() {
|
|
111
|
+
function createMCPServer(ensureInit) {
|
|
112
112
|
const server = new Server(
|
|
113
113
|
{
|
|
114
114
|
name: process.env.MCP_SERVER_NAME || 'dav-mcp',
|
|
@@ -149,6 +149,9 @@ async function startStdioServer() {
|
|
|
149
149
|
throw error;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
// Ensure DAV clients are initialized before executing any tool
|
|
153
|
+
await ensureInit();
|
|
154
|
+
|
|
152
155
|
const startTime = Date.now();
|
|
153
156
|
toolCallLogger.logToolCallStart(toolName, toolArgs, { transport: 'stdio' });
|
|
154
157
|
|
|
@@ -180,19 +183,34 @@ async function startStdioServer() {
|
|
|
180
183
|
return server;
|
|
181
184
|
}
|
|
182
185
|
|
|
186
|
+
// Lazy initialization flag
|
|
187
|
+
let tsdavInitialized = false;
|
|
188
|
+
|
|
189
|
+
async function ensureTsdavInitialized() {
|
|
190
|
+
if (!tsdavInitialized) {
|
|
191
|
+
await initializeTsdav();
|
|
192
|
+
tsdavInitialized = true;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
183
196
|
// Main entry point
|
|
184
197
|
try {
|
|
185
198
|
logger.info('Starting dav-mcp STDIO server...');
|
|
186
199
|
|
|
187
|
-
//
|
|
188
|
-
|
|
200
|
+
// Try to initialize tsdav clients eagerly, but don't fail if unavailable
|
|
201
|
+
try {
|
|
202
|
+
await initializeTsdav();
|
|
203
|
+
tsdavInitialized = true;
|
|
204
|
+
} catch (initError) {
|
|
205
|
+
logger.warn({ error: initError.message }, 'DAV server not reachable at startup — will retry on first tool call');
|
|
206
|
+
}
|
|
189
207
|
|
|
190
208
|
// Initialize tool call logger
|
|
191
209
|
initializeToolCallLogger();
|
|
192
210
|
logger.info('Tool call logger initialized');
|
|
193
211
|
|
|
194
212
|
// Create MCP server
|
|
195
|
-
const server = createMCPServer();
|
|
213
|
+
const server = createMCPServer(ensureTsdavInitialized);
|
|
196
214
|
logger.debug({ count: tools.length }, 'MCP server created with tools');
|
|
197
215
|
|
|
198
216
|
// Create STDIO transport
|
|
@@ -7,17 +7,17 @@ import { formatSuccess } from '../../formatters.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export const deleteEvent = {
|
|
9
9
|
name: 'delete_event',
|
|
10
|
-
description: '
|
|
10
|
+
description: 'Permanently delete a calendar event. WARNING: This action cannot be undone — the event is removed from the server immediately. Use only when the user explicitly requests deletion. Obtain the event URL and etag from list_events or calendar_query first. The etag ensures no conflicting changes occurred since the event was last retrieved.',
|
|
11
11
|
inputSchema: {
|
|
12
12
|
type: 'object',
|
|
13
13
|
properties: {
|
|
14
14
|
event_url: {
|
|
15
15
|
type: 'string',
|
|
16
|
-
description: '
|
|
16
|
+
description: 'Full URL of the event to delete. Obtain from list_events or calendar_query response.',
|
|
17
17
|
},
|
|
18
18
|
event_etag: {
|
|
19
19
|
type: 'string',
|
|
20
|
-
description: '
|
|
20
|
+
description: 'ETag of the event for conflict detection. Obtain from the same response as the event URL. Ensures no changes were made since retrieval.',
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
required: ['event_url', 'event_etag'],
|
|
@@ -7,17 +7,17 @@ import { formatSuccess } from '../../formatters.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export const deleteContact = {
|
|
9
9
|
name: 'delete_contact',
|
|
10
|
-
description: '
|
|
10
|
+
description: 'Permanently delete a contact (vCard) from the address book. WARNING: This action cannot be undone — the contact is removed from the server immediately. Use only when the user explicitly requests deletion. Obtain the vCard URL and etag from list_contacts or addressbook_query first. The etag ensures no conflicting changes occurred since the contact was last retrieved.',
|
|
11
11
|
inputSchema: {
|
|
12
12
|
type: 'object',
|
|
13
13
|
properties: {
|
|
14
14
|
vcard_url: {
|
|
15
15
|
type: 'string',
|
|
16
|
-
description: '
|
|
16
|
+
description: 'Full URL of the vCard to delete. Obtain from list_contacts or addressbook_query response.',
|
|
17
17
|
},
|
|
18
18
|
vcard_etag: {
|
|
19
19
|
type: 'string',
|
|
20
|
-
description: '
|
|
20
|
+
description: 'ETag of the vCard for conflict detection. Obtain from the same response as the vCard URL. Ensures no changes were made since retrieval.',
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
required: ['vcard_url', 'vcard_etag'],
|
|
@@ -7,17 +7,17 @@ import { formatSuccess } from '../../formatters.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export const deleteTodo = {
|
|
9
9
|
name: 'delete_todo',
|
|
10
|
-
description: '
|
|
10
|
+
description: 'Permanently delete a todo/task from the calendar. WARNING: This action cannot be undone — the todo is removed from the server immediately. Use only when the user explicitly requests deletion. Obtain the todo URL and etag from list_todos or todo_query first. The etag ensures no conflicting changes occurred since the todo was last retrieved.',
|
|
11
11
|
inputSchema: {
|
|
12
12
|
type: 'object',
|
|
13
13
|
properties: {
|
|
14
14
|
todo_url: {
|
|
15
15
|
type: 'string',
|
|
16
|
-
description: '
|
|
16
|
+
description: 'Full URL of the todo to delete. Obtain from list_todos or todo_query response.',
|
|
17
17
|
},
|
|
18
18
|
todo_etag: {
|
|
19
19
|
type: 'string',
|
|
20
|
-
description: '
|
|
20
|
+
description: 'ETag of the todo for conflict detection. Obtain from the same response as the todo URL. Ensures no changes were made since retrieval.',
|
|
21
21
|
},
|
|
22
22
|
},
|
|
23
23
|
required: ['todo_url', 'todo_etag'],
|