@mgcrea/mcp-apple-calendar 0.0.0-bootstrap
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/LICENSE +21 -0
- package/README.md +72 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +28 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +625 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/server-B2HtiXLF.js +2337 -0
- package/dist/server-B2HtiXLF.js.map +1 -0
- package/package.json +68 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Olivier Louvignes <olivier@mgcrea.io>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @mgcrea/mcp-apple-calendar
|
|
2
|
+
|
|
3
|
+
Model Context Protocol server for the macOS **Apple Calendar** app.
|
|
4
|
+
|
|
5
|
+
> **Unofficial.** Not affiliated with Apple. It reads the Calendar store already on your Mac.
|
|
6
|
+
|
|
7
|
+
## One lane for reads, one for writes
|
|
8
|
+
|
|
9
|
+
- **Index lane** — read-only SQLite over `Calendar.sqlitedb`. Every read goes through it.
|
|
10
|
+
- **Apple Events lane** — writes only. There is no `jxa/read.ts` in this package, and a test asserts
|
|
11
|
+
there never will be.
|
|
12
|
+
|
|
13
|
+
**This is the inverse of Notes.** Notes shipped on Apple Events because search took 97 ms. Calendar
|
|
14
|
+
cannot: a ±90-day range query over 1,349 events takes **3,355 ms** over Apple Events, `whose` is
|
|
15
|
+
worse and unstable, and every per-property bulk fetch costs ~1.8 s whichever property it is — so the
|
|
16
|
+
cost cannot be amortised the way Notes amortises a bulk fetch. The store opens read-only in **1 ms**.
|
|
17
|
+
Calendar needs the file lane for speed, not capability.
|
|
18
|
+
|
|
19
|
+
It does **not** need EventKit, which is why the companion app stays a pure broker rather than
|
|
20
|
+
linking a framework that would drag its own TCC prompt in.
|
|
21
|
+
|
|
22
|
+
| Permission | Needed for | Without it |
|
|
23
|
+
| ------------------------- | ----------- | ----------------------------------------- |
|
|
24
|
+
| **Full Disk Access** | all reads | nothing works — there is no read fallback |
|
|
25
|
+
| **Automation → Calendar** | writes only | reads are unaffected |
|
|
26
|
+
|
|
27
|
+
Neither is granted to Calendar.app — it is the _reader_ that needs permission. Grant Full Disk
|
|
28
|
+
Access to whatever launches the server (Terminal, iTerm, VS Code, Claude), then restart it.
|
|
29
|
+
|
|
30
|
+
With writes off — the default — **no Automation prompt appears at all**. A read-only Calendar server
|
|
31
|
+
needs exactly one permission.
|
|
32
|
+
|
|
33
|
+
## Tools
|
|
34
|
+
|
|
35
|
+
Read: `diagnostics`, `list_accounts`, `list_calendars`, `list_events`, `search_events`, `get_event`.
|
|
36
|
+
|
|
37
|
+
Write, registered **only** when `APPLE_CALENDAR_ALLOW_WRITES=1` — with the flag off they are
|
|
38
|
+
invisible to the model, not merely refused: `create_event`, `update_event`, `delete_events`.
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
| Variable | Default | |
|
|
43
|
+
| ----------------------------------------------- | ---------- | --------------------------------------------- |
|
|
44
|
+
| `APPLE_CALENDAR_ALLOW_WRITES` | off | Register the mutating tools. |
|
|
45
|
+
| `APPLE_CALENDAR_ACCOUNTS` | all | Read-side allowlist, comma-separated. |
|
|
46
|
+
| `APPLE_CALENDAR_CALENDARS` | all | Read-side allowlist, comma-separated. |
|
|
47
|
+
| `APPLE_CALENDAR_DEFAULT_CALENDAR` | Calendar's | Calendar a new event goes to when none named. |
|
|
48
|
+
| `APPLE_CALENDAR_DEFAULT_RANGE_DAYS` | `7` | An unbounded default would scan a decade. |
|
|
49
|
+
| `APPLE_CALENDAR_MAX_RANGE_DAYS` | `366` | Ceiling on a caller-supplied range. |
|
|
50
|
+
| `APPLE_CALENDAR_DEFAULT_EVENT_DURATION_MINUTES` | `60` | Used when a write names no end. |
|
|
51
|
+
| `APPLE_CALENDAR_INCLUDE_DECLINED` | off | Include declined events in reads. |
|
|
52
|
+
| `APPLE_CALENDAR_INCLUDE_CANCELLED` | off | Include cancelled events in reads. |
|
|
53
|
+
| `APPLE_CALENDAR_TIMEZONE` | system | Override the zone ranges are resolved in. |
|
|
54
|
+
| `APPLE_CALENDAR_INDEX_MODE` | `auto` | `auto` \| `ro` \| `immutable` \| `off`. |
|
|
55
|
+
| `APPLE_CALENDAR_STORE` | auto | Explicit `Calendar.sqlitedb` path. |
|
|
56
|
+
| `APPLE_CALENDAR_OSASCRIPT_TIMEOUT_MS` | `30000` | Sized for the first-run permission prompt. |
|
|
57
|
+
|
|
58
|
+
## Notes that will bite you
|
|
59
|
+
|
|
60
|
+
- **`~/Library/Calendars` does not exist.** The store is
|
|
61
|
+
`~/Library/Group Containers/group.com.apple.calendar/Calendar.sqlitedb`.
|
|
62
|
+
- **Recurrence lives in a cache table.** A naive `SELECT ... FROM CalendarItem` over a date range
|
|
63
|
+
misses expanded repeats; the range query unions items carrying no recurrence rule with everything
|
|
64
|
+
in the cache. 456 of 489 cached parents carry no rule of their own.
|
|
65
|
+
- **Dates are seconds since 2001**, not 1970 — `CalendarItem.last_modified` and `orig_date` both.
|
|
66
|
+
- **A floating time zone is not the system one.** Anything matching `GMT±HHMM` is a real zone;
|
|
67
|
+
treating the rest as floating is what stops a two-hour silent shift.
|
|
68
|
+
- **Writes always go through Apple Events**, never the store, which the app holds open and syncs.
|
|
69
|
+
|
|
70
|
+
## Licence
|
|
71
|
+
|
|
72
|
+
[MIT](LICENSE).
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { A as BUILD_INFO, C as CALENDAR_SURFACE, a as loadConfig, r as createServer } from "./server-B2HtiXLF.js";
|
|
3
|
+
import { runStdioServer } from "@mgcrea/mcp-apple-core";
|
|
4
|
+
//#region src/cli.ts
|
|
5
|
+
const LOG_PREFIX = "apple-calendar-mcp";
|
|
6
|
+
runStdioServer({
|
|
7
|
+
build: BUILD_INFO,
|
|
8
|
+
surface: CALENDAR_SURFACE,
|
|
9
|
+
logPrefix: LOG_PREFIX,
|
|
10
|
+
start: async (logger) => {
|
|
11
|
+
const config = loadConfig();
|
|
12
|
+
const { server } = createServer({
|
|
13
|
+
config,
|
|
14
|
+
logger
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
server,
|
|
18
|
+
banner: `writes=${config.allowWrites ? "ENABLED" : "disabled"}, calendars=${config.calendars.length ? config.calendars.join("/") : "all"}, range=${config.defaultRangeDays}d, index=${config.indexMode}`
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}).catch((err) => {
|
|
22
|
+
console.error(`[${LOG_PREFIX}] fatal:`, err);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export {};
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { runStdioServer } from \"@mgcrea/mcp-apple-core\";\n\nimport { BUILD_INFO } from \"./build-info.js\";\nimport { CALENDAR_SURFACE } from \"./client/errors.js\";\nimport { loadConfig } from \"./config.js\";\nimport { createServer } from \"./server.js\";\n\nconst LOG_PREFIX = \"apple-calendar-mcp\";\n\nrunStdioServer({\n build: BUILD_INFO,\n surface: CALENDAR_SURFACE,\n logPrefix: LOG_PREFIX,\n start: async (logger) => {\n const config = loadConfig();\n const { server } = createServer({ config, logger });\n return {\n server,\n banner:\n `writes=${config.allowWrites ? \"ENABLED\" : \"disabled\"}, ` +\n `calendars=${config.calendars.length ? config.calendars.join(\"/\") : \"all\"}, ` +\n `range=${config.defaultRangeDays}d, ` +\n `index=${config.indexMode}`,\n };\n },\n}).catch((err: unknown) => {\n console.error(`[${LOG_PREFIX}] fatal:`, err);\n process.exit(1);\n});\n"],"mappings":";;;;AAQA,MAAM,aAAa;AAEnB,eAAe;CACb,OAAO;CACP,SAAS;CACT,WAAW;CACX,OAAO,OAAO,WAAW;EACvB,MAAM,SAAS,WAAW;EAC1B,MAAM,EAAE,WAAW,aAAa;GAAE;GAAQ;EAAO,CAAC;EAClD,OAAO;GACL;GACA,QACE,UAAU,OAAO,cAAc,YAAY,WAAW,cACzC,OAAO,UAAU,SAAS,OAAO,UAAU,KAAK,GAAG,IAAI,MAAM,UACjE,OAAO,iBAAiB,WACxB,OAAO;EACpB;CACF;AACF,CAAC,CAAC,CAAC,OAAO,QAAiB;CACzB,QAAQ,MAAM,IAAI,WAAW,WAAW,GAAG;CAC3C,QAAQ,KAAK,CAAC;AAChB,CAAC"}
|