caldav-mcp 0.1.1 → 0.1.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/dist/index.js CHANGED
@@ -1,16 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- require("dotenv/config");
4
- const ts_caldav_1 = require("ts-caldav");
5
- const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
6
- const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
7
- const zod_1 = require("zod");
8
- const server = new mcp_js_1.McpServer({
1
+ import 'dotenv/config';
2
+ import { CalDAVClient } from "ts-caldav";
3
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { z } from "zod";
6
+ const server = new McpServer({
9
7
  name: "caldav-mcp",
10
8
  version: "0.1.0"
11
9
  });
12
10
  async function main() {
13
- const client = await ts_caldav_1.CalDAVClient.create({
11
+ const client = await CalDAVClient.create({
14
12
  baseUrl: process.env.CALDAV_BASE_URL || "",
15
13
  auth: {
16
14
  type: "basic",
@@ -20,7 +18,7 @@ async function main() {
20
18
  });
21
19
  const calendars = await client.getCalendars();
22
20
  const calendar = calendars[0];
23
- server.tool("create-event", { summary: zod_1.z.string(), start: zod_1.z.string().datetime(), end: zod_1.z.string().datetime() }, async ({ summary, start, end }) => {
21
+ server.tool("create-event", { summary: z.string(), start: z.string().datetime(), end: z.string().datetime() }, async ({ summary, start, end }) => {
24
22
  const event = await client.createEvent(calendar.url, {
25
23
  summary: summary,
26
24
  start: new Date(start),
@@ -30,7 +28,7 @@ async function main() {
30
28
  content: [{ type: "text", text: event.uid }]
31
29
  };
32
30
  });
33
- server.tool("list-events", { start: zod_1.z.string().datetime(), end: zod_1.z.string().datetime() }, async ({ start, end }) => {
31
+ server.tool("list-events", { start: z.string().datetime(), end: z.string().datetime() }, async ({ start, end }) => {
34
32
  const allEvents = await client.getEvents(calendar.url);
35
33
  // Filter events that fall within the specified time range
36
34
  const startDate = new Date(start);
@@ -46,7 +44,7 @@ async function main() {
46
44
  };
47
45
  });
48
46
  // Start receiving messages on stdin and sending messages on stdout
49
- const transport = new stdio_js_1.StdioServerTransport();
47
+ const transport = new StdioServerTransport();
50
48
  await server.connect(transport);
51
49
  }
52
50
  main();
package/package.json CHANGED
@@ -1,16 +1,22 @@
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.1.1",
4
+ "version": "0.1.2",
5
5
  "main": "dist/index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "caldav-mcp": "dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist"
12
+ ],
6
13
  "scripts": {
7
- "build": "tsc",
14
+ "build": "tsc && shx chmod +x dist/*.js",
8
15
  "prepare": "npm run build",
9
16
  "test": "echo \"Error: no test specified\" && exit 1",
10
- "lint": "eslint src/"
17
+ "lint": "eslint src/",
18
+ "watch": "tsc --watch"
11
19
  },
12
- "module": "esnext",
13
- "target": "esnext",
14
20
  "author": "Dominik Grusemann",
15
21
  "license": "MIT",
16
22
  "dependencies": {
@@ -22,6 +28,7 @@
22
28
  "@eslint/js": "^9.27.0",
23
29
  "@types/node": "^22.15.18",
24
30
  "eslint": "^9.27.0",
31
+ "shx": "^0.4.0",
25
32
  "typescript": "^5.8.3",
26
33
  "typescript-eslint": "^8.32.1"
27
34
  }
@@ -1,30 +0,0 @@
1
- name: Publish Package
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- publish:
9
- runs-on: ubuntu-latest
10
-
11
- steps:
12
- - name: Checkout repository
13
- uses: actions/checkout@v3
14
-
15
- - name: Set up Node.js
16
- uses: actions/setup-node@v3
17
- with:
18
- node-version: 16 # Specify your Node.js version
19
- registry-url: https://registry.npmjs.org/
20
-
21
- - name: Install dependencies
22
- run: npm install
23
-
24
- - name: Build package
25
- run: npm run build
26
-
27
- - name: Publish to npm
28
- env:
29
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30
- run: npm publish
package/CLAUDE.md DELETED
@@ -1,46 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Project Overview
6
-
7
- This project is a CalDAV client using the Model Context Protocol (MCP) server to expose calendar operations as tools. It uses:
8
-
9
- - ts-caldav: A TypeScript CalDAV client for interacting with calendar servers
10
- - MCP SDK: Model Context Protocol for creating tools that can be used by AI assistants
11
- - dotenv: For environment variable management
12
-
13
- ## Environment Setup
14
-
15
- The project requires the following environment variables to be set in a `.env` file:
16
-
17
- ```
18
- CALDAV_BASE_URL=<CalDAV server URL>
19
- CALDAV_USERNAME=<CalDAV username>
20
- CALDAV_PASSWORD=<CalDAV password>
21
- ```
22
-
23
- ## Common Commands
24
-
25
- ```bash
26
- # Install dependencies
27
- npm install
28
-
29
- # Compile TypeScript to JavaScript
30
- npx tsc
31
-
32
- # Run the MCP server
33
- node index.js
34
- ```
35
-
36
- ## Project Architecture
37
-
38
- The codebase is a simple MCP server implementation that:
39
-
40
- 1. Connects to a CalDAV server using credentials from environment variables
41
- 2. Retrieves the user's calendars and uses the first one for operations
42
- 3. Exposes two MCP tools:
43
- - `create-event`: Creates a calendar event with summary, start, and end time
44
- - `list-events`: Lists events between a start and end time
45
-
46
- The MCP server uses the StdioServerTransport to communicate through stdin/stdout, making it suitable for integration with Claude or other AI assistants that support the Model Context Protocol.
@@ -1,133 +0,0 @@
1
-
2
- # Contributor Covenant Code of Conduct
3
-
4
- ## Our Pledge
5
-
6
- We as members, contributors, and leaders pledge to make participation in our
7
- community a harassment-free experience for everyone, regardless of age, body
8
- size, visible or invisible disability, ethnicity, sex characteristics, gender
9
- identity and expression, level of experience, education, socio-economic status,
10
- nationality, personal appearance, race, religion, or sexual identity
11
- and orientation.
12
-
13
- We pledge to act and interact in ways that contribute to an open, welcoming,
14
- diverse, inclusive, and healthy community.
15
-
16
- ## Our Standards
17
-
18
- Examples of behavior that contributes to a positive environment for our
19
- community include:
20
-
21
- * Demonstrating empathy and kindness toward other people
22
- * Being respectful of differing opinions, viewpoints, and experiences
23
- * Giving and gracefully accepting constructive feedback
24
- * Accepting responsibility and apologizing to those affected by our mistakes,
25
- and learning from the experience
26
- * Focusing on what is best not just for us as individuals, but for the
27
- overall community
28
-
29
- Examples of unacceptable behavior include:
30
-
31
- * The use of sexualized language or imagery, and sexual attention or
32
- advances of any kind
33
- * Trolling, insulting or derogatory comments, and personal or political attacks
34
- * Public or private harassment
35
- * Publishing others' private information, such as a physical or email
36
- address, without their explicit permission
37
- * Other conduct which could reasonably be considered inappropriate in a
38
- professional setting
39
-
40
- ## Enforcement Responsibilities
41
-
42
- Community leaders are responsible for clarifying and enforcing our standards of
43
- acceptable behavior and will take appropriate and fair corrective action in
44
- response to any behavior that they deem inappropriate, threatening, offensive,
45
- or harmful.
46
-
47
- Community leaders have the right and responsibility to remove, edit, or reject
48
- comments, commits, code, wiki edits, issues, and other contributions that are
49
- not aligned to this Code of Conduct, and will communicate reasons for moderation
50
- decisions when appropriate.
51
-
52
- ## Scope
53
-
54
- This Code of Conduct applies within all community spaces, and also applies when
55
- an individual is officially representing the community in public spaces.
56
- Examples of representing our community include using an official email address,
57
- posting via an official social media account, or acting as an appointed
58
- representative at an online or offline event.
59
-
60
- ## Enforcement
61
-
62
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
- reported to the community leaders responsible for enforcement at
64
- [INSERT CONTACT METHOD].
65
- All complaints will be reviewed and investigated promptly and fairly.
66
-
67
- All community leaders are obligated to respect the privacy and security of the
68
- reporter of any incident.
69
-
70
- ## Enforcement Guidelines
71
-
72
- Community leaders will follow these Community Impact Guidelines in determining
73
- the consequences for any action they deem in violation of this Code of Conduct:
74
-
75
- ### 1. Correction
76
-
77
- **Community Impact**: Use of inappropriate language or other behavior deemed
78
- unprofessional or unwelcome in the community.
79
-
80
- **Consequence**: A private, written warning from community leaders, providing
81
- clarity around the nature of the violation and an explanation of why the
82
- behavior was inappropriate. A public apology may be requested.
83
-
84
- ### 2. Warning
85
-
86
- **Community Impact**: A violation through a single incident or series
87
- of actions.
88
-
89
- **Consequence**: A warning with consequences for continued behavior. No
90
- interaction with the people involved, including unsolicited interaction with
91
- those enforcing the Code of Conduct, for a specified period of time. This
92
- includes avoiding interactions in community spaces as well as external channels
93
- like social media. Violating these terms may lead to a temporary or
94
- permanent ban.
95
-
96
- ### 3. Temporary Ban
97
-
98
- **Community Impact**: A serious violation of community standards, including
99
- sustained inappropriate behavior.
100
-
101
- **Consequence**: A temporary ban from any sort of interaction or public
102
- communication with the community for a specified period of time. No public or
103
- private interaction with the people involved, including unsolicited interaction
104
- with those enforcing the Code of Conduct, is allowed during this period.
105
- Violating these terms may lead to a permanent ban.
106
-
107
- ### 4. Permanent Ban
108
-
109
- **Community Impact**: Demonstrating a pattern of violation of community
110
- standards, including sustained inappropriate behavior, harassment of an
111
- individual, or aggression toward or disparagement of classes of individuals.
112
-
113
- **Consequence**: A permanent ban from any sort of public interaction within
114
- the community.
115
-
116
- ## Attribution
117
-
118
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
- version 2.0, available at
120
- [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
121
-
122
- Community Impact Guidelines were inspired by
123
- [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
-
125
- For answers to common questions about this code of conduct, see the FAQ at
126
- [https://www.contributor-covenant.org/faq][FAQ]. Translations are available
127
- at [https://www.contributor-covenant.org/translations][translations].
128
-
129
- [homepage]: https://www.contributor-covenant.org
130
- [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
131
- [Mozilla CoC]: https://github.com/mozilla/diversity
132
- [FAQ]: https://www.contributor-covenant.org/faq
133
- [translations]: https://www.contributor-covenant.org/translations
package/eslint.config.mjs DELETED
@@ -1,9 +0,0 @@
1
- // @ts-check
2
-
3
- import eslint from '@eslint/js';
4
- import tseslint from 'typescript-eslint';
5
-
6
- export default tseslint.config(
7
- eslint.configs.recommended,
8
- ...tseslint.configs.recommended
9
- );
package/src/index.ts DELETED
@@ -1,69 +0,0 @@
1
- import 'dotenv/config'
2
- import { CalDAVClient } from "ts-caldav";
3
- import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
- import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
- import { z } from "zod";
6
-
7
- const server = new McpServer({
8
- name: "caldav-mcp",
9
- version: "0.1.0"
10
- });
11
-
12
- async function main() {
13
- const client = await CalDAVClient.create({
14
- baseUrl: process.env.CALDAV_BASE_URL || "",
15
- auth: {
16
- type: "basic",
17
- username: process.env.CALDAV_USERNAME || "",
18
- password: process.env.CALDAV_PASSWORD || ""
19
- }
20
- });
21
-
22
- const calendars = await client.getCalendars();
23
- const calendar = calendars[0];
24
-
25
- server.tool(
26
- "create-event",
27
- {summary: z.string(), start: z.string().datetime(), end: z.string().datetime()},
28
- async ({summary, start, end}) => {
29
- const event = await client.createEvent(calendar.url, {
30
- summary: summary,
31
- start: new Date(start),
32
- end: new Date(end),
33
- });
34
- return {
35
- content: [{type: "text", text: event.uid}]
36
- };
37
- }
38
- );
39
-
40
- server.tool(
41
- "list-events",
42
- {start: z.string().datetime(), end: z.string().datetime()},
43
- async ({start, end}) => {
44
- const allEvents = await client.getEvents(calendar.url);
45
-
46
- // Filter events that fall within the specified time range
47
- const startDate = new Date(start);
48
- const endDate = new Date(end);
49
-
50
- const filteredEvents = allEvents.filter(event => {
51
- const eventStart = new Date(event.start);
52
- const eventEnd = new Date(event.end);
53
-
54
- // Event starts before the end time and ends after the start time
55
- return eventStart <= endDate && eventEnd >= startDate;
56
- });
57
-
58
- return {
59
- content: [{type: "text", text: filteredEvents.map(e => `${e.summary}\nStart: ${e.start}\nEnd: ${e.end}`).join("\n")}]
60
- };
61
- }
62
- );
63
-
64
- // Start receiving messages on stdin and sending messages on stdout
65
- const transport = new StdioServerTransport();
66
- await server.connect(transport);
67
- }
68
-
69
- main()
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2019",
4
- "module": "commonjs",
5
- "esModuleInterop": true,
6
- "forceConsistentCasingInFileNames": true,
7
- "strict": true,
8
- "skipLibCheck": true,
9
- "outDir": "./dist",
10
- "rootDir": "./src"
11
- },
12
- "include": [
13
- "src/**/*"
14
- ],
15
- "exclude": [
16
- "node_modules",
17
- "dist"
18
- ]
19
- }