@cpenned/mcp 0.9.1 → 0.11.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cpenned/mcp",
3
- "version": "0.9.1",
3
+ "version": "0.11.0",
4
4
  "description": "MCP server for Open Brain - a thin adapter over the /v1 HTTP API.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,6 +31,7 @@
31
31
  "main": "./dist/index.js",
32
32
  "files": [
33
33
  "dist",
34
+ "dist-ui",
34
35
  "skills",
35
36
  "README.md",
36
37
  "LICENSE"
@@ -39,19 +40,20 @@
39
40
  "access": "public"
40
41
  },
41
42
  "scripts": {
42
- "build": "node scripts/bundle-skills.mjs && tsc -p tsconfig.json",
43
- "typecheck": "tsc -p tsconfig.json --noEmit",
43
+ "build": "node scripts/bundle-skills.mjs && node scripts/build-ui.mjs && tsc -p tsconfig.json",
44
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p ui/tsconfig.json",
44
45
  "test": "vitest run",
45
46
  "start": "node dist/index.js",
46
47
  "prepublishOnly": "npm run build"
47
48
  },
48
49
  "dependencies": {
49
- "@mcp-ui/server": "^6.1.0",
50
+ "@modelcontextprotocol/ext-apps": "^1.7.5",
50
51
  "@modelcontextprotocol/sdk": "^1.29.0",
51
52
  "zod": "^4.6.7"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@types/node": "^22.0.0",
56
+ "esbuild": "^0.27.0",
55
57
  "typescript": "^5.6.0",
56
58
  "vitest": "^4.1.8"
57
59
  }
@@ -222,10 +222,16 @@ pre-guessing constraints.
222
222
  - **AI**: `find_tasks` (hybrid keyword + semantic search), `ai_triage`
223
223
  (brain dump → garden-assigned tasks, recurring habits, reading-list
224
224
  saves/edits/cancels, and books - see Workflows).
225
- - **UI (read-only)**: `ui_view`, `ui_review_queue`, `ui_garden_board`,
226
- `ui_habits` return `ui://` HTML resources. `ui_view` and `ui_habits` take a
227
- `cursor`; when a page is cut short the result adds a text note with the
228
- cursor for the next page.
225
+ - **Cards (MCP Apps)**: in hosts that render MCP Apps, these tools also show
226
+ an interactive card: `get_task` / `create_task` / `update_task` (task card:
227
+ Done, Defer to tomorrow, Open), `get_view` (agenda, tick to complete),
228
+ `create_tasks` and `ai_triage` (what was created, with Undo), `get_reviews`
229
+ (Reviewed / Contacted), `list_habits` (check in for today) and
230
+ `review_garden` (board by status). The JSON result is unchanged, so keep
231
+ reading it. When the user acts on a card, a model-context note says what
232
+ changed; trust it over the earlier result and don't redo the action. To
233
+ show the user a list visually, call the matching tool rather than pasting
234
+ a long text list. (The old `ui_*` tools are gone.)
229
235
  - **Settings**: `get_settings`, `update_settings` (the default review period
230
236
  applied to new tasks/projects; `defaultReviewInterval: null` disables it;
231
237
  `defaultTimezone`, an IANA string, is also settable - it's what date-only
@@ -241,6 +247,15 @@ pre-guessing constraints.
241
247
  `notifications: {emailOnMention, emailOnAssign}`), `update_profile
242
248
  {displayName?, notifications?: {emailOnMention?, emailOnAssign?}}` (pass at
243
249
  least one; display name 1-60 chars; avatar upload is web-only).
250
+ - **History** (every write from every surface, with before/after values):
251
+ `list_history` (filters `entityType`, `entityId`, `source`, `actor`,
252
+ `since`/`until` as epoch ms or ISO date/time, `batchId`, `limit` 1-200
253
+ default 50, `cursor`; newest first, `{ items, hasMore, nextCursor }`),
254
+ `get_history_entry {id}`, `revert_change {id}` or `revert_change
255
+ {batchId}` (plus `force?`). Entries carry `summary` (human line),
256
+ `actor`, `source`, `at`, `fields`, `before`/`after` (changed fields only;
257
+ a missing key means unset), `batchId`, `revertOf`, `revertedBy`,
258
+ `revertable`. See the undo workflow below.
244
259
  - **Keys**: `create_key` (optional `includeGrants` to let the new key see
245
260
  gardens shared with its owner - only settable if the calling key itself
246
261
  has it), `list_keys`, `rotate_key`, `revoke_key`. `rotate_key` and
@@ -331,6 +346,21 @@ pre-guessing constraints.
331
346
  link it to a person at the same time, pass `tagIds`/`personIds` inline
332
347
  instead of following up with separate calls.
333
348
 
349
+ - **Undo a change** → `list_history` filtered by `entityId` (or `since`)
350
+ to find the entry, check `revertable`, then `revert_change {id}`. A bulk or
351
+ multi-entity action shares one `batchId`; undo all of it with
352
+ `revert_change {batchId}`. Update reverts write `before` back only for
353
+ fields whose current value still equals `after`; fields edited since come
354
+ back as `conflicts` (`{field, expected, current}`) and are left alone.
355
+ Show the user the conflicts and only re-run with `force: true` if they want
356
+ them overwritten. Reverting a create soft-deletes (tasks/projects
357
+ canceled, gardens/people/habits archived, books/reading/Strava deleted;
358
+ tags and saved lists are hard-deleted), reverting a delete restores (a
359
+ hard-deleted tag/saved list returns under `newEntityId`), tag/link
360
+ add/remove invert. The result is `{ batchId, results, entries }` with a
361
+ per-entity `status` (`reverted`, `partial`, `conflict`, `noop`,
362
+ `skipped`). To redo, revert the returned `batchId`.
363
+
334
364
  ## Gotchas
335
365
 
336
366
  - Tools act on the vault behind the configured API key. If the user's web tasks
@@ -339,7 +369,10 @@ pre-guessing constraints.
339
369
  - Scopes gate tools: resource tools need `<resource>:read|write` (people tools
340
370
  `people:read|write`, settings tools `settings:read|write`, reading list tools
341
371
  `reading:read|write`, Strava tools `strava:read|write`, book tools
342
- `books:read|write`, calendar tools `calendar:read|write`), review tools
372
+ `books:read|write`, calendar tools `calendar:read|write`), history tools
373
+ `history:read` (rows only for entity types the key can also read) and
374
+ `revert_change` `history:write` plus the write scope of each entity it
375
+ touches, review tools
343
376
  `reviews:*`, `find_tasks` needs `ai:invoke` + `tasks:read`, `ai_triage` needs
344
377
  `ai:invoke` + `tasks:write`, `reading:write`, `habits:write`, and
345
378
  `books:write` (it can create any of those), the `*_key` tools need `keys:manage`. A missing scope returns a
@@ -348,6 +381,10 @@ pre-guessing constraints.
348
381
  web-only flow, `POST /v1/uploads` before setting `coverStorageId`), but a
349
382
  key used for that flow needs `books:write` alongside `tasks:write`/
350
383
  `projects:write`.
384
+ - `revert_change` fails with a 400 "Invalid revert" for changes that are not
385
+ revertable (`revertable: false`: system rows, recurrence spawns, settings,
386
+ keys, webhooks, attachments, oversized values). Check the flag before
387
+ offering an undo.
351
388
  - `sync_strava_activities` requires a Strava account already connected (via
352
389
  the web UI's Settings page) — it does nothing useful if nobody has
353
390
  authorized the app yet.