@levitating/tensor-mcp 5.0.0 → 5.2.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.
Files changed (3) hide show
  1. package/README.md +302 -184
  2. package/dist/index.js +294 -64
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,177 +1,32 @@
1
1
  # Tensor MCP
2
2
 
3
- Model Context Protocol server that exposes the Tensor API as tools for AI assistants. Same Clerk API key, same scopes, same deny-by-default rules as the REST API — an MCP client can never reach anything the REST API would not hand the same key.
4
-
5
- Tensor is a private family office workbench: a ledger of entities, accounts, assets, positions and transactions, plus the work around it — todos, an idea capture inbox, encrypted files. **Since 2.1.0 the work surfaces are part of this API too**, each under its own scopes: what you get is the ledger, the reference catalogs, the dry-run/apply pipeline, price/quote lookups, files (upload, browse, folders, download URLs, export manifest), todos, and ideas. The boundary that remains is deliberate — **no unrecoverable destruction, and no self-widening**: every Trash purge (todos, ideas, files), comment deletion, decryption-device enrollment, the file access logs, links/tags, site-wide search, FX and loan terms all stay session-only, and Tensor's smoke tests assert those denials in the negative. The reasoning lives in `docs/contract/MCP.md` in the Tensor repo.
6
-
7
- Published as [`@levitating/tensor-mcp`](https://www.npmjs.com/package/@levitating/tensor-mcp). The full inventory is the tables below; nothing here needs a clone of the Tensor repo.
8
-
9
- See the full docs at [tensor.levitating.org/docs/mcp](https://tensor.levitating.org/docs/mcp). The contract behind these tools — scope mapping, access boundaries, and the version policy — is `docs/contract/MCP.md` in the Tensor repo.
10
-
11
- ## 5.0.0 — Todo labels are Todo tags
12
-
13
- Breaking tool-name change. Todos and Ideas now use Tensor's canonical tag
14
- catalog and assignments. Todo reads return `tags` and `tagIds`, and Todo tag
15
- writes use the same records that the web app, REST API, filters and settings
16
- use.
17
-
18
- Rename calls by replacing `set_todo_labels` with `set_todo_tags`,
19
- `list_todo_labels` with `list_todo_tags`, `create_todo_label` with
20
- `create_todo_tag`, `update_todo_label` with `update_todo_tag`, and
21
- `delete_todo_label` with `delete_todo_tag`.
22
-
23
- There are no MCP aliases for the old tool names. Update any prompt, script or
24
- saved workflow that calls a tool by name. Hosted HTTP clients only need to
25
- refresh or reconnect so they fetch the latest tool catalog. Local stdio clients
26
- must update to `@levitating/tensor-mcp@^5.0.0` and restart the client.
27
-
28
- The underlying REST label routes remain deprecated compatibility adapters, but
29
- new integrations should use `PUT /api/todos/:id/tags` with `{ "tagIds": [] }`.
30
- MCP tools never write `tag_catalog` or `tag_assignments` directly: the REST
31
- handlers validate scope and target type, then perform the canonical catalog and
32
- assignment writes transactionally.
33
-
34
- ## 2.0.0 — breaking change
35
-
36
- Tensor's **Documents** feature was renamed to **Files** (2026-08), all the way down: tables, routes, scope and tool names. For an MCP client that means:
37
-
38
- | What | Was | Now |
39
- | ---- | --- | --- |
40
- | Tool name | `list_documents` | `list_files` |
41
- | Scope on the key | `tensor:documents:read` | `tensor:files:read` |
42
- | Endpoint behind it | `GET /api/documents/manifest` | `GET /api/files/manifest` |
43
-
44
- There is no alias and no deprecation window — the old names are gone. **Existing API keys carrying `tensor:documents:read` must be re-issued with `tensor:files:read`**, and any prompt, script or saved workflow that calls `list_documents` by name has to be updated. Everything else in the tool set is unchanged.
45
-
46
- ## 4.4.0 — `browse_files` can say what order it wants
47
-
48
- Additive, one optional input. `browse_files` takes **`sort`**, one of
49
- `modified_desc` / `modified_asc` / `added_desc` / `added_asc` / `name_asc` /
50
- `name_desc` / `size_desc` / `size_asc`. The default is `added_desc` — newest
51
- first, exactly what every previous release returned. Nothing is renamed, nothing
52
- is removed, no scope changes, and a call that omits it behaves as before.
53
-
54
- It closes the last gap where Tensor's Files page could do something an agent
55
- could not. The four columns are the page's own — `modified` is `updated_at`,
56
- `added` is `created_at`, `name` is the display title and `size` is the
57
- **plaintext** length, so an encrypted file sorts by what it is rather than by
58
- its envelope's overhead. One name carries both the column and the direction
59
- because the server looks the value up in a closed map of `ORDER BY` fragments;
60
- a direction sent separately would only be composed back into that key.
61
-
62
- **It is a server-side order, and that is the point.** The listing is capped
63
- (default 500), so re-sorting a page in the client orders the window rather than
64
- the library — "the ten biggest files" computed that way is the ten biggest of
65
- the five hundred most recent. Every order also ends in the file id, so paging
66
- with `limit`/`offset` cannot show one row twice and skip another.
67
-
68
- Two things worth knowing before you trust an ordering: names sort by the
69
- database's collation rather than a natural sort, so `Q10` comes before `Q9`; and
70
- an unrecognised value is ignored rather than refused — ordering is not a filter,
71
- so a bad one costs the default order and never an error.
72
-
73
- ## 4.3.0 — `list_ideas` can say what order it wants
74
-
75
- Additive, one optional input. `list_ideas` takes **`sort`**: `newest` (the
76
- default, and what every previous release did), `oldest`, `updated` (recently
77
- edited first) or `title` (A-Z). Nothing is renamed, nothing is removed, no scope
78
- changes, and a call that omits it behaves exactly as before.
79
-
80
- It closes a gap rather than adding a capability: Tensor's own Ideas stream has
81
- offered these four orders for as long as the arrangement work has been in, and
82
- `GET /api/ideas?sort=` has parsed them the whole time — the tool simply had no
83
- way to ask, so anything an agent wanted in a different order had to be paged out
84
- in full and re-sorted locally, which for a capped listing quietly answers the
85
- wrong question. `list_todos` has had its own `sort` since it shipped; this is
86
- that shape one noun over.
87
-
88
- **There is deliberately no `manual`.** A todo carries a fractional rank key and
89
- can be hand-placed; an idea has no such column, and an inbox is not something
90
- anyone arranges by hand. An unrecognised value is ignored rather than refused —
91
- ordering is not a filter, so a bad one costs you the default order and never an
92
- error.
93
-
94
- ## 4.2.0 — an idea's body is a document
95
-
96
- Additive, and the wire did not change shape. An idea's body used to be a plain
97
- `TEXT` column; it is a TipTap document now, the same as a memo's body and the
98
- same as an idea's own comments, so an idea can hold an **inline image**.
99
-
100
- `body` still goes in as plain text and still comes back as plain text — Tensor
101
- wraps what you send into a document (one paragraph per line) and derives `body`
102
- back out of it for search and previews. Reads gain `bodyJson`, the document
103
- itself; it is `null` on a capture written before this release that has not been
104
- edited since, which means "`body` is the whole of it". Nothing is renamed,
105
- nothing is removed and no scope changes, so no installed client and no issued
106
- key is affected.
107
-
108
- **An agent cannot put an image INSIDE the prose, and that is deliberate.** These
109
- tools take `body` as text and there is no `bodyJson` input: publishing the
110
- editor's node shape as a tool input would freeze an internal name into a
111
- permanent major-bump obligation, and hand-built ProseMirror JSON is the most
112
- likely thing to arrive unopenable. The capability you actually want — "give this
113
- idea a picture" — is the **gallery**, and it is the same file row an inline
114
- image points at: `create_idea_upload_url` → PUT the bytes → confirm the
115
- `storageKey` in `media`. A URL or a markdown image typed into `body` is stored
116
- as the literal text you typed.
117
-
118
- **Two things to know before you write one.** Sending `body` REPLACES the whole
119
- document, inline images included — that is the honest reading of "set the body
120
- to this text", and it is worth a read of the idea first if you did not write it.
121
- The image is not destroyed: an inline image *is* a file row in the idea's
122
- gallery, so it survives there and only stops appearing in the prose. And `body`
123
- is now capped at 256000 characters, the ceiling todos, memos and comments have
124
- always had; a longer body is refused at the edge rather than stored and then
125
- failing to open.
126
-
127
- ## 4.1.0 — an idea's record links
128
-
129
- Additive. Three new tools — **`list_idea_links`**, **`attach_idea_link`**,
130
- **`detach_idea_link`** — plus a `targetType`/`targetId` filter on `list_ideas`.
131
- Nothing is renamed, nothing is removed and no scope changes, so every installed
132
- client keeps working and no key needs re-issuing.
133
-
134
- What it closes is an asymmetry rather than a gap in Tensor: `links` is
135
- undirected and a todo could already be linked to an idea through
136
- `attach_todo_link`, so an agent could file work against an idea and had no way
137
- to file an idea against anything. Tensor's own web app made those links through
138
- a session-only route, which is why nothing was broken and why no key could do
139
- it.
140
-
141
- They carry the same two-scope rule as their todo and file counterparts — the
142
- surface's own scope plus the link target's read scope, reads narrowing silently
143
- and writes answering `403` — and the same one-door rule about attachments: an
144
- idea's files are its **gallery** (`get_idea` → `media`), `attach_idea_link` will
145
- not take `file`, and `detach_idea_link` refuses a gallery link id with a `409`
146
- instead of quietly removing a photo.
147
-
148
- ## 4.0.0 — Archive removed from Ideas
149
-
150
- Ideas follows Todos. **`list_ideas` loses `archived`** and **`update_idea` loses
151
- the `archived` field**; Delete is the only way to take a capture out of the
152
- stream, it is soft, and the row lands in a Trash that empties itself 60 days
153
- later. `delete_idea` and `restore_idea` are unchanged and already did exactly
154
- this.
155
-
156
- No tool was renamed and no scope changed, so **no key needs re-issuing** — but a
157
- saved prompt or script that passes `archived` to either tool stops archiving,
158
- and that is what makes it major. Both were REMOVED rather than accepted and
159
- ignored: a read filter that quietly stops filtering only widens a result set,
160
- while a write that quietly does nothing reports success for work it did not do.
161
-
162
- Tensor's HTTP API keeps `?archived` on `GET /api/ideas` as an inert parameter
163
- for the same read-side reason, so a raw HTTP caller sees the whole stream rather
164
- than an error. `PATCH /api/ideas/:id` refuses an `archived` field outright.
165
-
166
- ## 3.0.0 — Archive removed from Todos
167
-
168
- `archive_todo` is gone; **`delete_todo`** replaces it. The rename carries a real change: the old tool archived a todo (a permanent resting place, no expiry), and the new one soft-deletes it to a Trash that **empties itself 60 days after deletion**. `restore_todo` still undoes it, and now takes `withAncestors` for the case where an ancestor is also in Trash. `list_todos` loses `includeArchived` / `archivedOnly` and gains `trash`.
169
-
170
- No scope changed and **no key needs re-issuing** — `tensor:todos:write` covers both — but a saved prompt or script that calls `archive_todo` by name stops resolving, which is what makes this major. There is deliberately no purge tool and no empty-Trash tool: those are session-only in Tensor, and a tool whose every call returns 403 would be a promise this server cannot keep.
171
-
172
- ## 2.1.0 — todos, ideas, and full files access
173
-
174
- Tensor opened its work surfaces to API keys (2026-08), and this server grew tools for all three: todos (with workflow states and labels), the ideas capture inbox, and full file management alongside the existing export manifest. Additive only — every existing tool, name and scope is untouched, so installed clients keep working. The new tools need the new scopes (`tensor:todos:read/write`, `tensor:ideas:read/write`, `tensor:files:write` — see the table below) attached to your key when it is issued or re-issued.
3
+ A Model Context Protocol server that exposes Tensor as tools for AI assistants.
4
+
5
+ Tensor is a private family office workbench: a ledger of entities, accounts,
6
+ assets, positions and transactions, plus the work around it. Through this
7
+ server an assistant reaches the ledger and its reference catalogs, the
8
+ dry-run/apply import pipeline, price and quote lookups, scope-aware site-wide
9
+ search, Files, Todos, Ideas, and Web (bookmarks in a folder tree, and the tab
10
+ groups the browser extension parks).
11
+
12
+ **Every credential obeys the same deny-by-default REST scopes and route
13
+ allowlist**, so an MCP client can never reach anything its credential could
14
+ not reach over REST. The boundary is deliberate: **no unrecoverable
15
+ destruction, and no self-widening.** Every Trash purge, comment deletion,
16
+ decryption-device enrollment, the file access logs, the generic cross-surface
17
+ `/api/links*` and `/api/tags*`, FX and loan terms stay session-only. The
18
+ reasoning lives in `docs/contract/MCP.md` in the Tensor repo, and Tensor's
19
+ smoke tests assert those boundaries in both directions.
20
+
21
+ Published as [`@levitating/tensor-mcp@^5.2.0`](https://www.npmjs.com/package/@levitating/tensor-mcp).
22
+ The complete inventory is the tables below — every tool, nothing needing a
23
+ clone of the Tensor repo. CI derives and checks every listed name against
24
+ `mcp-server/tools.ts`, in both directions. Reader-facing docs:
25
+ [tensor.levitating.org/docs/mcp](https://tensor.levitating.org/docs/mcp).
26
+
27
+ **Contents:** [Hosted or local](#do-you-need-this-package-at-all) ·
28
+ [Configuration](#configuration) · [Writes are permanent](#writes-are-permanent) ·
29
+ [Available tools](#available-tools) · [Scopes](#scopes) · [Changelog](#changelog)
175
30
 
176
31
  ## Do you need this package at all?
177
32
 
@@ -202,6 +57,21 @@ register from the same file.
202
57
  | Good for | anything interactive | headless / CI |
203
58
  | Tools | identical | identical |
204
59
 
60
+
61
+ ### Hosted client setup: Perplexity and Cursor
62
+
63
+ For **Perplexity**, add a custom **remote MCP/connector** with
64
+ `https://tensor.levitating.org/mcp`. Choose **OAuth/Connect** when the client
65
+ offers it and complete Tensor's browser consent. For **Cursor**, add a **remote
66
+ MCP server** in Settings → Tools & Integrations / MCP using the same URL, then
67
+ choose Connect and complete consent. These are hosted configurations: do not
68
+ put `npx` or `TENSOR_API_KEY` in them.
69
+
70
+ An API key is an intentional fallback for a hosted client that cannot complete
71
+ OAuth: configure the scoped Tensor key as its Bearer/API-key credential. For a
72
+ local stdio client, use the configuration below; stdio is API-key-only and does
73
+ not participate in the hosted OAuth redirect flow.
74
+
205
75
  ## Configuration
206
76
 
207
77
  Set two environment variables:
@@ -216,7 +86,7 @@ Set two environment variables:
216
86
  ```bash
217
87
  TENSOR_API_KEY=ak_live_xxxxxxxxxxxx \
218
88
  TENSOR_BASE_URL=https://tensor.levitating.org \
219
- npx -y @levitating/tensor-mcp
89
+ npx -y @levitating/tensor-mcp@^5.2.0
220
90
  ```
221
91
 
222
92
  ## Claude Code integration
@@ -229,7 +99,7 @@ Add to your `~/.claude.json` or project `.claude.json`:
229
99
  "tensor": {
230
100
  "type": "stdio",
231
101
  "command": "npx",
232
- "args": ["-y", "@levitating/tensor-mcp"],
102
+ "args": ["-y", "@levitating/tensor-mcp@^5.2.0"],
233
103
  "env": {
234
104
  "TENSOR_API_KEY": "ak_live_your_key_here",
235
105
  "TENSOR_BASE_URL": "https://your-instance.example.com"
@@ -248,7 +118,7 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
248
118
  "mcpServers": {
249
119
  "tensor": {
250
120
  "command": "npx",
251
- "args": ["-y", "@levitating/tensor-mcp"],
121
+ "args": ["-y", "@levitating/tensor-mcp@^5.2.0"],
252
122
  "env": {
253
123
  "TENSOR_API_KEY": "ak_live_your_key_here",
254
124
  "TENSOR_BASE_URL": "https://your-instance.example.com"
@@ -260,17 +130,34 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
260
130
 
261
131
  ## Writes are permanent
262
132
 
263
- Three tools have consequences an MCP client cannot undo, and they are worth confirming with the user before calling:
133
+ Four tools have consequences an MCP client cannot undo. Confirm with the user
134
+ before calling them:
135
+
136
+ - **`create_transaction`**: the ledger is append-only. There is no update or delete for a transaction, because position state (quantity, average cost, cost basis, realized gain) is a non-invertible fold over it. A mistake is corrected by posting a *compensating* entry of the opposite type, never by editing.
137
+ - **`delete_position`**: hard-deletes the position together with its entire transaction ledger, valuation-event history, loan/fund terms, relations and attachments. To record an exit, use `sell_all_position` instead; that keeps the history.
138
+ - **`delete_bookmark_folder`**: destroys the folder row outright, and it is the one irreversible thing `tensor:bookmarks:write` grants. Nothing filed under it is lost (its bookmarks are unfiled and its sub-folders promoted, in one transaction), but the folder and the filing decision it recorded are gone, with no Trash behind it. It is the opposite of `delete_file_folder`, which refuses a non-empty folder; this one accepts one, so its reach is larger than the sibling it resembles.
139
+ - **`data_apply`**: writes a whole batch. Always `data_dry_run` first and read the preview.
264
140
 
265
- - **`create_transaction`** — the ledger is append-only. There is no update or delete for a transaction, because position state (quantity, average cost, cost basis, realized gain) is a non-invertible fold over it. A mistake is corrected by posting a *compensating* entry of the opposite type, never by editing.
266
- - **`delete_position`** — hard-deletes the position together with its entire transaction ledger, valuation-event history, loan/fund terms, relations and attachments. To record an exit, use `sell_all_position` instead; that keeps the history.
267
- - **`data_apply`** — writes a whole batch. Always `data_dry_run` first and read the preview.
141
+ Deletes on entities, accounts, assets and reference data are likewise
142
+ immediate and unrecoverable.
268
143
 
269
- Deletes on entities, accounts, assets and reference data are likewise immediate and unrecoverable. The work surfaces are deliberately softer: `delete_file`, `delete_idea` and `delete_todo` all move a row to a restorable Trash, and every permanent purge is UI-only. `delete_todo` replaced `archive_todo` in 2026-08, when Archive was removed from Todos — a rename with a real change behind it, and therefore a MAJOR bump. All three Trashes are the same in one way worth knowing: each empties itself 60 days after deletion, on one shared window and one sweeper. (This sentence used to name that as a difference between Todos and the other two; Files and Ideas joined the same sweep in 2026-08.) Still immediate: `delete_todo_state`, `delete_todo_tag` and `delete_file_folder` — each refuses while in use, but once through, there is no undo.
144
+ The work surfaces are deliberately softer. `delete_file`, `delete_idea`,
145
+ `delete_todo`, `delete_bookmark` and `delete_tab_group` move a row to a
146
+ restorable Trash, every permanent purge is UI-only, and every Trash empties
147
+ itself 60 days after deletion on one shared window and one sweeper. Still
148
+ immediate on those surfaces: `delete_todo_state`, `delete_todo_tag`,
149
+ `delete_file_folder` and `delete_tab` (one tab out of a live group; the group
150
+ is the recoverable unit, so a tab has no soft state of its own). The first
151
+ three refuse while in use; once through, there is no undo.
270
152
 
271
153
  ## Available Tools
272
154
 
273
- The tables below are the complete list. For the authoritative inventory at runtime — names, descriptions and full input schemas — send a `tools/list` JSON-RPC request after `initialize`. (Inside this repo, `listRegisteredToolNames()` in `tools.ts` derives the same list; prefer either over copying a count into prose, which is how this document once came to advertise six tools that did not match the registry.)
155
+ The tables below are the complete list. At runtime, the authoritative
156
+ inventory (names, descriptions and full input schemas) is a `tools/list`
157
+ JSON-RPC request after `initialize`; inside the Tensor repo,
158
+ `listRegisteredToolNames()` in `tools.ts` derives the same list. Neither this
159
+ file nor any other states a tool count, because a typed count is the first
160
+ thing to go stale.
274
161
 
275
162
  ### Rollups, quotes, sync & search
276
163
 
@@ -382,7 +269,7 @@ Bodies and comments are TipTap JSON, never HTML — the write tools take plain t
382
269
  | Tool | Scope | Description |
383
270
  |------|-------|-------------|
384
271
  | `list_todos` | `tensor:todos:read` | List todos with server-side filters (state, category, assignee, priority, tag, parent, linked record, search, `trash`) and sort. `assigneeId` and `tagId` take one id or several |
385
- | `get_todo` | `tensor:todos:read` | One todo: body, state, labels, links, sub-task counts. Links to records your key cannot read are omitted |
272
+ | `get_todo` | `tensor:todos:read` | One todo: body, state, canonical tags, links, sub-task counts. Links to records your key cannot read are omitted |
386
273
  | `get_todo_subtree` | `tensor:todos:read` | The branch under a todo — counts and depth, for naming what a delete or a re-parent takes with it |
387
274
  | `get_todo_activity` | `tensor:todos:read` | Activity feed, folded from the mutation audit log — a rolling 90-day window, not permanent history |
388
275
  | `create_todo` | `tensor:todos:write` + each `links` target's read scope | Create a todo (plain-text `body`, wrapped to TipTap JSON; `stateId` from `list_todo_states`). The optional `links` array takes the same target types as `attach_todo_link` — the six ledger records plus todo, idea and memo, never `file` — and a target your key cannot read fails the create with a `403` rather than being dropped |
@@ -433,6 +320,37 @@ The capture inbox. An idea's body is a TipTap document since 4.2.0 — plain tex
433
320
  | `attach_idea_link` | `tensor:ideas:write` + the target's read scope | Link the idea to a record — the six ledger records plus todo, idea and memo; files are the gallery, not a link (idempotent) |
434
321
  | `detach_idea_link` | `tensor:ideas:write` + the linked record's read scope | Remove one of the idea's links. Two kinds refuse with a `409` instead of being removed: a gallery attachment (wrong door for a photo) and a `mention` (the reconciler owns it — edit the prose) |
435
322
 
323
+ ### Bookmarks
324
+
325
+ The filed half of Web: pages somebody decided to keep, in a folder tree. `/api/bookmark-folders` is a SIBLING resource rather than a sub-path — one scope opens both. Delete is a restorable Trash; the purge is session-only. A duplicate URL is flagged (`duplicateOf`), never refused.
326
+
327
+ | Tool | Scope | Description |
328
+ |------|-------|-------------|
329
+ | `list_bookmarks` | `tensor:bookmarks:read` | The library in the order the owner arranged it: Unfiled first, then folder by folder down the tree. `folderId` is three-valued — an id, `'none'` for the unfiled, or omitted for everything — and `trash` gives the deleted rows |
330
+ | `get_bookmark` | `tensor:bookmarks:read` | One bookmark, with the `normalizedUrl` duplicate detection compares |
331
+ | `create_bookmark` | `tensor:bookmarks:write` | File a page. Only `url` is required; no folder means unfiled, which is a resting state |
332
+ | `update_bookmark` | `tensor:bookmarks:write` | Partial update — title, url, folder, excerpt, favicon. `folderId: null` unfiles |
333
+ | `delete_bookmark` | `tensor:bookmarks:write` | Move to Trash. Soft — restorable; the purge is UI-only |
334
+ | `restore_bookmark` | `tensor:bookmarks:write` | Restore, back into the folder it was filed in |
335
+ | `list_bookmark_folders` | `tensor:bookmarks:read` | The folder tree, parents before children and siblings in the owner's order — keep it rather than sorting by name |
336
+ | `create_bookmark_folder` | `tensor:bookmarks:write` | Create a folder, optionally nested |
337
+ | `update_bookmark_folder` | `tensor:bookmarks:write` | Rename or re-parent. A cycle or a depth ceiling refuses with `409` saying which |
338
+ | `delete_bookmark_folder` | `tensor:bookmarks:write` | Destroy the folder and nothing else: its bookmarks are unfiled, its sub-folders promoted. No undo — a folder is a filing decision, not a Trash surface |
339
+
340
+ ### Tab groups
341
+
342
+ Tabs parked from the browser extension, kept together and in order. Scoped SEPARATELY from bookmarks on purpose: a synced group is in effect a partial browsing history. The GROUP is the unit — there is no per-tab read, and no tab has a Trash of its own.
343
+
344
+ | Tool | Scope | Description |
345
+ |------|-------|-------------|
346
+ | `list_tab_groups` | `tensor:tabs:read` | Every group, hydrated with its tabs. Starred first, then newest first. `limit`/`offset` page the groups; a group's tabs are never truncated |
347
+ | `get_tab_group` | `tensor:tabs:read` | One group with its tabs in order |
348
+ | `create_tab_group` | `tensor:tabs:write` | Park 1–500 tabs as one group. One call carries the whole group — the rate limit makes per-tab posting unworkable |
349
+ | `update_tab_group` | `tensor:tabs:write` | `name`, `locked`, `starred` — and deliberately not the tabs, so "which tabs did I have" stays answerable from the audit trail |
350
+ | `delete_tab` | `tensor:tabs:write` | Remove one tab from a live group. Immediate; the group is the recoverable unit |
351
+ | `delete_tab_group` | `tensor:tabs:write` | Move the whole group to Trash. Soft — restorable; the purge is UI-only |
352
+ | `restore_tab_group` | `tensor:tabs:write` | Restore the group, tabs and all |
353
+
436
354
  ## Scopes
437
355
 
438
356
  Your API key needs the following Tensor scopes, attached when the key is created. Deny-by-default: a key with no scopes reaches nothing.
@@ -445,10 +363,14 @@ Your API key needs the following Tensor scopes, attached when the key is created
445
363
  | `tensor:reference:write` | Create/update/delete reference data |
446
364
  | `tensor:files:read` | Browse files and folders, read metadata and links, mint download URLs, and the export manifest |
447
365
  | `tensor:files:write` | Upload (presign + confirm), rename/move, folders, record links, soft-delete/restore |
448
- | `tensor:todos:read` | Read todos, subtrees, activity, comments, workflow states, labels and record links. A link row also needs its target type's own read scope; the attached-files list needs `tensor:files:read` outright |
449
- | `tensor:todos:write` | Create/update todos, soft-delete to Trash and restore, reorder/re-parent, comments, labels, states, attachments. Attaching or linking also needs the other end's read scope; the Trash purge and comment deletion are not reachable at all |
366
+ | `tensor:todos:read` | Read todos, subtrees, activity, comments, workflow states, canonical tags and record links. A link row also needs its target type's own read scope; the attached-files list needs `tensor:files:read` outright |
367
+ | `tensor:todos:write` | Create/update todos, soft-delete to Trash and restore, reorder/re-parent, comments, canonical tags, states, attachments. Attaching or linking also needs the other end's read scope; the Trash purge and comment deletion are not reachable at all |
450
368
  | `tensor:ideas:read` | Read the ideas stream, tag/site rails, comments and record links. **Not media URLs on their own** — an idea's media is a file row and that route releases its decryption key, so `get_idea_media_url` needs `tensor:files:read` as well |
451
369
  | `tensor:ideas:write` | Capture/update ideas, soft-delete to Trash and restore, comments, media uploads and record links. A link write also needs the target's read scope; the Trash purge and comment deletion are not reachable at all |
370
+ | `tensor:bookmarks:read` | Read filed bookmarks and the bookmark folder tree. The tree is a sibling resource of `/api/bookmarks`, not a sub-path, and this one scope opens both |
371
+ | `tensor:bookmarks:write` | Create/update bookmarks, move them between folders, folder create/rename/re-parent/delete, soft-delete to Trash and restore. The purge is not reachable at all |
372
+ | `tensor:tabs:read` | Read tab groups and the tabs inside them. **Separate from `tensor:bookmarks:read` on purpose** — a synced group is in effect a partial browsing history, so a key issued to read the pages you filed does not also read every page you parked |
373
+ | `tensor:tabs:write` | Create a group with its tabs, rename/lock/star, remove a tab, soft-delete a group to Trash and restore it. The purge is not reachable at all |
452
374
  | `tensor:data:read` | Retrieve a persisted dry-run batch |
453
375
  | `tensor:data:dry_run` | Run data pipeline dry-runs |
454
376
  | `tensor:data:apply` | Apply data pipeline operations |
@@ -457,3 +379,199 @@ Your API key needs the following Tensor scopes, attached when the key is created
457
379
  `search_records` needs no scope of its own — each result lane requires that domain's read scope, lanes the key does not cover are silently omitted, and a key covering no lane gets 403.
458
380
 
459
381
  The Tensor user who issued the key is the ceiling: a key can never do more than that user could do in the browser.
382
+
383
+ ## Changelog
384
+
385
+ Newest first. A tool rename or removal is a MAJOR bump; new tools and new optional inputs are MINOR (`docs/contract/MCP.md` §6).
386
+
387
+ ### 5.2.0 — Income settles as cash or in kind
388
+ No new tool and no breaking change. `create_transaction` gains the `coupon`
389
+ type and an optional `settlement` input (`cash` | `in_kind`) for the three
390
+ income types, which now follow one rule under three names. Cash income books
391
+ realized gain on the paying position and moves no units. In-kind income adds
392
+ the units received at a cost per unit (`price`), normally 0, so free units
393
+ lower the average cost and show as unrealized gain; the position keeps its
394
+ market price. A call without `settlement` means what it meant in 5.1 — a
395
+ dividend books income, an interest row adds units — so nothing installed
396
+ changes meaning. `repayment_received` now books the part that pays off accrued
397
+ interest as realized income, interest first.
398
+
399
+ ### 5.1.0 — Web: bookmarks and tab groups
400
+ Seventeen new tools, no breaking change. The Web surface — bookmarks filed into
401
+ a folder tree, and tab groups parked from the browser extension — has had
402
+ tables, REST routes, scopes and an OpenAPI contract since it shipped, and had
403
+ none of them here.
404
+
405
+ Bookmarks: `list_bookmarks`, `get_bookmark`, `create_bookmark`,
406
+ `update_bookmark`, `delete_bookmark`, `restore_bookmark`, and the folder tree
407
+ with `list_bookmark_folders`, `create_bookmark_folder`,
408
+ `update_bookmark_folder`, `delete_bookmark_folder`.
409
+
410
+ Tab groups: `list_tab_groups`, `get_tab_group`, `create_tab_group`,
411
+ `update_tab_group`, `delete_tab`, `delete_tab_group`, `restore_tab_group`.
412
+
413
+ Two new scopes, and they are separate on purpose: `tensor:bookmarks:read` /
414
+ `:write` and `tensor:tabs:read` / `:write`. A synced tab group is in effect a
415
+ partial browsing history, so a key issued to read the pages you deliberately
416
+ filed must not also read every page you merely parked. Existing keys carry
417
+ neither and reach neither — attach them when you create the key.
418
+
419
+ Both deletes are soft and both restores are here. Neither permanent purge is,
420
+ on the rule every work surface shares: a key may fill a Trash and only a person
421
+ may empty one.
422
+
423
+ ### 5.0.0 — Todo labels are Todo tags
424
+ Breaking tool-name change. Todos and Ideas now use Tensor's canonical tag
425
+ catalog and assignments. Todo reads return `tags` and `tagIds`, and Todo tag
426
+ writes use the same records that the web app, REST API, filters and settings
427
+ use.
428
+
429
+ Rename calls by replacing `set_todo_labels` with `set_todo_tags`,
430
+ `list_todo_labels` with `list_todo_tags`, `create_todo_label` with
431
+ `create_todo_tag`, `update_todo_label` with `update_todo_tag`, and
432
+ `delete_todo_label` with `delete_todo_tag`.
433
+
434
+ There are no MCP aliases for the old tool names. Update any prompt, script or
435
+ saved workflow that calls a tool by name. Hosted HTTP clients only need to
436
+ refresh or reconnect so they fetch the latest tool catalog. Local stdio clients
437
+ must update to `@levitating/tensor-mcp@^5.0.0` and restart the client.
438
+
439
+ The underlying REST label routes remain deprecated compatibility adapters, but
440
+ new integrations should use `PUT /api/todos/:id/tags` with `{ "tagIds": [] }`.
441
+ MCP tools never write `tag_catalog` or `tag_assignments` directly: the REST
442
+ handlers validate scope and target type, then perform the canonical catalog and
443
+ assignment writes transactionally.
444
+
445
+ ### 4.4.0 — `browse_files` can say what order it wants
446
+ Additive, one optional input. `browse_files` takes **`sort`**, one of
447
+ `modified_desc` / `modified_asc` / `added_desc` / `added_asc` / `name_asc` /
448
+ `name_desc` / `size_desc` / `size_asc`. The default is `added_desc` — newest
449
+ first, exactly what every previous release returned. Nothing is renamed, nothing
450
+ is removed, no scope changes, and a call that omits it behaves as before.
451
+
452
+ It closes the last gap where Tensor's Files page could do something an agent
453
+ could not. The four columns are the page's own — `modified` is `updated_at`,
454
+ `added` is `created_at`, `name` is the display title and `size` is the
455
+ **plaintext** length, so an encrypted file sorts by what it is rather than by
456
+ its envelope's overhead. One name carries both the column and the direction
457
+ because the server looks the value up in a closed map of `ORDER BY` fragments;
458
+ a direction sent separately would only be composed back into that key.
459
+
460
+ **It is a server-side order, and that is the point.** The listing is capped
461
+ (default 500), so re-sorting a page in the client orders the window rather than
462
+ the library — "the ten biggest files" computed that way is the ten biggest of
463
+ the five hundred most recent. Every order also ends in the file id, so paging
464
+ with `limit`/`offset` cannot show one row twice and skip another.
465
+
466
+ Two things worth knowing before you trust an ordering: names sort by the
467
+ database's collation rather than a natural sort, so `Q10` comes before `Q9`; and
468
+ an unrecognised value is ignored rather than refused — ordering is not a filter,
469
+ so a bad one costs the default order and never an error.
470
+
471
+ ### 4.3.0 — `list_ideas` can say what order it wants
472
+ Additive, one optional input. `list_ideas` takes **`sort`**: `newest` (the
473
+ default, and what every previous release did), `oldest`, `updated` (recently
474
+ edited first) or `title` (A-Z). Nothing is renamed, nothing is removed, no scope
475
+ changes, and a call that omits it behaves exactly as before.
476
+
477
+ It closes a gap rather than adding a capability: Tensor's own Ideas stream has
478
+ offered these four orders for as long as the arrangement work has been in, and
479
+ `GET /api/ideas?sort=` has parsed them the whole time — the tool simply had no
480
+ way to ask, so anything an agent wanted in a different order had to be paged out
481
+ in full and re-sorted locally, which for a capped listing quietly answers the
482
+ wrong question. `list_todos` has had its own `sort` since it shipped; this is
483
+ that shape one noun over.
484
+
485
+ **There is deliberately no `manual`.** A todo carries a fractional rank key and
486
+ can be hand-placed; an idea has no such column, and an inbox is not something
487
+ anyone arranges by hand. An unrecognised value is ignored rather than refused —
488
+ ordering is not a filter, so a bad one costs you the default order and never an
489
+ error.
490
+
491
+ ### 4.2.0 — an idea's body is a document
492
+ Additive, and the wire did not change shape. An idea's body used to be a plain
493
+ `TEXT` column; it is a TipTap document now, the same as a memo's body and the
494
+ same as an idea's own comments, so an idea can hold an **inline image**.
495
+
496
+ `body` still goes in as plain text and still comes back as plain text — Tensor
497
+ wraps what you send into a document (one paragraph per line) and derives `body`
498
+ back out of it for search and previews. Reads gain `bodyJson`, the document
499
+ itself; it is `null` on a capture written before this release that has not been
500
+ edited since, which means "`body` is the whole of it". Nothing is renamed,
501
+ nothing is removed and no scope changes, so no installed client and no issued
502
+ key is affected.
503
+
504
+ **An agent cannot put an image INSIDE the prose, and that is deliberate.** These
505
+ tools take `body` as text and there is no `bodyJson` input: publishing the
506
+ editor's node shape as a tool input would freeze an internal name into a
507
+ permanent major-bump obligation, and hand-built ProseMirror JSON is the most
508
+ likely thing to arrive unopenable. The capability you actually want — "give this
509
+ idea a picture" — is the **gallery**, and it is the same file row an inline
510
+ image points at: `create_idea_upload_url` → PUT the bytes → confirm the
511
+ `storageKey` in `media`. A URL or a markdown image typed into `body` is stored
512
+ as the literal text you typed.
513
+
514
+ **Two things to know before you write one.** Sending `body` REPLACES the whole
515
+ document, inline images included — that is the honest reading of "set the body
516
+ to this text", and it is worth a read of the idea first if you did not write it.
517
+ The image is not destroyed: an inline image *is* a file row in the idea's
518
+ gallery, so it survives there and only stops appearing in the prose. And `body`
519
+ is now capped at 256000 characters, the ceiling todos, memos and comments have
520
+ always had; a longer body is refused at the edge rather than stored and then
521
+ failing to open.
522
+
523
+ ### 4.1.0 — an idea's record links
524
+ Additive. Three new tools — **`list_idea_links`**, **`attach_idea_link`**,
525
+ **`detach_idea_link`** — plus a `targetType`/`targetId` filter on `list_ideas`.
526
+ Nothing is renamed, nothing is removed and no scope changes, so every installed
527
+ client keeps working and no key needs re-issuing.
528
+
529
+ What it closes is an asymmetry rather than a gap in Tensor: `links` is
530
+ undirected and a todo could already be linked to an idea through
531
+ `attach_todo_link`, so an agent could file work against an idea and had no way
532
+ to file an idea against anything. Tensor's own web app made those links through
533
+ a session-only route, which is why nothing was broken and why no key could do
534
+ it.
535
+
536
+ They carry the same two-scope rule as their todo and file counterparts — the
537
+ surface's own scope plus the link target's read scope, reads narrowing silently
538
+ and writes answering `403` — and the same one-door rule about attachments: an
539
+ idea's files are its **gallery** (`get_idea` → `media`), `attach_idea_link` will
540
+ not take `file`, and `detach_idea_link` refuses a gallery link id with a `409`
541
+ instead of quietly removing a photo.
542
+
543
+ ### 4.0.0 — Archive removed from Ideas
544
+ Ideas follows Todos. **`list_ideas` loses `archived`** and **`update_idea` loses
545
+ the `archived` field**; Delete is the only way to take a capture out of the
546
+ stream, it is soft, and the row lands in a Trash that empties itself 60 days
547
+ later. `delete_idea` and `restore_idea` are unchanged and already did exactly
548
+ this.
549
+
550
+ No tool was renamed and no scope changed, so **no key needs re-issuing** — but a
551
+ saved prompt or script that passes `archived` to either tool stops archiving,
552
+ and that is what makes it major. Both were REMOVED rather than accepted and
553
+ ignored: a read filter that quietly stops filtering only widens a result set,
554
+ while a write that quietly does nothing reports success for work it did not do.
555
+
556
+ Tensor's HTTP API keeps `?archived` on `GET /api/ideas` as an inert parameter
557
+ for the same read-side reason, so a raw HTTP caller sees the whole stream rather
558
+ than an error. `PATCH /api/ideas/:id` refuses an `archived` field outright.
559
+
560
+ ### 3.0.0 — Archive removed from Todos
561
+ `archive_todo` is gone; **`delete_todo`** replaces it. The rename carries a real change: the old tool archived a todo (a permanent resting place, no expiry), and the new one soft-deletes it to a Trash that **empties itself 60 days after deletion**. `restore_todo` still undoes it, and now takes `withAncestors` for the case where an ancestor is also in Trash. `list_todos` loses `includeArchived` / `archivedOnly` and gains `trash`.
562
+
563
+ No scope changed and **no key needs re-issuing** — `tensor:todos:write` covers both — but a saved prompt or script that calls `archive_todo` by name stops resolving, which is what makes this major. There is deliberately no purge tool and no empty-Trash tool: those are session-only in Tensor, and a tool whose every call returns 403 would be a promise this server cannot keep.
564
+
565
+ ### 2.1.0 — todos, ideas, and full files access
566
+ Tensor opened its work surfaces to API keys (2026-08), and this server grew tools for all three: todos (with workflow states and canonical tags), the ideas capture inbox, and full file management alongside the existing export manifest. Additive only — every existing tool, name and scope is untouched, so installed clients keep working. The new tools need the new scopes (`tensor:todos:read/write`, `tensor:ideas:read/write`, `tensor:files:write` — see the table below) attached to your key when it is issued or re-issued.
567
+
568
+ ### 2.0.0 — Documents renamed to Files
569
+ Tensor's **Documents** feature was renamed to **Files** (2026-08), all the way down: tables, routes, scope and tool names. For an MCP client that means:
570
+
571
+ | What | Was | Now |
572
+ | ---- | --- | --- |
573
+ | Tool name | `list_documents` | `list_files` |
574
+ | Scope on the key | `tensor:documents:read` | `tensor:files:read` |
575
+ | Endpoint behind it | `GET /api/documents/manifest` | `GET /api/files/manifest` |
576
+
577
+ There is no alias and no deprecation window — the old names are gone. **Existing API keys carrying `tensor:documents:read` must be re-issued with `tensor:files:read`**, and any prompt, script or saved workflow that calls `list_documents` by name has to be updated. Everything else in the tool set is unchanged.