commit ad3bac91ae378e4564b9df88301b75793802a01c Author: Adolfo Reyna Date: Tue May 26 21:54:57 2026 -0400 Initial local macOS MCP service diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..f356069 --- /dev/null +++ b/.env.example @@ -0,0 +1,4 @@ +# The service binds to localhost only. Set a token if your harness supports bearer auth. +MACMINI_MCP_HOST=127.0.0.1 +MACMINI_MCP_PORT=7331 +# MACMINI_MCP_TOKEN=replace-with-a-long-random-token diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..979f391 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules/ +.env +*.log +.logs/ +.DS_Store +coverage/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..b34a41a --- /dev/null +++ b/README.md @@ -0,0 +1,102 @@ +# MacMini MCP + +A local Model Context Protocol server that exposes selected macOS app actions to +an AI harness. It uses Apple's scripting interfaces through `/usr/bin/osascript` +and stays on the local machine. + +## Available tools + +| Tool | Action | +| --- | --- | +| `notes_list` | Search note titles and plaintext previews | +| `notes_read` | Read a note by the ID returned by `notes_list` | +| `notes_create` | Create a plaintext-backed note | +| `calendar_list_calendars` | List calendars and write capability | +| `calendar_list_events` | List events in an ISO-8601 time window | +| `calendar_create_event` | Create an event on a named writable calendar | +| `reminders_list_lists` | List reminder lists | +| `reminders_list` | List reminders | +| `reminders_create` | Create a reminder | + +There are no destructive tools in the initial server. + +## Setup + +Requires macOS and Node.js 20 or newer. + +```sh +npm install +npm run check +npm run service:install +``` + +The service endpoint is: + +```text +http://127.0.0.1:7331/mcp +``` + +Health check: + +```sh +curl -s http://127.0.0.1:7331/health +``` + +`launchd` runs `node --watch src/http.js`, so edits to the server or imported +modules cause it to restart automatically while the agent remains installed. +After changing installed dependencies or service configuration, run: + +```sh +npm install +npm run service:install +``` + +Operational commands: + +```sh +npm run service:status +npm run service:restart +npm run service:uninstall +``` + +Service logs are stored in `.logs/`. + +## Harness configuration + +For a harness that supports Streamable HTTP, configure the local MCP URL as +`http://127.0.0.1:7331/mcp`. + +For a harness that launches stdio servers, use: + +```json +{ + "mcpServers": { + "macmini": { + "command": "/Users/adolforeyna/.nvm/versions/node/v22.22.0/bin/node", + "args": ["/Users/adolforeyna/Projects/MacMiniMCP/src/stdio.js"] + } + } +} +``` + +## Permissions and security + +On first use of a Notes, Calendar, or Reminders tool, macOS may ask for +Automation access for Node. Permit only the applications you want the server +to control under **System Settings > Privacy & Security > Automation**. + +The HTTP service binds to `127.0.0.1` by default. To require bearer +authentication even locally, create `.env` from `.env.example` and set +`MACMINI_MCP_TOKEN`; clients must then send `Authorization: Bearer `. +Do not bind to a non-loopback address without enabling authentication and +reviewing the tools first. + +## Development + +```sh +npm run check +npm run dev +``` + +The MCP transport follows the official TypeScript SDK Streamable HTTP server +approach: [Model Context Protocol TypeScript SDK](https://github.com/modelcontextprotocol/typescript-sdk). diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..f0cf284 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1160 @@ +{ + "name": "macmini-mcp", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "macmini-mcp", + "version": "0.1.0", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0", + "zod": "^3.25.0" + }, + "devDependencies": {}, + "engines": { + "node": ">=20.0.0" + } + }, + "node_modules/@hono/node-server": { + "version": "1.19.14", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.14.tgz", + "integrity": "sha512-GwtvgtXxnWsucXvbQXkRgqksiH2Qed37H9xHZocE5sA3N8O8O8/8FA3uclQXxXVzc9XBZuEOMK7+r02FmSpHtw==", + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.29.0.tgz", + "integrity": "sha512-zo37mZA9hJWpULgkRpowewez1y6ML5GsXJPY8FI0tBBCd77HEvza4jDqRKOXgHNn867PVGCyTdzqpz0izu5ZjQ==", + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.9", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.2.1", + "express-rate-limit": "^8.2.1", + "hono": "^4.11.4", + "jose": "^6.1.3", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.1" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz", + "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==", + "license": "MIT", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", + "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventsource": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz", + "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==", + "license": "MIT", + "dependencies": { + "eventsource-parser": "^3.0.1" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/eventsource-parser": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.8.tgz", + "integrity": "sha512-70QWGkr4snxr0OXLRWsFLeRBIRPuQOvt4s8QYjmUlmlkyTZkRqS7EDVRZtzU3TiyDbXSzaOeF0XUKy8PchzukQ==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/express-rate-limit": { + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.5.2.tgz", + "integrity": "sha512-5Kb34ipNX694DH48vN9irak1Qx30nb0PLYHXfJgw4YEjiC3ZEmZJhwOp+VfiCYwFzvFTdB9QkArYS5kXa2cx2A==", + "license": "MIT", + "dependencies": { + "ip-address": "^10.2.0" + }, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://github.com/sponsors/express-rate-limit" + }, + "peerDependencies": { + "express": ">= 4.11" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.3.tgz", + "integrity": "sha512-ej4AhfhfL2Q2zpMmLo7U1Uv9+PyhIZpgQLGT1F9miIGmiCJIoCgSmczFdrc97mWT4kVY72KA+WnnhJ5pghSvSg==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hono": { + "version": "4.12.23", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.23.tgz", + "integrity": "sha512-eIaZ9qDgu7XV0pxOCrg7/WhnQ6Ivm22UcxhXx/A3dcbqbbYgBEkc6e/J/s7j2tS96zoB0S9VBdLwQNCWwUo4LA==", + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz", + "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/jose": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.3.tgz", + "integrity": "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" + }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "license": "BSD-2-Clause" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", + "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/pkce-challenge": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz", + "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==", + "license": "MIT", + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.15.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.2.tgz", + "integrity": "sha512-Rzq0KEyX/w/tEybncDgdkZrJgVUsUMk3xjh3t5bv3S1HTAtg+uOYt72+ZfwiQwKdysThkTBdL/rTi6HDmX9Ddw==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", + "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==", + "license": "MIT", + "dependencies": { + "content-type": "^2.0.0", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/type-is/node_modules/content-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz", + "integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zod-to-json-schema": { + "version": "3.25.2", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz", + "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==", + "license": "ISC", + "peerDependencies": { + "zod": "^3.25.28 || ^4" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c7154bc --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "macmini-mcp", + "version": "0.1.0", + "private": true, + "description": "Local MCP server for approved macOS app automation.", + "type": "module", + "engines": { + "node": ">=20.0.0" + }, + "scripts": { + "start": "node src/http.js", + "start:stdio": "node src/stdio.js", + "dev": "node --watch src/http.js", + "check": "node --check src/*.js && node --check src/integrations/*.js && node --test", + "service:install": "./scripts/install-service.sh", + "service:restart": "./scripts/restart-service.sh", + "service:status": "./scripts/status-service.sh", + "service:uninstall": "./scripts/uninstall-service.sh" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "^1.0.0", + "zod": "^3.25.0" + }, + "devDependencies": {} +} diff --git a/scripts/install-service.sh b/scripts/install-service.sh new file mode 100755 index 0000000..5db0992 --- /dev/null +++ b/scripts/install-service.sh @@ -0,0 +1,51 @@ +#!/bin/zsh +set -euo pipefail + +LABEL="com.local.macmini-mcp" +PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +NODE_BIN="$(command -v node)" +AGENT_DIR="$HOME/Library/LaunchAgents" +PLIST="$AGENT_DIR/$LABEL.plist" +LOG_DIR="$PROJECT_DIR/.logs" +DOMAIN="gui/$(id -u)" + +mkdir -p "$AGENT_DIR" "$LOG_DIR" + +cat > "$PLIST" < + + + + Label + $LABEL + ProgramArguments + + $NODE_BIN + --watch + src/http.js + + WorkingDirectory + $PROJECT_DIR + RunAtLoad + + KeepAlive + + ThrottleInterval + 2 + StandardOutPath + $LOG_DIR/service.out.log + StandardErrorPath + $LOG_DIR/service.err.log + + +PLIST + +plutil -lint "$PLIST" +launchctl bootout "$DOMAIN" "$PLIST" 2>/dev/null || true +launchctl bootstrap "$DOMAIN" "$PLIST" +launchctl enable "$DOMAIN/$LABEL" +launchctl kickstart -k "$DOMAIN/$LABEL" + +echo "Installed $LABEL" +echo "Endpoint: http://127.0.0.1:7331/mcp" +echo "Logs: $LOG_DIR" diff --git a/scripts/restart-service.sh b/scripts/restart-service.sh new file mode 100755 index 0000000..402076a --- /dev/null +++ b/scripts/restart-service.sh @@ -0,0 +1,8 @@ +#!/bin/zsh +set -euo pipefail + +LABEL="com.local.macmini-mcp" +DOMAIN="gui/$(id -u)" + +launchctl kickstart -k "$DOMAIN/$LABEL" +echo "Restarted $LABEL" diff --git a/scripts/status-service.sh b/scripts/status-service.sh new file mode 100755 index 0000000..b244efa --- /dev/null +++ b/scripts/status-service.sh @@ -0,0 +1,7 @@ +#!/bin/zsh +set -euo pipefail + +LABEL="com.local.macmini-mcp" +DOMAIN="gui/$(id -u)" + +launchctl print "$DOMAIN/$LABEL" diff --git a/scripts/uninstall-service.sh b/scripts/uninstall-service.sh new file mode 100755 index 0000000..549646a --- /dev/null +++ b/scripts/uninstall-service.sh @@ -0,0 +1,10 @@ +#!/bin/zsh +set -euo pipefail + +LABEL="com.local.macmini-mcp" +PLIST="$HOME/Library/LaunchAgents/$LABEL.plist" +DOMAIN="gui/$(id -u)" + +launchctl bootout "$DOMAIN" "$PLIST" 2>/dev/null || true +rm -f "$PLIST" +echo "Uninstalled $LABEL" diff --git a/src/apple-events.js b/src/apple-events.js new file mode 100644 index 0000000..6585680 --- /dev/null +++ b/src/apple-events.js @@ -0,0 +1,49 @@ +import { execFile } from "node:child_process"; +import { promisify } from "node:util"; + +const execFileAsync = promisify(execFile); + +export async function runJxa(script, input = {}) { + try { + const { stdout } = await execFileAsync( + "/usr/bin/osascript", + ["-l", "JavaScript", "-e", script, "--", JSON.stringify(input)], + { + timeout: 30_000, + maxBuffer: 2 * 1024 * 1024, + }, + ); + + const text = stdout.trim(); + return text ? JSON.parse(text) : null; + } catch (error) { + const detail = error.stderr?.trim() || error.message; + throw new Error( + `macOS automation failed. Grant Automation access to the service if prompted. ${detail}`, + ); + } +} + +export function dateFromInput(value, fieldName) { + const date = new Date(value); + if (Number.isNaN(date.valueOf())) { + throw new Error(`${fieldName} must be a valid ISO-8601 date and time.`); + } + return date; +} + +export function plainTextToNoteHtml(title, body) { + const escape = (text) => + text + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """); + + const paragraphs = body + .split(/\n{2,}/) + .map((paragraph) => `
${escape(paragraph).replaceAll("\n", "
")}
`) + .join(""); + + return `

${escape(title)}

${paragraphs}`; +} diff --git a/src/config.js b/src/config.js new file mode 100644 index 0000000..547dbaa --- /dev/null +++ b/src/config.js @@ -0,0 +1,22 @@ +import { loadEnvFile } from "node:process"; + +try { + loadEnvFile(); +} catch (error) { + if (error.code !== "ENOENT") { + throw error; + } +} + +export function getConfig() { + const port = Number.parseInt(process.env.MACMINI_MCP_PORT || "7331", 10); + if (!Number.isInteger(port) || port < 1 || port > 65535) { + throw new Error("MACMINI_MCP_PORT must be an integer between 1 and 65535."); + } + + return { + host: process.env.MACMINI_MCP_HOST || "127.0.0.1", + port, + token: process.env.MACMINI_MCP_TOKEN || "", + }; +} diff --git a/src/http.js b/src/http.js new file mode 100644 index 0000000..1b8057c --- /dev/null +++ b/src/http.js @@ -0,0 +1,57 @@ +import http from "node:http"; +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import { getConfig } from "./config.js"; +import { createMacMiniMcpServer } from "./server.js"; + +const config = getConfig(); + +function authorized(request) { + if (!config.token) { + return true; + } + return request.headers.authorization === `Bearer ${config.token}`; +} + +const service = http.createServer(async (request, response) => { + const pathname = new URL(request.url, `http://${request.headers.host || "localhost"}`).pathname; + + if (pathname === "/health" && request.method === "GET") { + response.writeHead(200, { "content-type": "application/json" }); + response.end(JSON.stringify({ ok: true, service: "macmini-mcp" })); + return; + } + + if (pathname !== "/mcp") { + response.writeHead(404).end("Not found"); + return; + } + + if (!authorized(request)) { + response.writeHead(401, { "www-authenticate": "Bearer" }).end("Unauthorized"); + return; + } + + const server = createMacMiniMcpServer(); + const transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + + response.on("close", () => { + transport.close(); + server.close(); + }); + + try { + await server.connect(transport); + await transport.handleRequest(request, response); + } catch (error) { + console.error("MCP HTTP request failed:", error); + if (!response.headersSent) { + response.writeHead(500).end("MCP request failed"); + } + } +}); + +service.listen(config.port, config.host, () => { + console.error(`macmini-mcp listening on http://${config.host}:${config.port}/mcp`); +}); diff --git a/src/integrations/calendar.js b/src/integrations/calendar.js new file mode 100644 index 0000000..3a668b9 --- /dev/null +++ b/src/integrations/calendar.js @@ -0,0 +1,98 @@ +import { dateFromInput, runJxa } from "../apple-events.js"; + +const CALENDAR_LIST_SCRIPT = String.raw` +function run() { + const app = Application("Calendar"); + return JSON.stringify(app.calendars().map(function (calendar) { + return { name: String(calendar.name()), writable: Boolean(calendar.writable()) }; + })); +}`; + +const EVENTS_LIST_SCRIPT = String.raw` +function run(argv) { + const input = JSON.parse(argv[0]); + const app = Application("Calendar"); + const start = new Date(input.start); + const end = new Date(input.end); + const calendars = app.calendars(); + const found = []; + + for (let c = 0; c < calendars.length; c++) { + const calendar = calendars[c]; + const calendarName = String(calendar.name()); + if (input.calendar && calendarName !== input.calendar) continue; + const events = calendar.events(); + for (let e = 0; e < events.length; e++) { + const event = events[e]; + const eventStart = event.startDate(); + const eventEnd = event.endDate(); + if (eventEnd < start || eventStart > end) continue; + found.push({ + id: String(event.uid()), + calendar: calendarName, + title: String(event.summary()), + start: eventStart.toISOString(), + end: eventEnd.toISOString(), + allDay: Boolean(event.alldayEvent()), + location: String(event.location() || "") + }); + } + } + + found.sort(function (a, b) { return a.start.localeCompare(b.start); }); + return JSON.stringify(found.slice(0, input.limit)); +}`; + +const EVENT_CREATE_SCRIPT = String.raw` +function run(argv) { + const input = JSON.parse(argv[0]); + const app = Application("Calendar"); + const calendars = app.calendars(); + let destination = null; + for (let c = 0; c < calendars.length; c++) { + if (String(calendars[c].name()) === input.calendar) { + destination = calendars[c]; + break; + } + } + if (!destination) throw new Error("Calendar not found"); + if (!destination.writable()) throw new Error("Calendar is read-only"); + const event = app.Event({ + summary: input.title, + startDate: new Date(input.start), + endDate: new Date(input.end), + alldayEvent: input.allDay, + description: input.notes || "", + location: input.location || "" + }); + destination.events.push(event); + return JSON.stringify({ + id: String(event.uid()), + calendar: String(destination.name()), + title: String(event.summary()), + start: event.startDate().toISOString(), + end: event.endDate().toISOString() + }); +}`; + +export function listCalendars() { + return runJxa(CALENDAR_LIST_SCRIPT); +} + +export function listEvents({ start, end, calendar, limit }) { + dateFromInput(start, "start"); + dateFromInput(end, "end"); + if (new Date(start) > new Date(end)) { + throw new Error("start must occur before end."); + } + return runJxa(EVENTS_LIST_SCRIPT, { start, end, calendar, limit }); +} + +export function createEvent(input) { + const start = dateFromInput(input.start, "start"); + const end = dateFromInput(input.end, "end"); + if (start >= end) { + throw new Error("start must occur before end."); + } + return runJxa(EVENT_CREATE_SCRIPT, input); +} diff --git a/src/integrations/notes.js b/src/integrations/notes.js new file mode 100644 index 0000000..aacbd7e --- /dev/null +++ b/src/integrations/notes.js @@ -0,0 +1,109 @@ +import { plainTextToNoteHtml, runJxa } from "../apple-events.js"; + +const NOTES_LIST_SCRIPT = String.raw` +function run(argv) { + const input = JSON.parse(argv[0]); + const app = Application("Notes"); + const query = (input.query || "").toLowerCase(); + const folderName = input.folder || ""; + const limit = input.limit; + const found = []; + const accounts = app.accounts(); + + for (let a = 0; a < accounts.length && found.length < limit; a++) { + const folders = accounts[a].folders(); + for (let f = 0; f < folders.length && found.length < limit; f++) { + const folder = folders[f]; + const currentFolder = String(folder.name()); + if (folderName && currentFolder !== folderName) continue; + const notes = folder.notes(); + for (let n = 0; n < notes.length && found.length < limit; n++) { + const note = notes[n]; + let title = ""; + let text = ""; + try { title = String(note.name()); } catch (_) {} + try { text = String(note.plaintext()); } catch (_) {} + if (query && (title + "\n" + text).toLowerCase().indexOf(query) === -1) continue; + found.push({ + id: String(note.id()), + title: title, + folder: currentFolder, + modifiedAt: note.modificationDate().toISOString(), + preview: text.slice(0, 180) + }); + } + } + } + + return JSON.stringify(found); +}`; + +const NOTES_READ_SCRIPT = String.raw` +function run(argv) { + const input = JSON.parse(argv[0]); + const app = Application("Notes"); + const accounts = app.accounts(); + for (let a = 0; a < accounts.length; a++) { + const folders = accounts[a].folders(); + for (let f = 0; f < folders.length; f++) { + const notes = folders[f].notes(); + for (let n = 0; n < notes.length; n++) { + const note = notes[n]; + if (String(note.id()) === input.id) { + return JSON.stringify({ + id: String(note.id()), + title: String(note.name()), + folder: String(folders[f].name()), + bodyHtml: String(note.body()), + plaintext: String(note.plaintext()), + createdAt: note.creationDate().toISOString(), + modifiedAt: note.modificationDate().toISOString() + }); + } + } + } + } + throw new Error("Note not found"); +}`; + +const NOTES_CREATE_SCRIPT = String.raw` +function run(argv) { + const input = JSON.parse(argv[0]); + const app = Application("Notes"); + const accounts = app.accounts(); + let destination = null; + + for (let a = 0; a < accounts.length && !destination; a++) { + const folders = accounts[a].folders(); + for (let f = 0; f < folders.length; f++) { + if (!input.folder || String(folders[f].name()) === input.folder) { + destination = folders[f]; + break; + } + } + } + if (!destination) throw new Error("Notes destination folder not found"); + + const note = app.Note({body: input.html}); + destination.notes.push(note); + return JSON.stringify({ + id: String(note.id()), + title: String(note.name()), + folder: String(destination.name()) + }); +}`; + +export function listNotes(input) { + return runJxa(NOTES_LIST_SCRIPT, input); +} + +export function readNote(id) { + return runJxa(NOTES_READ_SCRIPT, { id }); +} + +export function createNote({ title, body, folder }) { + return runJxa(NOTES_CREATE_SCRIPT, { + folder, + html: plainTextToNoteHtml(title, body), + }); +} diff --git a/src/integrations/reminders.js b/src/integrations/reminders.js new file mode 100644 index 0000000..8391220 --- /dev/null +++ b/src/integrations/reminders.js @@ -0,0 +1,81 @@ +import { dateFromInput, runJxa } from "../apple-events.js"; + +const LISTS_SCRIPT = String.raw` +function run() { + const app = Application("Reminders"); + return JSON.stringify(app.lists().map(function (list) { + return { id: String(list.id()), name: String(list.name()) }; + })); +}`; + +const REMINDERS_LIST_SCRIPT = String.raw` +function run(argv) { + const input = JSON.parse(argv[0]); + const app = Application("Reminders"); + const lists = app.lists(); + const found = []; + for (let l = 0; l < lists.length && found.length < input.limit; l++) { + const list = lists[l]; + const name = String(list.name()); + if (input.list && name !== input.list) continue; + const reminders = list.reminders(); + for (let r = 0; r < reminders.length && found.length < input.limit; r++) { + const reminder = reminders[r]; + const completed = Boolean(reminder.completed()); + if (input.completed !== null && completed !== input.completed) continue; + let due = null; + try { + const value = reminder.dueDate(); + due = value ? value.toISOString() : null; + } catch (_) {} + found.push({ + id: String(reminder.id()), + list: name, + title: String(reminder.name()), + completed: completed, + due: due, + notes: String(reminder.body() || "") + }); + } + } + return JSON.stringify(found); +}`; + +const REMINDER_CREATE_SCRIPT = String.raw` +function run(argv) { + const input = JSON.parse(argv[0]); + const app = Application("Reminders"); + const lists = app.lists(); + let destination = null; + for (let l = 0; l < lists.length; l++) { + if (!input.list || String(lists[l].name()) === input.list) { + destination = lists[l]; + break; + } + } + if (!destination) throw new Error("Reminders list not found"); + const properties = {name: input.title, body: input.notes || ""}; + if (input.due) properties.dueDate = new Date(input.due); + const reminder = app.Reminder(properties); + destination.reminders.push(reminder); + return JSON.stringify({ + id: String(reminder.id()), + list: String(destination.name()), + title: String(reminder.name()) + }); +}`; + +export function listReminderLists() { + return runJxa(LISTS_SCRIPT); +} + +export function listReminders(input) { + return runJxa(REMINDERS_LIST_SCRIPT, input); +} + +export function createReminder(input) { + if (input.due) { + dateFromInput(input.due, "due"); + } + return runJxa(REMINDER_CREATE_SCRIPT, input); +} diff --git a/src/server.js b/src/server.js new file mode 100644 index 0000000..08e40ba --- /dev/null +++ b/src/server.js @@ -0,0 +1,126 @@ +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { z } from "zod"; +import { createEvent, listCalendars, listEvents } from "./integrations/calendar.js"; +import { createNote, listNotes, readNote } from "./integrations/notes.js"; +import { + createReminder, + listReminderLists, + listReminders, +} from "./integrations/reminders.js"; + +const jsonResult = (value) => ({ + content: [{ type: "text", text: JSON.stringify(value, null, 2) }], +}); + +const handled = (operation) => async (input) => { + try { + return jsonResult(await operation(input)); + } catch (error) { + return { + isError: true, + content: [{ type: "text", text: error.message }], + }; + } +}; + +export function createMacMiniMcpServer() { + const server = new McpServer({ + name: "macmini-mcp", + version: "0.1.0", + }); + + server.tool( + "notes_list", + "Find notes by optional text or folder filter. Returns previews, not full note bodies.", + { + query: z.string().optional().describe("Text to search in note title and plaintext body."), + folder: z.string().optional().describe("Exact Notes folder name."), + limit: z.number().int().positive().max(100).default(20), + }, + handled(listNotes), + ); + + server.tool( + "notes_read", + "Read one Apple Note after locating its ID with notes_list.", + { id: z.string().min(1).describe("Notes unique ID.") }, + handled(({ id }) => readNote(id)), + ); + + server.tool( + "notes_create", + "Create a new Apple Note from plaintext content.", + { + title: z.string().min(1).max(300), + body: z.string().default(""), + folder: z.string().optional().describe("Exact destination folder; defaults to the first available folder."), + }, + handled(createNote), + ); + + server.tool( + "calendar_list_calendars", + "List macOS Calendar calendars and indicate which accept new events.", + {}, + handled(listCalendars), + ); + + server.tool( + "calendar_list_events", + "List Calendar events intersecting a required ISO-8601 time range.", + { + start: z.string().describe("Range start as an ISO-8601 datetime."), + end: z.string().describe("Range end as an ISO-8601 datetime."), + calendar: z.string().optional().describe("Exact calendar name."), + limit: z.number().int().positive().max(250).default(50), + }, + handled(listEvents), + ); + + server.tool( + "calendar_create_event", + "Create an event on a named writable macOS calendar.", + { + calendar: z.string().min(1).describe("Exact destination calendar name."), + title: z.string().min(1).max(500), + start: z.string().describe("Event start as an ISO-8601 datetime."), + end: z.string().describe("Event end as an ISO-8601 datetime."), + allDay: z.boolean().default(false), + notes: z.string().optional(), + location: z.string().optional(), + }, + handled(createEvent), + ); + + server.tool( + "reminders_list_lists", + "List Reminders lists.", + {}, + handled(listReminderLists), + ); + + server.tool( + "reminders_list", + "List reminders with optional list and completion filters.", + { + list: z.string().optional().describe("Exact Reminders list name."), + completed: z.boolean().nullable().default(false).describe("Use null to return both complete and incomplete items."), + limit: z.number().int().positive().max(100).default(25), + }, + handled(listReminders), + ); + + server.tool( + "reminders_create", + "Create a reminder in an optional named Reminders list.", + { + title: z.string().min(1).max(500), + list: z.string().optional().describe("Exact destination list; defaults to the first available list."), + notes: z.string().optional(), + due: z.string().optional().describe("Optional due date as an ISO-8601 datetime."), + }, + handled(createReminder), + ); + + return server; +} diff --git a/src/stdio.js b/src/stdio.js new file mode 100644 index 0000000..08eab8e --- /dev/null +++ b/src/stdio.js @@ -0,0 +1,7 @@ +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; +import { createMacMiniMcpServer } from "./server.js"; + +const server = createMacMiniMcpServer(); +const transport = new StdioServerTransport(); + +await server.connect(transport); diff --git a/test/apple-events.test.js b/test/apple-events.test.js new file mode 100644 index 0000000..892d527 --- /dev/null +++ b/test/apple-events.test.js @@ -0,0 +1,15 @@ +import assert from "node:assert/strict"; +import test from "node:test"; +import { dateFromInput, plainTextToNoteHtml } from "../src/apple-events.js"; + +test("plainTextToNoteHtml escapes input and preserves line breaks", () => { + assert.equal( + plainTextToNoteHtml("R&D ", 'First\n"second"'), + "

R&D <today>

First
"second"
", + ); +}); + +test("dateFromInput accepts valid datetimes and rejects invalid input", () => { + assert.equal(dateFromInput("2026-05-26T10:00:00-04:00", "start").toISOString(), "2026-05-26T14:00:00.000Z"); + assert.throws(() => dateFromInput("not-a-date", "start"), /valid ISO-8601/); +});