applecal-mcp 0.5.0__tar.gz
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.
- applecal_mcp-0.5.0/.claude-plugin/icon.png +0 -0
- applecal_mcp-0.5.0/.claude-plugin/marketplace.json +15 -0
- applecal_mcp-0.5.0/.claude-plugin/plugin.json +32 -0
- applecal_mcp-0.5.0/.dockerignore +13 -0
- applecal_mcp-0.5.0/.env.example +40 -0
- applecal_mcp-0.5.0/.github/workflows/ci.yml +104 -0
- applecal_mcp-0.5.0/.github/workflows/release.yml +162 -0
- applecal_mcp-0.5.0/.gitignore +43 -0
- applecal_mcp-0.5.0/Dockerfile +30 -0
- applecal_mcp-0.5.0/LICENSE +21 -0
- applecal_mcp-0.5.0/PKG-INFO +468 -0
- applecal_mcp-0.5.0/README.md +445 -0
- applecal_mcp-0.5.0/deploy/Caddyfile +6 -0
- applecal_mcp-0.5.0/deploy/gcp/setup-vm.sh +49 -0
- applecal_mcp-0.5.0/docker-compose.https.yml +22 -0
- applecal_mcp-0.5.0/docker-compose.yml +21 -0
- applecal_mcp-0.5.0/examples/claude_desktop_config.json +13 -0
- applecal_mcp-0.5.0/legacy/apple-calendar-eventkit-mcp/README.md +13 -0
- applecal_mcp-0.5.0/legacy/apple-calendar-eventkit-mcp/pyproject.toml +29 -0
- applecal_mcp-0.5.0/mcpb/.mcpbignore +4 -0
- applecal_mcp-0.5.0/mcpb/manifest.json +196 -0
- applecal_mcp-0.5.0/mcpb/pyproject.toml +10 -0
- applecal_mcp-0.5.0/mcpb/server.py +5 -0
- applecal_mcp-0.5.0/pyproject.toml +78 -0
- applecal_mcp-0.5.0/scripts/build-helper.sh +12 -0
- applecal_mcp-0.5.0/scripts/build-mcpb.sh +20 -0
- applecal_mcp-0.5.0/server.json +23 -0
- applecal_mcp-0.5.0/skills/apple-calendar/SKILL.md +42 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/__init__.py +3 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/__main__.py +3 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/access.py +174 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/caldav_store.py +771 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/changes.py +215 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/cli.py +327 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/eventkit_store.py +764 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/ics.py +498 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/macos_app.py +244 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/macos_helper/launcher.c +70 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/memory_store.py +425 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/models.py +481 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/recurrence.py +85 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/reminders.py +229 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/remote.py +632 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/scheduling.py +204 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/server.py +533 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/service.py +1156 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/store.py +90 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/timeutil.py +106 -0
- applecal_mcp-0.5.0/src/apple_calendar_mcp/windows_zones.json +143 -0
- applecal_mcp-0.5.0/tests/__init__.py +0 -0
- applecal_mcp-0.5.0/tests/conftest.py +31 -0
- applecal_mcp-0.5.0/tests/fake_eventkit.py +545 -0
- applecal_mcp-0.5.0/tests/test_access.py +147 -0
- applecal_mcp-0.5.0/tests/test_caldav_store.py +345 -0
- applecal_mcp-0.5.0/tests/test_changes.py +309 -0
- applecal_mcp-0.5.0/tests/test_cli.py +406 -0
- applecal_mcp-0.5.0/tests/test_eventkit_mapping.py +244 -0
- applecal_mcp-0.5.0/tests/test_ics.py +421 -0
- applecal_mcp-0.5.0/tests/test_invitations.py +116 -0
- applecal_mcp-0.5.0/tests/test_macos_app.py +255 -0
- applecal_mcp-0.5.0/tests/test_mcpb.py +66 -0
- applecal_mcp-0.5.0/tests/test_reminders.py +167 -0
- applecal_mcp-0.5.0/tests/test_remote_auth.py +467 -0
- applecal_mcp-0.5.0/tests/test_scheduling.py +201 -0
- applecal_mcp-0.5.0/tests/test_server.py +201 -0
- applecal_mcp-0.5.0/tests/test_service.py +396 -0
- applecal_mcp-0.5.0/tests/test_timeutil_recurrence.py +114 -0
- applecal_mcp-0.5.0/uv.lock +2123 -0
- applecal_mcp-0.5.0/worker/README.md +32 -0
- applecal_mcp-0.5.0/worker/eslint.config.js +13 -0
- applecal_mcp-0.5.0/worker/package-lock.json +5115 -0
- applecal_mcp-0.5.0/worker/package.json +41 -0
- applecal_mcp-0.5.0/worker/src/access.ts +143 -0
- applecal_mcp-0.5.0/worker/src/auth.ts +236 -0
- applecal_mcp-0.5.0/worker/src/caldav/client.ts +292 -0
- applecal_mcp-0.5.0/worker/src/caldav/ical.ts +542 -0
- applecal_mcp-0.5.0/worker/src/caldav/store.ts +629 -0
- applecal_mcp-0.5.0/worker/src/changes.ts +268 -0
- applecal_mcp-0.5.0/worker/src/env.ts +29 -0
- applecal_mcp-0.5.0/worker/src/ics.ts +430 -0
- applecal_mcp-0.5.0/worker/src/index.ts +176 -0
- applecal_mcp-0.5.0/worker/src/memory-store.ts +120 -0
- applecal_mcp-0.5.0/worker/src/models.ts +318 -0
- applecal_mcp-0.5.0/worker/src/scheduling.ts +195 -0
- applecal_mcp-0.5.0/worker/src/service.ts +1020 -0
- applecal_mcp-0.5.0/worker/src/store.ts +53 -0
- applecal_mcp-0.5.0/worker/src/time.ts +266 -0
- applecal_mcp-0.5.0/worker/src/tools.ts +611 -0
- applecal_mcp-0.5.0/worker/src/windows-zones.json +143 -0
- applecal_mcp-0.5.0/worker/test/node/access.test.ts +103 -0
- applecal_mcp-0.5.0/worker/test/node/agenda.test.ts +158 -0
- applecal_mcp-0.5.0/worker/test/node/caldav.test.ts +205 -0
- applecal_mcp-0.5.0/worker/test/node/changes.test.ts +249 -0
- applecal_mcp-0.5.0/worker/test/node/cpu.test.ts +62 -0
- applecal_mcp-0.5.0/worker/test/node/duplicates.test.ts +78 -0
- applecal_mcp-0.5.0/worker/test/node/helpers.ts +38 -0
- applecal_mcp-0.5.0/worker/test/node/ics.test.ts +323 -0
- applecal_mcp-0.5.0/worker/test/node/invitations.test.ts +120 -0
- applecal_mcp-0.5.0/worker/test/node/radicale.ts +62 -0
- applecal_mcp-0.5.0/worker/test/node/scheduling.test.ts +63 -0
- applecal_mcp-0.5.0/worker/test/node/service.test.ts +239 -0
- applecal_mcp-0.5.0/worker/test/node/stats.test.ts +69 -0
- applecal_mcp-0.5.0/worker/test/node/time.test.ts +47 -0
- applecal_mcp-0.5.0/worker/test/node/tsconfig.json +10 -0
- applecal_mcp-0.5.0/worker/test/worker/helpers.ts +194 -0
- applecal_mcp-0.5.0/worker/test/worker/remote.test.ts +350 -0
- applecal_mcp-0.5.0/worker/tsconfig.json +27 -0
- applecal_mcp-0.5.0/worker/vitest.config.ts +36 -0
- applecal_mcp-0.5.0/worker/wrangler.jsonc +35 -0
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "applecal-mcp",
|
|
3
|
+
"description": "The applecal-mcp plugin: your Mac's calendars in Claude, through EventKit.",
|
|
4
|
+
"owner": {
|
|
5
|
+
"name": "Oğuz Kağan Göçmez",
|
|
6
|
+
"url": "https://github.com/oguz-kagan-gocmez-edu"
|
|
7
|
+
},
|
|
8
|
+
"plugins": [
|
|
9
|
+
{
|
|
10
|
+
"name": "applecal-mcp",
|
|
11
|
+
"source": "./",
|
|
12
|
+
"description": "Read and manage the calendars and reminders on your Mac through EventKit. Runs locally."
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "applecal-mcp",
|
|
3
|
+
"displayName": "Apple Calendar for Mac",
|
|
4
|
+
"version": "0.5.0",
|
|
5
|
+
"description": "Read and manage the calendars and reminders on your Mac (iCloud, Google, Exchange) through EventKit: agenda, free time, conflicts, create and move events, preview and undo changes. Runs locally; unofficial, not affiliated with Apple.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Oğuz Kağan Göçmez",
|
|
8
|
+
"url": "https://github.com/oguz-kagan-gocmez-edu"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/oguz-kagan-gocmez-edu/applecal-mcp#readme",
|
|
11
|
+
"repository": "https://github.com/oguz-kagan-gocmez-edu/applecal-mcp",
|
|
12
|
+
"documentationUrl": "https://github.com/oguz-kagan-gocmez-edu/applecal-mcp#claude-plugin",
|
|
13
|
+
"supportUrl": "https://github.com/oguz-kagan-gocmez-edu/applecal-mcp/issues",
|
|
14
|
+
"privacyPolicyUrl": "https://github.com/oguz-kagan-gocmez-edu/applecal-mcp#what-the-plugin-runs-and-sends",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"icon": "./.claude-plugin/icon.png",
|
|
17
|
+
"keywords": ["calendar", "macos", "eventkit", "icloud", "scheduling", "mcp"],
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"apple-calendar": {
|
|
20
|
+
"command": "uv",
|
|
21
|
+
"args": [
|
|
22
|
+
"run",
|
|
23
|
+
"--locked",
|
|
24
|
+
"--no-dev",
|
|
25
|
+
"--quiet",
|
|
26
|
+
"--project",
|
|
27
|
+
"${CLAUDE_PLUGIN_ROOT}",
|
|
28
|
+
"applecal-mcp"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Copy to .env and fill in. Never commit .env (it's in .gitignore).
|
|
2
|
+
|
|
3
|
+
# --- iCloud (or any CalDAV server) -----------------------------------------
|
|
4
|
+
# Your Apple ID email.
|
|
5
|
+
CALDAV_USERNAME=you@icloud.com
|
|
6
|
+
# An app-specific password, NOT your Apple ID password:
|
|
7
|
+
# appleid.apple.com > Sign-In and Security > App-Specific Passwords.
|
|
8
|
+
CALDAV_PASSWORD=xxxx-xxxx-xxxx-xxxx
|
|
9
|
+
# Optional: other CalDAV servers (Fastmail, Nextcloud...). Default: https://caldav.icloud.com
|
|
10
|
+
# CALDAV_URL=https://caldav.icloud.com
|
|
11
|
+
# Optional: calendar id for new events (see `doctor` output). Default: the first calendar.
|
|
12
|
+
# CALDAV_DEFAULT_CALENDAR=
|
|
13
|
+
|
|
14
|
+
# --- Connector ---------------------------------------------------------------
|
|
15
|
+
# The public https address Claude will use (no trailing /mcp).
|
|
16
|
+
PUBLIC_URL=https://calendar.example.com
|
|
17
|
+
# You type this once in the browser when connecting from claude.ai. 12+ characters.
|
|
18
|
+
# Generate one: python3 -c "import secrets; print(secrets.token_urlsafe(24))"
|
|
19
|
+
CONNECTOR_PASSWORD=change-me-to-a-long-random-string
|
|
20
|
+
# Your time zone, for times without an offset ("tomorrow at 3pm").
|
|
21
|
+
TZ=Europe/Istanbul
|
|
22
|
+
|
|
23
|
+
# Only with docker-compose.https.yml (Caddy): the host name in PUBLIC_URL, without https://
|
|
24
|
+
# DOMAIN=calendar.example.com
|
|
25
|
+
|
|
26
|
+
# --- Optional ----------------------------------------------------------------
|
|
27
|
+
# Where OAuth data (hashed tokens) is kept. Docker uses /data.
|
|
28
|
+
# DATA_DIR=./data
|
|
29
|
+
# Extra OAuth redirect URIs to allow, comma-separated (Claude's are built in).
|
|
30
|
+
# OAUTH_ALLOWED_REDIRECTS=
|
|
31
|
+
# Per-calendar access: comma-separated calendar ids or titles (see `doctor`).
|
|
32
|
+
# APPLE_CALENDAR_READ_ONLY_CALENDARS=Work
|
|
33
|
+
# APPLE_CALENDAR_HIDDEN_CALENDARS=Family
|
|
34
|
+
# APPLE_CALENDAR_ONLY_CALENDARS=
|
|
35
|
+
# Allow http://localhost redirects (the MCP Inspector). Default: on only when
|
|
36
|
+
# PUBLIC_URL is itself localhost; keep it off on a public server.
|
|
37
|
+
# OAUTH_ALLOW_LOCALHOST=0
|
|
38
|
+
# Which proxies may set X-Forwarded-For (the login rate limit uses it). The Docker
|
|
39
|
+
# image trusts any, because only your proxy can reach the 127.0.0.1-bound port.
|
|
40
|
+
# FORWARDED_ALLOW_IPS=127.0.0.1
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
# CI only reads the repo; keep the workflow token read-only.
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
name: Lint + test (Python ${{ matrix.python }}, ${{ matrix.os }})
|
|
15
|
+
runs-on: ${{ matrix.os }}
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
os: [ubuntu-latest]
|
|
20
|
+
python: ["3.11", "3.12", "3.13"]
|
|
21
|
+
include:
|
|
22
|
+
- os: macos-latest
|
|
23
|
+
python: "3.13"
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- uses: astral-sh/setup-uv@v6
|
|
27
|
+
with:
|
|
28
|
+
python-version: ${{ matrix.python }}
|
|
29
|
+
- run: uv sync --locked --group dev --extra remote
|
|
30
|
+
- run: uv run ruff check .
|
|
31
|
+
- run: uv run ruff format --check .
|
|
32
|
+
- run: uv run mypy src
|
|
33
|
+
- run: uv run pytest --cov=apple_calendar_mcp --cov-report=term-missing
|
|
34
|
+
# On macOS, import the real PyObjC bindings: catches renamed EventKit
|
|
35
|
+
# symbols. We never call EventKit here; CI runners have no GUI session
|
|
36
|
+
# to show the permission prompt.
|
|
37
|
+
- if: runner.os == 'macOS'
|
|
38
|
+
run: uv run python -c "import apple_calendar_mcp.eventkit_store as m; print(m.EventKitStore.authorization_status())"
|
|
39
|
+
# Build the helper app bundle for real, from source (as a git checkout
|
|
40
|
+
# does), and check its signature and launcher.
|
|
41
|
+
- if: runner.os == 'macOS'
|
|
42
|
+
run: |
|
|
43
|
+
set -euo pipefail
|
|
44
|
+
out="$(uv run applecal-mcp install-app --dest "$RUNNER_TEMP/Apple Calendar MCP.app")"
|
|
45
|
+
echo "$out"; grep -q "compiled from source" <<<"$out"
|
|
46
|
+
codesign --verify --verbose "$RUNNER_TEMP/Apple Calendar MCP.app"
|
|
47
|
+
"$RUNNER_TEMP/Apple Calendar MCP.app/Contents/MacOS/apple-calendar-mcp-launcher" /bin/echo launcher-ok
|
|
48
|
+
# Same as a release: build the universal launcher into the wheel, install
|
|
49
|
+
# that wheel on its own and set up the helper from it, without a compiler.
|
|
50
|
+
- if: runner.os == 'macOS'
|
|
51
|
+
name: Prebuilt helper from the wheel
|
|
52
|
+
run: |
|
|
53
|
+
set -euo pipefail
|
|
54
|
+
scripts/build-helper.sh
|
|
55
|
+
uv build --wheel -o "$RUNNER_TEMP/dist"
|
|
56
|
+
uv venv "$RUNNER_TEMP/venv"
|
|
57
|
+
uv pip install --python "$RUNNER_TEMP/venv/bin/python" "$RUNNER_TEMP"/dist/*.whl
|
|
58
|
+
out="$(PATH=/usr/bin:/bin "$RUNNER_TEMP/venv/bin/applecal-mcp" install-app --dest "$RUNNER_TEMP/Prebuilt.app")"
|
|
59
|
+
echo "$out"; grep -q "(prebuilt launcher)" <<<"$out"
|
|
60
|
+
codesign --verify --verbose "$RUNNER_TEMP/Prebuilt.app"
|
|
61
|
+
"$RUNNER_TEMP/Prebuilt.app/Contents/MacOS/apple-calendar-mcp-launcher" /bin/echo launcher-ok
|
|
62
|
+
|
|
63
|
+
docker:
|
|
64
|
+
name: Docker image (remote connector)
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v4
|
|
68
|
+
- run: docker build -t applecal-mcp .
|
|
69
|
+
# Start with demo data (no iCloud account in CI) and check it serves and requires a token.
|
|
70
|
+
- run: |
|
|
71
|
+
docker run -d --name cal -p 8000:8000 \
|
|
72
|
+
--read-only --tmpfs /tmp --cap-drop ALL --security-opt no-new-privileges \
|
|
73
|
+
-e PUBLIC_URL=http://localhost:8000 -e CONNECTOR_PASSWORD=ci-only-password-123 \
|
|
74
|
+
applecal-mcp applecal-mcp --backend memory --demo serve-http
|
|
75
|
+
for i in $(seq 1 30); do curl -fs http://localhost:8000/healthz && break; sleep 1; done
|
|
76
|
+
test "$(curl -s -o /dev/null -w '%{http_code}' -X POST http://localhost:8000/mcp)" = "401"
|
|
77
|
+
docker logs cal
|
|
78
|
+
|
|
79
|
+
worker:
|
|
80
|
+
name: Cloudflare Worker (remote connector)
|
|
81
|
+
runs-on: ubuntu-latest
|
|
82
|
+
defaults:
|
|
83
|
+
run:
|
|
84
|
+
working-directory: worker
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/checkout@v4
|
|
87
|
+
# Radicale (a Python dev dependency) is the CalDAV server the worker's tests talk to.
|
|
88
|
+
- uses: astral-sh/setup-uv@v6
|
|
89
|
+
with:
|
|
90
|
+
python-version: "3.13"
|
|
91
|
+
- run: uv sync --locked --group dev
|
|
92
|
+
working-directory: .
|
|
93
|
+
- uses: actions/setup-node@v4
|
|
94
|
+
with:
|
|
95
|
+
node-version: 26
|
|
96
|
+
cache: npm
|
|
97
|
+
cache-dependency-path: worker/package-lock.json
|
|
98
|
+
- run: npm ci
|
|
99
|
+
- run: npm run typecheck
|
|
100
|
+
- run: npm run lint
|
|
101
|
+
- run: npm test
|
|
102
|
+
# The bundle must build and stay under the free plan's 3 MB limit.
|
|
103
|
+
- run: npx wrangler deploy --dry-run --outdir dist
|
|
104
|
+
- run: test "$(gzip -c dist/index.js | wc -c)" -lt 3000000
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
# Push a tag like v0.2.0 to publish that version to PyPI and then to the
|
|
4
|
+
# MCP Registry, and to attach the Claude Desktop extension (.mcpb) to a GitHub
|
|
5
|
+
# release. PyPI and the registry use GitHub's OIDC identity, so there are no secrets:
|
|
6
|
+
# PyPI trusts this workflow through a "trusted publisher" entry, and the
|
|
7
|
+
# registry trusts it for the io.github.oguz-kagan-gocmez-edu/* namespace.
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
tags: ["v*"]
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
helper:
|
|
18
|
+
name: Build the helper app launcher
|
|
19
|
+
runs-on: macos-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
# A universal binary (Apple silicon + Intel) from launcher.c in this
|
|
23
|
+
# very commit, shipped in the wheel so `install-app` needs no compiler.
|
|
24
|
+
- run: scripts/build-helper.sh
|
|
25
|
+
- uses: actions/upload-artifact@v4
|
|
26
|
+
with:
|
|
27
|
+
name: launcher
|
|
28
|
+
path: src/apple_calendar_mcp/macos_helper/apple-calendar-mcp-launcher
|
|
29
|
+
if-no-files-found: error
|
|
30
|
+
|
|
31
|
+
pypi:
|
|
32
|
+
name: Publish to PyPI
|
|
33
|
+
needs: helper
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
environment: pypi
|
|
36
|
+
permissions:
|
|
37
|
+
contents: read
|
|
38
|
+
id-token: write # PyPI trusted publishing
|
|
39
|
+
steps:
|
|
40
|
+
- uses: actions/checkout@v4
|
|
41
|
+
- uses: astral-sh/setup-uv@v6
|
|
42
|
+
|
|
43
|
+
- name: Check that every version matches the tag
|
|
44
|
+
run: |
|
|
45
|
+
set -euo pipefail
|
|
46
|
+
tag="${GITHUB_REF_NAME#v}"
|
|
47
|
+
project="$(uv version --short)"
|
|
48
|
+
package="$(sed -nE 's/^__version__ = "(.*)"$/\1/p' src/apple_calendar_mcp/__init__.py)"
|
|
49
|
+
server="$(jq -r .version server.json)"
|
|
50
|
+
server_pkg="$(jq -r '.packages[0].version' server.json)"
|
|
51
|
+
bundle="$(jq -r .version mcpb/manifest.json)"
|
|
52
|
+
bundle_pin="$(sed -nE 's/.*"applecal-mcp==([^"]+)".*/\1/p' mcpb/pyproject.toml)"
|
|
53
|
+
old="$(uv version --short --directory legacy/apple-calendar-eventkit-mcp)"
|
|
54
|
+
old_pin="$(sed -nE 's/^dependencies = \["applecal-mcp==([^"]+)"\]$/\1/p' legacy/apple-calendar-eventkit-mcp/pyproject.toml)"
|
|
55
|
+
echo "tag=$tag pyproject=$project __init__=$package server.json=$server/$server_pkg mcpb=$bundle/$bundle_pin old-name=$old/$old_pin"
|
|
56
|
+
for v in "$project" "$package" "$server" "$server_pkg" "$bundle" "$bundle_pin" "$old" "$old_pin"; do
|
|
57
|
+
[ "$v" = "$tag" ] || { echo "::error::version $v doesn't match tag v$tag"; exit 1; }
|
|
58
|
+
done
|
|
59
|
+
|
|
60
|
+
- uses: actions/download-artifact@v4
|
|
61
|
+
with:
|
|
62
|
+
name: launcher
|
|
63
|
+
path: src/apple_calendar_mcp/macos_helper
|
|
64
|
+
|
|
65
|
+
# The wheel is built from the source tree, not from the sdist, because
|
|
66
|
+
# the sdist (rightly) leaves out the git-ignored binary.
|
|
67
|
+
- run: |
|
|
68
|
+
uv build --sdist
|
|
69
|
+
uv build --wheel
|
|
70
|
+
|
|
71
|
+
- name: Check the wheel carries the universal launcher
|
|
72
|
+
run: |
|
|
73
|
+
set -euo pipefail
|
|
74
|
+
unzip -o -q dist/*.whl 'apple_calendar_mcp/macos_helper/apple-calendar-mcp-launcher' -d "$RUNNER_TEMP/whl"
|
|
75
|
+
file "$RUNNER_TEMP/whl/apple_calendar_mcp/macos_helper/apple-calendar-mcp-launcher" | tee /dev/stderr \
|
|
76
|
+
| grep -q "Mach-O universal binary with 2 architectures" \
|
|
77
|
+
|| { echo "::error::the wheel has no universal launcher"; exit 1; }
|
|
78
|
+
if tar -tzf dist/*.tar.gz | grep -q 'apple-calendar-mcp-launcher$'; then
|
|
79
|
+
echo "::error::the sdist must not contain the binary"; exit 1
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
- name: Check the registry ownership line is in the package description
|
|
83
|
+
run: |
|
|
84
|
+
set -euo pipefail
|
|
85
|
+
name="$(jq -r .name server.json)"
|
|
86
|
+
unzip -p dist/*.whl '*.dist-info/METADATA' | grep -q "mcp-name: $name" \
|
|
87
|
+
|| { echo "::error::README is missing 'mcp-name: $name'"; exit 1; }
|
|
88
|
+
|
|
89
|
+
# The old name, apple-calendar-eventkit-mcp: an empty package that
|
|
90
|
+
# installs this version of applecal-mcp. Built after the checks above,
|
|
91
|
+
# which look at the one applecal-mcp wheel in dist/.
|
|
92
|
+
- run: uv build legacy/apple-calendar-eventkit-mcp --out-dir dist
|
|
93
|
+
|
|
94
|
+
# applecal-mcp goes first, so the old name never points at a version
|
|
95
|
+
# PyPI doesn't have yet.
|
|
96
|
+
- run: uv publish --trusted-publishing always dist/applecal_mcp-*
|
|
97
|
+
- run: uv publish --trusted-publishing always dist/apple_calendar_eventkit_mcp-*
|
|
98
|
+
|
|
99
|
+
registry:
|
|
100
|
+
name: Publish to the MCP Registry
|
|
101
|
+
needs: pypi
|
|
102
|
+
runs-on: ubuntu-latest
|
|
103
|
+
permissions:
|
|
104
|
+
contents: read
|
|
105
|
+
id-token: write # MCP Registry OIDC login
|
|
106
|
+
env:
|
|
107
|
+
MCP_PUBLISHER_VERSION: v1.8.1
|
|
108
|
+
steps:
|
|
109
|
+
- uses: actions/checkout@v4
|
|
110
|
+
|
|
111
|
+
- name: Wait until PyPI serves the new version
|
|
112
|
+
run: |
|
|
113
|
+
set -euo pipefail
|
|
114
|
+
url="https://pypi.org/pypi/applecal-mcp/${GITHUB_REF_NAME#v}/json"
|
|
115
|
+
for _ in $(seq 30); do
|
|
116
|
+
curl --fail --silent --output /dev/null "$url" && exit 0
|
|
117
|
+
sleep 10
|
|
118
|
+
done
|
|
119
|
+
echo "::error::PyPI never served $url"; exit 1
|
|
120
|
+
|
|
121
|
+
- name: Install cosign
|
|
122
|
+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
|
|
123
|
+
|
|
124
|
+
- name: Download and verify mcp-publisher
|
|
125
|
+
run: |
|
|
126
|
+
set -euo pipefail
|
|
127
|
+
archive="mcp-publisher_linux_amd64.tar.gz"
|
|
128
|
+
base_url="https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}"
|
|
129
|
+
curl --fail --location --silent --show-error --output "$archive" "$base_url/$archive"
|
|
130
|
+
curl --fail --location --silent --show-error --output "$archive.sigstore.json" "$base_url/$archive.sigstore.json"
|
|
131
|
+
cosign verify-blob \
|
|
132
|
+
--bundle "$archive.sigstore.json" \
|
|
133
|
+
--certificate-identity "https://github.com/modelcontextprotocol/registry/.github/workflows/release.yml@refs/tags/${MCP_PUBLISHER_VERSION}" \
|
|
134
|
+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
|
|
135
|
+
"$archive"
|
|
136
|
+
tar xzf "$archive" mcp-publisher
|
|
137
|
+
rm -f "$archive" "$archive.sigstore.json"
|
|
138
|
+
|
|
139
|
+
- run: ./mcp-publisher login github-oidc
|
|
140
|
+
- run: ./mcp-publisher publish
|
|
141
|
+
|
|
142
|
+
bundle:
|
|
143
|
+
name: Attach the Claude Desktop extension
|
|
144
|
+
needs: pypi # the bundle installs this version from PyPI
|
|
145
|
+
runs-on: ubuntu-latest
|
|
146
|
+
permissions:
|
|
147
|
+
contents: write # create the GitHub release and upload the .mcpb
|
|
148
|
+
steps:
|
|
149
|
+
- uses: actions/checkout@v4
|
|
150
|
+
- uses: actions/setup-node@v4
|
|
151
|
+
with:
|
|
152
|
+
node-version: 22
|
|
153
|
+
- run: scripts/build-mcpb.sh
|
|
154
|
+
- name: Upload to the GitHub release
|
|
155
|
+
env:
|
|
156
|
+
GH_TOKEN: ${{ github.token }}
|
|
157
|
+
run: |
|
|
158
|
+
set -euo pipefail
|
|
159
|
+
file="dist/applecal-mcp-${GITHUB_REF_NAME#v}.mcpb"
|
|
160
|
+
gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1 \
|
|
161
|
+
|| gh release create "$GITHUB_REF_NAME" --verify-tag --generate-notes --title "$GITHUB_REF_NAME"
|
|
162
|
+
gh release upload "$GITHUB_REF_NAME" "$file" --clobber
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.venv/
|
|
5
|
+
*.egg-info/
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
|
|
9
|
+
# Tool caches and reports
|
|
10
|
+
.pytest_cache/
|
|
11
|
+
.mypy_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.coverage
|
|
14
|
+
coverage.xml
|
|
15
|
+
htmlcov/
|
|
16
|
+
|
|
17
|
+
# Local secrets and personal settings (never commit)
|
|
18
|
+
.env
|
|
19
|
+
.env.*
|
|
20
|
+
!.env.example
|
|
21
|
+
.claude/settings.local.json
|
|
22
|
+
|
|
23
|
+
# Helper app if built inside the repo (install-app --dest ...)
|
|
24
|
+
*.app/
|
|
25
|
+
# Prebuilt launcher: built by scripts/build-helper.sh for the wheel, never committed
|
|
26
|
+
src/apple_calendar_mcp/macos_helper/apple-calendar-mcp-launcher
|
|
27
|
+
|
|
28
|
+
# Editors and macOS
|
|
29
|
+
.idea/
|
|
30
|
+
.vscode/
|
|
31
|
+
.DS_Store
|
|
32
|
+
|
|
33
|
+
# uv.lock is committed on purpose: CI runs `uv sync --locked` for reproducible installs.
|
|
34
|
+
|
|
35
|
+
# Cloudflare Worker
|
|
36
|
+
worker/node_modules/
|
|
37
|
+
worker/.wrangler/
|
|
38
|
+
worker/dist/
|
|
39
|
+
worker/.dev.vars
|
|
40
|
+
worker/.dev.vars.*
|
|
41
|
+
|
|
42
|
+
# Personal scripts (e.g. deploy/local/update-cloudflare.sh); not part of the project
|
|
43
|
+
deploy/local/
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Remote connector image: CalDAV (iCloud) backend served over HTTP with OAuth.
|
|
2
|
+
# Build: docker build -t applecal-mcp .
|
|
3
|
+
# Run: docker compose up -d (reads .env, see .env.example)
|
|
4
|
+
FROM python:3.13-slim
|
|
5
|
+
|
|
6
|
+
COPY --from=ghcr.io/astral-sh/uv:0.13.6 /uv /usr/local/bin/uv
|
|
7
|
+
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=never
|
|
8
|
+
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
# Dependencies first, so code changes don't reinstall them.
|
|
11
|
+
COPY pyproject.toml uv.lock README.md LICENSE ./
|
|
12
|
+
RUN uv sync --locked --no-dev --extra remote --no-install-project
|
|
13
|
+
COPY src ./src
|
|
14
|
+
RUN uv sync --locked --no-dev --extra remote
|
|
15
|
+
|
|
16
|
+
RUN useradd --uid 10001 --no-create-home --shell /usr/sbin/nologin app \
|
|
17
|
+
&& mkdir -p /data && chown app /data
|
|
18
|
+
USER app
|
|
19
|
+
|
|
20
|
+
ENV PATH="/app/.venv/bin:$PATH" \
|
|
21
|
+
HOST=0.0.0.0 \
|
|
22
|
+
PORT=8000 \
|
|
23
|
+
DATA_DIR=/data \
|
|
24
|
+
FORWARDED_ALLOW_IPS="*"
|
|
25
|
+
EXPOSE 8000
|
|
26
|
+
VOLUME ["/data"]
|
|
27
|
+
HEALTHCHECK --interval=30s --timeout=5s \
|
|
28
|
+
CMD ["python", "-c", "import os, urllib.request; urllib.request.urlopen(f'http://127.0.0.1:{os.environ[\"PORT\"]}/healthz', timeout=4)"]
|
|
29
|
+
|
|
30
|
+
CMD ["applecal-mcp", "serve-http"]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Oğuz Kağan Göçmez
|
|
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.
|