implement CalDAV MCP server v1 with streamable HTTP tools

This commit is contained in:
2026-03-20 15:47:06 +01:00
parent c92bf5c912
commit 4735b9ccf2
20 changed files with 4505 additions and 2 deletions

25
src/config.ts Normal file
View File

@@ -0,0 +1,25 @@
import { z } from "zod";
const configSchema = z.object({
CALDAV_BASE_URL: z.string().url(),
MCP_HTTP_PORT: z.coerce.number().int().positive().default(3000),
LOG_LEVEL: z.enum(["debug", "info", "warn", "error"]).default("info"),
ALLOW_COOKIE_PASSTHROUGH: z.preprocess((value) => {
if (typeof value === "boolean") {
return value;
}
if (typeof value === "string") {
return value === "true";
}
return false;
}, z.boolean().default(false)),
CALDAV_TIMEOUT_MS: z.coerce.number().int().positive().default(15000),
CALDAV_RETRY_COUNT: z.coerce.number().int().min(0).max(5).default(1),
EVENT_HREF_STRATEGY: z.enum(["uid"]).default("uid"),
});
export type Config = z.infer<typeof configSchema>;
export function loadConfig(env: NodeJS.ProcessEnv = process.env): Config {
return configSchema.parse(env);
}