@mosadd/mcp 3.0.0-alpha.7 → 3.0.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 (66) hide show
  1. package/CHANGELOG.md +410 -0
  2. package/README.md +79 -40
  3. package/dist/bin/mcp.js +132 -8
  4. package/dist/chunk-VMMJJYXF.js +4233 -0
  5. package/dist/index.d.ts +110 -6
  6. package/dist/index.js +3 -1
  7. package/package.json +19 -16
  8. package/src/__tests__/blob-upload.test.ts +93 -0
  9. package/src/__tests__/channel-e2ee.test.ts +62 -0
  10. package/src/__tests__/cli.test.ts +47 -0
  11. package/src/__tests__/flota-jawnie.test.ts +244 -0
  12. package/src/__tests__/golden-path.test.ts +4 -2
  13. package/src/__tests__/integration.test.ts +50 -11
  14. package/src/__tests__/knowledge-ingest.test.ts +114 -0
  15. package/src/__tests__/label-room-owner.test.ts +22 -0
  16. package/src/__tests__/mdm-e2ee.test.ts +35 -1
  17. package/src/__tests__/mdm-mcp-readable.test.ts +390 -0
  18. package/src/__tests__/mirc-invite.test.ts +112 -0
  19. package/src/__tests__/mrag-search-answer.test.ts +42 -0
  20. package/src/__tests__/no-dead-host.test.ts +37 -0
  21. package/src/__tests__/presence.test.ts +199 -0
  22. package/src/__tests__/server.test.ts +11 -7
  23. package/src/__tests__/serverJsonVersion.test.ts +45 -0
  24. package/src/__tests__/tool-count-consistency.test.ts +259 -0
  25. package/src/__tests__/voice-fields.test.ts +24 -0
  26. package/src/bin/mcp.ts +71 -6
  27. package/src/cli.ts +100 -0
  28. package/src/crypto/channel-e2ee.ts +288 -0
  29. package/src/crypto/mdm-session.ts +476 -37
  30. package/src/index.ts +2 -2
  31. package/src/providers/blob-upload.ts +162 -0
  32. package/src/providers/supabase-dm.ts +102 -7
  33. package/src/providers/supabase-voice.ts +13 -1
  34. package/src/providers/supabase.ts +121 -10
  35. package/src/server.ts +102 -12
  36. package/src/tools/__tests__/ragDeleteFoldsSourceId.test.ts +67 -0
  37. package/src/tools/actions.ts +166 -0
  38. package/src/tools/attachments.ts +276 -0
  39. package/src/tools/capabilities.ts +2 -0
  40. package/src/tools/channel-payload.ts +69 -0
  41. package/src/tools/embed.ts +110 -0
  42. package/src/tools/index.ts +136 -6
  43. package/src/tools/knowledge-graph.ts +186 -0
  44. package/src/tools/knowledge.ts +351 -191
  45. package/src/tools/mail-agentbox.ts +155 -0
  46. package/src/tools/mail-aliases.ts +25 -0
  47. package/src/tools/mail-provenance.ts +137 -0
  48. package/src/tools/mail.ts +214 -60
  49. package/src/tools/mdm-as-agent.ts +138 -0
  50. package/src/tools/mdm-voice.ts +17 -3
  51. package/src/tools/mdm.ts +303 -57
  52. package/src/tools/mirc-edge.ts +8 -2
  53. package/src/tools/mirc-members.ts +130 -20
  54. package/src/tools/mirc-messages.ts +80 -35
  55. package/src/tools/mirc.ts +149 -11
  56. package/src/tools/mroom-messages.ts +4 -12
  57. package/src/tools/mtalk.ts +11 -1
  58. package/src/tools/murl.ts +314 -0
  59. package/src/tools/presence.ts +442 -0
  60. package/src/tools/ptt-ingest.ts +99 -0
  61. package/src/tools/threat.ts +123 -0
  62. package/src/tools/voice-format.ts +43 -0
  63. package/src/types.ts +36 -0
  64. package/src/version.ts +8 -0
  65. package/LICENSE +0 -201
  66. package/dist/chunk-EFTB743G.js +0 -1924
package/CHANGELOG.md ADDED
@@ -0,0 +1,410 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@mosadd/mcp` are documented here.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project follows [Semantic Versioning](https://semver.org/). The `3.0.0-alpha.N` pre-releases led up to the stable 3.0.0.
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [3.0.0] — 2026-11-16
11
+
12
+ The first stable release of the 3.0 line. Same tools as `3.0.0-alpha.59`: default host `https://api.mosadd.com`, `mRAG_search` with `answer`. `latest` on npm now points here; install with `npx -y @mosadd/mcp`.
13
+
14
+ ## [3.0.0-alpha.59] — 2026-11-16
15
+
16
+ ### Added
17
+ - **`mRAG_search` accepts `answer: boolean`** (default `false`). It is forwarded to `rag-query`: by default the tool returns the ranked sources only; pass `answer: true` to also get a generated answer grounded in them.
18
+
19
+ ### Fixed
20
+ - **Default backend host.** `MOSADD_API_KEY` login (`hub-key-exchange`) and the mail-provenance / mIRC edge defaults pointed at the retired cloud `rooffhgbxafyjcwmwpsy.supabase.co`, which no longer answers. They now default to `https://api.mosadd.com` (`MOSADD_HUB_URL` still overrides). A test fails if any source file carries the old host again.
21
+
22
+ ## [3.0.0-alpha.58] — 2026-11-16
23
+
24
+ ### Added
25
+ - **CLI:** `npx @mosadd/mcp --version`, `--help` and `tools` print (version, commands + env vars, all tools grouped by module) and exit instead of starting the stdio server.
26
+
27
+ ### Fixed
28
+ - The "ready" log line now reports the `package.json` version (it said `3.0.0-alpha.0`).
29
+
30
+ ## [3.0.0-alpha.57] — 2026-11-15
31
+
32
+ ### Fixed
33
+ - **`mTALK_open {label}` opens a room you own.** The room id is now `mosadd-room-<your identity id>-<label>`;
34
+ you and your accepted contacts can join it, a stranger cannot (before: one shared `mosadd-room-<label>` for every
35
+ account, refused to everyone, including its creator).
36
+ - **`mDM_list` returns voice notes with their transcript and recording.** Voice/PTT messages carry
37
+ `voice: { transcript, audio_url, duration_ms }` (signed URL, read with the caller's own permissions) instead of a
38
+ bare caption.
39
+
40
+ ## [3.0.0-alpha.56] — 2026-11-10
41
+
42
+ ### Added
43
+ - **`mDM_send_as_agent` `thread_label?`** (LINEAR-6577) — same optional label alphabet as
44
+ `mDM_send` (`[a-zA-Z0-9._-]`, 1–120). Omit = MAIN unlabeled thread (ops lock for SOVEREIGN/King
45
+ until rename/UI merge). A new label opens a new `dm:A:B:label` thread.
46
+
47
+ ## [3.0.0-alpha.55] — 2026-09-29
48
+
49
+ ### Fixed
50
+ - **Channel/room reader: the King's posts read as text, not `<ciphertext>`** (ZERO SZYFROWANIA,
51
+ rozkaz Krola 28.09). `mIRC_list_messages` and `mROOM_list_messages` understood only a JSON
52
+ `mosadd.chat.v1` envelope and stamped everything else `<ciphertext>` — including every post
53
+ the app writes (plain UTF-8 in base64, `ircApi.ts encodePayload`) on the OPEN, keyless #adm and
54
+ #command (measured 28–29.09: f159c8d7, 776b3e9a). New shared decoder `tools/channel-payload.ts`
55
+ (same rule as `mdm.ts unpackPayload` and the mKEEPER bridge `decodePayload.mjs`): envelope →
56
+ its `text`; plain UTF-8 → the text; other JSON (voice `{audio, mime, dur}`) → raw, so
57
+ `formatVoiceIfAny` shapes it (mROOM now too). `<ciphertext>` stays ONLY for a sealed envelope
58
+ the line cannot open — group-key `{iv, ciphertext, hmac}` without the key, `mosadd.e2ee.*` —
59
+ and for bytes that are not UTF-8 text.
60
+ - **`mDM_send`: conversations with fleet lines and with the King always in the clear.** Besides
61
+ an agent line on either side (alpha.54), a note to SELF (`to === selfId`) now goes plain too
62
+ (MCP sessions on the King's key sealed his own thread; `message-send` refuses envelopes there
63
+ with `fleet_plaintext_only`). The result carries `reason: "fleet_plaintext"` (plain) or
64
+ `"human_to_human"` (E2EE). Person↔person stays X3DH + Double Ratchet, unchanged.
65
+ - **Tool descriptions:** `mDM_send_unencrypted` is no longer "DEPRECATED / prefer mDM_send / will
66
+ be removed" — that text steered every LLM line to the sealing tool. Both DM send tools now say:
67
+ conversations with fleet lines and with the King are ALWAYS in the clear.
68
+ - Lock `src/__tests__/flota-jawnie.test.ts` (13 tests): red on alpha.54 (7/13, the King's text →
69
+ `<ciphertext>`), red under five sabotages of the new rules, green after.
70
+
71
+ ## [3.0.0-alpha.54] — 2026-09-27
72
+
73
+ ### Fixed
74
+ - **`mDM_send` — readable on EVERY key of the identity, and never a false reason in the app**
75
+ (correction of alpha.53 after independent verification, LINEAR-6089 follow-up). alpha.53 seeded
76
+ the mDM identity from ONE API key and let an agent line (re)publish it. An identity holds many
77
+ keys (each OAuth connector mints its own; measured 27.09: general@ has 8 active, 7 of 17 agent
78
+ identities have several), so the key directory flapped between per-key identities: a `s1.`
79
+ copy opened only under the key that wrote it, and `r1.` copies stopped opening for the
80
+ recipient after the next send from another key. alpha.53 also typed sends on a PERSON's key
81
+ `txt` with a `s1.` copy the app can never open, so the app told the owner a false reason
82
+ ("sent from another device" / "unlock your identity") instead of "sent by MCP".
83
+ - **Agent lines send in the clear** — the King's rule of 20.09 (no E2EE for lines<->lines,
84
+ lines<->King, human->line), the same rule the app applies (`peerIsAgent`). When the sender
85
+ or the recipient is `kind = 'agent'`, `mDM_send` writes plain UTF-8, type `txt`, and never
86
+ touches the key directory. Every key of the line and the recipient's app on every device read
87
+ it. Result field `mode: "plaintext_agent_lane"`, `encrypted: false`.
88
+ - **Human<->human stays E2EE**, but on a person's key MCP never writes their key directory
89
+ automatically (neither over the app's bundle nor on an empty directory), writes no `s1.`
90
+ copy, and types the envelope `text`, which the app reads as "sent by MCP, no copy for this
91
+ device". A note-to-self is sealed to the app's bundle and opens in the app.
92
+ - **`mDM_publish_keys` no longer overwrites a person's app bundle** (`published: false`,
93
+ `identity: "foreign"`, with a note). It may fill an empty directory. Agent lines may still
94
+ publish explicitly.
95
+ - **`autoPublishKeys`** (stdio) follows the same policy (`bundlePolicyForKind`): agent lines and
96
+ people write nothing; other lanes (radio) publish on an empty directory as before.
97
+ - New `SupabaseDmProvider.peerKind(id)`; `ensureOwnBundlePublished` takes a `BundlePolicy` and
98
+ can return `"absent"`.
99
+
100
+ ## [3.0.0-alpha.53] — 2026-09-27
101
+
102
+ ### Fixed
103
+ - **`mDM_send` — the envelope is born READABLE, for the sender and for the recipient**
104
+ (follow-up to LINEAR-6089). Measured on prod 27.09: every DM sent through the hosted gateway
105
+ was sealed by a brand-new random identity (a fresh `InMemoryMdmKeyStore` per HTTP request),
106
+ carried no `self_payload` / `recipient_self_payload`, and was typed `text`. The sender could
107
+ never read its own message again; the recipient only through a live ratchet session.
108
+ - **One identity per login secret.** With an API key the mDM identity is derived from it by
109
+ HKDF (`SeededMdmKeyStore`, labels identical to the app's `deriveOwnMaterialFromSeed`: zero
110
+ one-time prekeys, signed-prekey id 1). Every gateway instance, call and restart = same keys.
111
+ - **The key directory agrees with it** (`ensureOwnBundlePublished`): empty → publish; an
112
+ AGENT line with a stale bundle → replace; a PERSON's app-anchored bundle → never overwritten
113
+ (the send still works, only the recipient copy is skipped). `autoPublishKeys` uses the same
114
+ policy instead of a blind publish.
115
+ - **`self_payload`** ("s1.", AES-GCM under the seed's self-read key) and
116
+ **`recipient_self_payload`** ("r1.", AES-GCM under HKDF(ECDH(sender IK, recipient IK))) —
117
+ the app's exact formats, so `mDM_list` on any process and the app on any device open them.
118
+ - **`message_type: "txt"`** (the app's type; `text` is legacy) for `mDM_send` and
119
+ `mDM_send_unencrypted`.
120
+ - `mDM_list` opens own messages from `self_payload` and incoming ones from
121
+ `recipient_self_payload` before touching the ratchet.
122
+ - `mDM_send` result gains `sender_copy`, `recipient_copy`, `identity` (additive).
123
+ - `server.json` version drifted to alpha.51 while the package was alpha.52; both now alpha.53.
124
+
125
+ ## [3.0.0-alpha.33] — 2026-08-11
126
+
127
+ **The republish that closes a three-week gap between the repo and the client's disk.**
128
+ `3.0.0-alpha.32` was published 2026-07-19 and every change since then lived only in git.
129
+ Measured on the published tarball that day: it registers **71** tools while its own npm
130
+ description advertises **69** and the website advertises **77**. Three numbers, one
131
+ package. This release makes the published artifact the thing the docs describe.
132
+
133
+ ### Added
134
+ - **`mAYL_send_as_agent`** re-registered (2026-07-29) after the hub-claim → mp0st-send
135
+ chain was proven on an authenticated call.
136
+ - **`mTALK_ingest_ptt`** re-registered (2026-07-29) after the ingest path was repointed
137
+ at `rag-transcribe` and returned a real `200 {"queued":true}` on prod.
138
+ - **`mAYL_agentbox_provision` / `_list` / `_extend` / `_release`** (2026-08-06,
139
+ LINEAR-5201) — an agent mints, lists, extends and releases its OWN two-way disposable
140
+ inbox (`agent-<hex>@mosadd.com`). `create_inbox` parity with AgentMail, on our stack.
141
+ - **`mRAG_graph_refresh` / `_overview` / `_neighbors` / `_timeline`** (2026-08-11) — the MCP
142
+ door onto the per-user knowledge graph (`kg_*` RPCs). Search finds text; these walk who/what/
143
+ when (parties, connections, dated timelines), built from message METADATA only, never bodies.
144
+ - Stdio hub-key auth (`MOSADD_API_KEY`) in `src/bin/mcp.ts` — the local stdio server can
145
+ exchange a hub key instead of requiring the BYOK env trio.
146
+
147
+ Tool count **71 → 81**: six tools existed in the repo but had **never been published**
148
+ (71 → 77 — an agent installing `@mosadd/mcp` got 71 while every doc surface promised 77),
149
+ AND four new `mRAG_graph_*` knowledge-graph traversal tools were added 2026-08-11 (77 → 81).
150
+ `TOOL_COUNT` (`= allTools.length`) stays the single source of truth.
151
+
152
+ ### Changed
153
+ - **`mRAG_search` can now filter on the source types the writers actually stamp.**
154
+ The `source_types` enum was missing `file` and `ptt` — `file` is what `mRAG_ingest`
155
+ itself writes (its default, and where `note` ingests are mapped), `ptt` is what
156
+ `mTALK_ingest_ptt` writes. Measured on prod 2026-08-11: 63 indexed rows were
157
+ unreachable by any `source_types` filter. The tool advertised a filter that could not
158
+ see its own writes.
159
+ - **`mURL_create` no longer promises a status it does not set.** `murl-manage` applies
160
+ `status` only on the INSERT of a new row; on an existing channel it writes owner +
161
+ branding and leaves status untouched. Since mURL rooms auto-create on first activity,
162
+ "already exists" is the COMMON case — so the old "set initial status" wording was
163
+ wrong nearly every time it was read. Schema + description now say so and point at
164
+ `mURL_update`.
165
+ - **`mIRC_post_message` encryption wording.** It posts server-readable plaintext base64
166
+ on EVERY access mode, private and password channels included; the app's group-key
167
+ encryption is not something the toolkit holds a key for.
168
+
169
+ ### Fixed
170
+ - Doc surfaces across the repo that hand-typed **73** while `TOOL_COUNT` was 77 (README
171
+ breakdown, `packages/mcp/README.md`, `apps/mcp-http/README.md`, dev docs, Realm,
172
+ examples). The anti-drift vitest gate pinned one regex per file, so a single corrected
173
+ line kept the gate green while the sentence around it stayed wrong — the gate now pins
174
+ the PER-MODULE numbers too, not just the total.
175
+
176
+ ## [3.0.0-alpha.32] — 2026-07-19
177
+
178
+ ### Added
179
+ - **`mIRC_discover`** — browse the PUBLIC channel directory (open channels whose
180
+ owners set `discoverable=true`). Filter by name, paginated; join a result with
181
+ `mIRC_join` (open = one-click). Private/password/partner channels never appear.
182
+ - **`mIRC_report`** — report a channel for abuse/moderation (routes to the shared
183
+ `content_reports` store as `channel:<id>`), the moderation floor for public discovery.
184
+ - **`discoverable`** flag on `mIRC_create` / `mIRC_update` (honoured only for
185
+ `access_mode=open`), plus `voice` + `files` added to the capabilities enum.
186
+ - Tool count **69 → 71** (mIRC **22 → 24**); `TOOL_COUNT` (`= allTools.length`) stays
187
+ the single source of truth.
188
+
189
+ ### Changed
190
+ - **Encryption posture wording corrected across docs.** `mIRC_post_message` posts a
191
+ **server-readable** plaintext payload — the per-channel group-key TEXT E2EE is the
192
+ mosadd.com **app** (supported clients), not the toolkit (parity is the next crypto
193
+ milestone). Tool descriptions, README, MANIFESTO, e2ee-posture and the registry
194
+ copy now state this instead of implying private/password channels are E2EE via the
195
+ toolkit. Voice/PTT is always server-relayed (LiveKit SFU, DTLS-SRTP hop-by-hop).
196
+
197
+ ## [3.0.0-alpha.31] — 2026-07-17
198
+
199
+ ### Fixed
200
+ - **`mURL_create` / `mURL_update` branding validation.** The `branding` arg used
201
+ `z.record(z.any())` — the Zod v3 single-argument form — which fails typecheck under
202
+ this project's Zod v4, where `z.record` requires both a key and a value schema. Now
203
+ `z.record(z.string(), z.any())`. alpha.30 shipped with the pre-fix source; alpha.31
204
+ corrects it so the published package builds clean and validates branding correctly.
205
+ - **CI green (repo).** Synced the version refs (`server.json`, `server.ts` serverInfo,
206
+ `marketplace.json`) to `package.json`, and updated the MCP smoke test to expect
207
+ `mAYL_send` — the `mp0st_*` aliases were retired in alpha.28.
208
+
209
+ ## [3.0.0-alpha.30] — 2026-07-17
210
+
211
+ ### Added
212
+ - **`comms_embed_create` RE-REGISTERED — tool count 68 → 69.** The paste-in
213
+ live-channel widget is finally end-to-end real: `https://embed.mosadd.com/v1.js`
214
+ is deployed (served by the mosadd Vercel project; skins are inlined in the
215
+ bundle), and the whole backend (`embed-keys` publishable keys, `mirc-embed-token`
216
+ Origin-allowlisted 5-min JWTs with MAT plan tiers, `embed-plan-settings` PAYG,
217
+ GDPR `embed-dsr-delete`) was already live. The tool mints an `m_pk_live_…` key
218
+ and returns a `<script>` snippet with skin + position (incl. sidebar-left/right)
219
+ options. Part of the mURL→mIRC rework P3 ("open WWW channel: dedicated page +
220
+ branding + embed").
221
+
222
+ ## [3.0.0-alpha.29] — 2026-07-17
223
+
224
+ ### Added
225
+ - **mURL owner-side management — 3 new tools.** `mURL_create` (claim a domain channel and
226
+ become its owner; idempotent, 409 if another account owns it), `mURL_update` (set branding /
227
+ mark `claimed` / `blocked` to close / reopen as `open`), `mURL_delete` (remove a channel you
228
+ own). Wired to the deployed, owner-scoped `murl-manage` EF via the same user-JWT auth as
229
+ `mURL_list_channels action='mine'`. mURL goes from read-only (read/post/presence/list) to a
230
+ full lifecycle — an agent can now provision and manage a domain's room, not just chat in it.
231
+ - **`TOOL_COUNT` export** (`= allTools.length`) — one source of truth for the callable-tool
232
+ count, mirroring `@mosadd/threat-engine`'s `THREAT_EVENT_COUNT`. Docs reference it, not a
233
+ hand-typed number that drifts.
234
+
235
+ ### Changed
236
+ - **Tool count corrected to 68** — it had been advertised inconsistently as "70+" / "65" across
237
+ READMEs, docs, registry submissions and the dev site. The registry holds exactly 68 callable
238
+ tools: mDM 14 · mIRC 22 · mURL 7 · mAYL 11 · mTALK 5 · mRAG 4 · comms_ 3 · Irondome (`threat_*`) 2.
239
+ Also fixed two stale claims in the reference table: `threat_*` IS registered (was labelled
240
+ "unregistered"), and the `mp0st_*` mAYL aliases are retired (were claimed as still functioning).
241
+
242
+ ## [3.0.0-alpha.23] — 2026-06-26
243
+
244
+ Toolkit hardening pass: every registered tool's request/response contract was
245
+ adversarially verified against the deployed edge functions. Two tools were broken on
246
+ every call; the rest had silent field drops, wrong results, or a confidentiality/access gap.
247
+
248
+ ### Fixed
249
+ - **Edge-function errors are now legible.** `invokeFunction` only ever surfaced the fixed
250
+ string "Edge Function returned a non-2xx status code"; the real reason lives in
251
+ `error.context`. It now reads that body (and the HTTP status), so every EF-backed tool
252
+ returns an actionable error the agent can act on — the single highest-impact fix.
253
+ - **mDM_edit no longer strips E2EE.** It used to store a server-readable plaintext body even
254
+ on an E2EE thread (and the forward-only ratchet means an edit can't be re-sealed). It now
255
+ refuses to edit E2EE messages (use delete + re-send) and only edits legacy plaintext.
256
+ - **mp0st_send cc/bcc/reply_to are actually delivered** — the backend dropped them silently;
257
+ now forwarded to the mail provider (edge-function fix, deployed).
258
+ - **mDM call rooms are access-gated (security)** — call-room tokens were mintable by any
259
+ authenticated user who learned the room name; the backend now restricts them to the two
260
+ participants, and the room name is per-pair so the gate is robust (edge-function fix, deployed).
261
+ - **mDM_call_end / mDM_voice_note** now return the real message id (was always undefined).
262
+ - **mp0st_view** no longer advertises a `received_at` field the backend doesn't return (it's `sent_at`).
263
+
264
+ ### Changed
265
+ - **Unregistered `comms_embed_create`** — its `embed-keys` edge function isn't deployed (404
266
+ on every call) and the embed surface is parked. Tool count **62 → 61**. Re-register when the
267
+ backend + widget ship.
268
+ - **mIRC tools stop advertising fields the backend ignores.** Removed: `mIRC_kick` `reason`,
269
+ `mIRC_request_access` `message`, `mIRC_ban` `reason`+`until` (the latter silently made a
270
+ "temporary" ban permanent), and `access_mode` on `mIRC_update`/`mIRC_list` (no-ops). Added
271
+ `wrapped_group_key` to `mIRC_create`/`mIRC_approve_request` so E2EE (password/private)
272
+ channels are honestly callable. Descriptions corrected to match.
273
+ - **mp0st_consent** now fails fast client-side when `check`/`optin` is missing a recipient.
274
+
275
+ ### Verified (no changes needed)
276
+ - Install/boot, full build + typecheck across all packages, dependency-export resolution, and
277
+ the mDM X3DH + Double-Ratchet crypto round-trip all pass.
278
+
279
+ ## [3.0.0-alpha.22] — 2026-06-26
280
+
281
+ ### Fixed
282
+ - **alpha.21 was broken on a fresh install** — it crashed on startup with
283
+ `SyntaxError: The requested module '@mosadd/crypto' does not provide an export named
284
+ 'initRatchetInitiator'`. The workspace dependency packages (`@mosadd/crypto`, `protocol`,
285
+ `providers`, `threat-engine`) had drifted: their *source* gained new exports (the mDM
286
+ Double-Ratchet work) but their version was never bumped, so npm still served the stale
287
+ alpha.4/alpha.5 builds while `@mosadd/mcp` was built against the newer API. Bumped the whole
288
+ alpha-line in lockstep to alpha.22 and republished so every published package matches current
289
+ source and `workspace:*` cross-deps resolve. Verified: a clean `npm i @mosadd/mcp@alpha`
290
+ now boots and lists 62 tools. (The previous alpha.20 was broken-on-install the same way.)
291
+
292
+ ### Changed
293
+ - **Unregistered 2 scaffold tools that failed on every call.** `mp0st_send_as_agent`
294
+ (POSTed to a non-existent `hub-claim-mint` endpoint → 404, and sent provenance body
295
+ fields the deployed `mp0st-send` EF never reads) and `mTALK_ingest_ptt` (request body
296
+ didn't match the deployed `ptt-ingest` EF → 400). Both are now commented out in
297
+ `tools/index.ts` like the other not-registered modules, so an agent only ever discovers
298
+ tools that actually work. Registered tool count **64 → 62** (mp0st 12→11, mTALK 6→5).
299
+ Source is kept; both re-register once their backend contracts are wired + tested.
300
+
301
+ ### Fixed
302
+ - **mIRC `reject_request` / `approve_request` field (LINEAR-3522):** the tools sent
303
+ `request_id` but `channel-members-manage` reads `target_identity_id` → 400 every
304
+ call. Renamed to `identity_id` (normalized to `target_identity_id`). `reject` now
305
+ works; `approve` of an E2EE channel still needs a wrapped group key (LINEAR-3523).
306
+ - **mDM / mIRC message pagination (LINEAR-3524):** `mDM_list` read `cursor`/`has_more`
307
+ but `message-list` history mode returns `next_before`, and `mIRC_list_messages`
308
+ sent `cursor` (ignored; EF reads `before`) and read `next_cursor` (never returned)
309
+ → neither paged past page 1. Send `before`, read `next_before`.
310
+
311
+ ## [3.0.0-alpha.19] — 2026-06-19
312
+
313
+ ### Removed
314
+ - **BREAKING — mROOM module killed (LINEAR-3414):** the 11 `mROOM_*` tools
315
+ (`mROOM_create`, `mROOM_create_guest_link`, `mROOM_join`, `mROOM_leave`,
316
+ `mROOM_close`, `mROOM_list`, `mROOM_voice_join`, `mROOM_send_message`,
317
+ `mROOM_list_messages`, `mROOM_send_voice`, `mROOM_send_file`) are no longer
318
+ registered. Ephemeral private rooms are re-cut into private mIRC channels.
319
+ The source stays in `tools/mroom*.ts` (unregistered, like mURL/mCALL).
320
+
321
+ ### Added
322
+ - **Defensive threat engine as MCP tools (LINEAR-3498):** `threat_catalog`
323
+ (list the canonical 160+ threat-event taxonomy) and `threat_classify`
324
+ (pure `evaluateEvent` decision → action/severity/reason). Wraps
325
+ `@mosadd/threat-engine`; deterministic, offline, `requires: "any"`.
326
+
327
+ Net: 70 → **64 callable tools** across 5 live modules + comms + threat.
328
+
329
+ ### Changed
330
+ - **BREAKING — mail tool rename:** the 12 email MCP tools are renamed
331
+ `mAIL_*` → `mp0st_*` (`mp0st_list`, `mp0st_send`, `mp0st_view`, `mp0st_delete`,
332
+ `mp0st_stats`, `mp0st_events`, `mp0st_metrics`, `mp0st_revoke`,
333
+ `mp0st_audit_export`, `mp0st_consent`, `mp0st_notify`, `mp0st_send_as_agent`).
334
+ No aliases — the old `mAIL_*` names no longer resolve. Backend Edge Functions
335
+ (`mp0st-*`) are unchanged.
336
+
337
+ ## [3.0.0-alpha.18] — 2026-06-18
338
+
339
+ ### Added
340
+ - **`comms_embed_create`** — embed a LIVE mosadd channel into an app/site a builder-agent is
341
+ generating (Lovable / Bolt / Cursor / v0). Mints a publishable embed key (`m_pk_live_…`,
342
+ origin-scoped, via the `embed-keys` EF) and returns a paste-in widget snippet
343
+ (`<div>` + `<script src="https://embed.mosadd.com/v1.js" data-key=…>`). The widget exchanges
344
+ the publishable key for a short-lived channel-scoped JWT at runtime; the hub key never enters
345
+ the browser. Extends `mROOM_create_guest_link` (link → embeddable widget). CDN override via
346
+ `MOSADD_EMBED_CDN`. (Widget served from the dedicated `embed.mosadd.com` deploy.)
347
+
348
+ ## [3.0.0-alpha.17] — 2026-06-18
349
+
350
+ ### Added
351
+ - **Action Links — screen share.** `comms_action_create` gains a `screen_share` action
352
+ type, and a new `comms_action_frame_get` tool lets the creating agent read frames of the
353
+ recipient's shared screen (consent-gated, browser-sandbox only). Turns Action Links into
354
+ "remote-desktop-lite" — the agent sees what the human chooses to share.
355
+
356
+ ### Changed
357
+ - **Durable `mosadd login`.** The saved session (`~/.mosadd/session.json`) is now refreshed
358
+ from its refresh token at server boot, so a single `mosadd login` keeps working across
359
+ restarts — no more re-login when the access token expires.
360
+ - Onboarding README restructured (recommended auth path — `mosadd login` — first; hub API
361
+ key second; DevTools JWT demoted), and the 61→70 / `mosadd.dev`→`mosadd.com` reconciliation
362
+ (first shipped on the published package with this release).
363
+
364
+ ## [3.0.0-alpha.16] — 2026-06-17
365
+
366
+ ### Fixed
367
+ - `mAIL_view` now calls the `mp0st-get` Edge Function (read a message by id,
368
+ owner-scoped) instead of `mp0st-view` (the tracking-pixel endpoint, which
369
+ returned "Missing tracking ID"). ([LINEAR-2917])
370
+ - CI publish drops `--provenance` — npm returned 422 because the source repo
371
+ (`mosadd-os`) is private, so provenance attestation is not available.
372
+
373
+ ### Added (cumulative since alpha.4 — tool count 61 → 70)
374
+ - **Action links (Tier 1):** `comms_action_create` mints a one-link browser
375
+ action an agent can hand to a human (run-with-consent in the mosadd sandbox).
376
+ - **mAIL provenance:** `mAIL_send_as_agent` stamps agent/human provenance on the
377
+ message so the recipient sees who actually sent it.
378
+ - **File & voice attachments:** `mDM_send_voice` / `mDM_send_file`,
379
+ `mROOM_send_voice` / `mROOM_send_file`, `mIRC_send_voice` / `mIRC_send_file`
380
+ (reuse the existing `chat-files` bucket — no new transport).
381
+ - **mTALK → RAG:** `mTALK_ingest_ptt` feeds push-to-talk audio into the RAG index
382
+ (opt-in, gated server-side).
383
+ - **mROOM:** `mROOM_create_guest_link` (single-call, no-account guest links) and
384
+ `mROOM_voice_join`.
385
+ - **mIRC edge transport:** `mIRC_mint_channel_token`, `mIRC_send_edge`,
386
+ `mIRC_history_edge` — the low-latency path the agent-coordination skill rides.
387
+
388
+ ### Changed
389
+ - README, `package.json`, and the plugin `marketplace.json` reconciled to the
390
+ current surface: **70 tools across 6 modules** + `comms_capabilities`
391
+ discovery (71 callable), version `alpha.16`, and `mosadd.dev` → `mosadd.com`
392
+ (the dev surface was consolidated into the main site). ([LINEAR-3391])
393
+ - `mCALL` (telephony, carrier-pending) and `mURL` (brand/consumer surface)
394
+ remain **unregistered** in `tools/index.ts` — an agent only ever discovers
395
+ tools that actually work.
396
+
397
+ ## [3.0.0-alpha.4]
398
+
399
+ ### Added
400
+ - Initial public alpha: **61 tools across 6 live modules** — mDM (incl. voice),
401
+ mIRC, mROOM, mAIL, mTALK, mRAG — plus the `comms_capabilities` discovery tool.
402
+ - BYOK mode: the server talks to your own mosadd Supabase backend via
403
+ `MOSADD_SUPABASE_URL` / `MOSADD_SUPABASE_ANON_KEY` / `MOSADD_USER_JWT`.
404
+ - Apache-2.0 license; tool names follow [RFC 0001] (`m<MODULE>_<operation>`).
405
+
406
+ [3.0.0-alpha.16]: https://github.com/Hei33enberg/mosadd-os/tree/main/packages/mcp
407
+ [3.0.0-alpha.4]: https://github.com/Hei33enberg/mosadd-os/tree/main/packages/mcp
408
+ [LINEAR-2917]: https://linear.app/ip-ra/issue/LINEAR-2917
409
+ [LINEAR-3391]: https://linear.app/ip-ra/issue/LINEAR-3391
410
+ [RFC 0001]: https://github.com/Hei33enberg/mosadd-os/blob/main/docs/rfcs/0001-module-naming.md
package/README.md CHANGED
@@ -1,68 +1,88 @@
1
1
  # @mosadd/mcp
2
2
 
3
- MCP server for [mosadd](https://mosadd.dev) — exposes the OS modules (m\*) as Model Context Protocol tools so any agent runtime can talk to mosadd: Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom.
3
+ **They're apps. We're the layer.** The MCP server for [mosADD](https://mosadd.com) — the omnichannel comms layer for humans, agents, and robots. It exposes the OS modules (m\*) — **mDM (1:1), mIRC (channels, including open-web mURL rooms), and mAYL (email 3.0)** — as Model Context Protocol tools, so any agent runtime becomes a first-class contact your team can message and direct: Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, or your own.
4
4
 
5
- > **3.0.0-alpha.4** — **57 live tools across 6 live modules** (mDM incl. voice, mIRC, mROOM, mAIL, mTALK, mRAG) + the `comms_capabilities` discovery tool, wired to the mosadd backend (BYOK) as a strangler-fig step. Phase 2 routes through the hosted gateway at `mcp.mosadd.com` with the 167-event radar in front.
5
+ **Hosted path:** `https://mcp.mosadd.com/mcp` — add it by URL and sign in with your mosADD account (OAuth), nothing to paste. Without a browser, use a key from [mosadd.com/keys](https://mosadd.com/keys) (`MOSADD_API_KEY` / `mosadd_sk_live_…`) over stdio with this package, or as a Bearer header against the same address.
6
6
 
7
- ## Install
7
+ One key, one server, 85 tools — MCP-native, no SDK to wire up. **What is encrypted, plainly:** mDM between two *people* in the mosADD app is end-to-end encrypted (Signal X3DH + Double Ratchet, keys on the device). Since 3.0.0-alpha.54, when an agent line is on either side of an mDM — and every agent hub key and every key for the MCP endpoint speaks as an agent line — `mDM_send` sends plain text over TLS and the service can read it. Channels, mURL rooms, mail and voice are server-readable too. The full posture: [docs/security/e2ee-posture.md](https://github.com/Hei33enberg/mosADD-OS/blob/main/docs/security/e2ee-posture.md).
8
8
 
9
- ### Claude Code
9
+ > **85 tools** across **3 MVP modules** (mDM, mIRC, mAYL) — mURL open-web rooms are folded under mIRC — + cross-cutting capabilities (mTALK voice, mRAG search, comms agent-actions) + agent→user action links + the `comms_capabilities` discovery tool.
10
+
11
+ ## Connect your agent
12
+
13
+ Three ways to authenticate, friendliest first — all three end with the same 85 tools.
14
+
15
+ ### 1. `mosadd login` — recommended (one command, stays logged in)
16
+
17
+ Sign in once; the session is saved to `~/.mosadd/session.json` and **refreshed automatically on every server start** (from its refresh token), so a single login keeps working — no env vars, no expiring-token dance.
10
18
 
11
19
  ```bash
12
- claude mcp add mosadd -- npx -y @mosadd/mcp@alpha
20
+ npx -y @mosadd/mcp login
21
+ # prompts for your Supabase URL + anon key (both public) and your mosADD email + password
22
+ ```
23
+
24
+ Then register the server with **no env block**:
25
+
26
+ ```bash
27
+ # Claude Code
28
+ claude mcp add mosadd -- npx -y @mosadd/mcp
29
+ ```
30
+
31
+ ```json
32
+ // Claude Desktop / Cursor / Cline / Windsurf — mcpServers config, no env needed
33
+ {
34
+ "mcpServers": {
35
+ "mosadd": { "command": "npx", "args": ["-y", "@mosadd/mcp"] }
36
+ }
37
+ }
13
38
  ```
14
39
 
15
- ### Cursor
40
+ `npx @mosadd/mcp whoami` shows who you're signed in as; `… logout` clears it.
16
41
 
17
- `~/.cursor/mcp.json`:
42
+ ### 2. `MOSADD_API_KEY` — headless / CI (one long-lived key)
43
+
44
+ A `mosadd_sk_live_…` hub key does not expire; the server exchanges it for a fresh session on every start. Best for servers, cron, and our own `mosadd-agent`.
18
45
 
19
46
  ```json
20
47
  {
21
48
  "mcpServers": {
22
49
  "mosadd": {
23
50
  "command": "npx",
24
- "args": ["-y", "@mosadd/mcp@alpha"],
25
- "env": {
26
- "MOSADD_SUPABASE_URL": "https://<your-project>.supabase.co",
27
- "MOSADD_SUPABASE_ANON_KEY": "<anon key>",
28
- "MOSADD_USER_JWT": "<your session JWT>"
29
- }
51
+ "args": ["-y", "@mosadd/mcp"],
52
+ "env": { "MOSADD_API_KEY": "mosadd_sk_live_…" }
30
53
  }
31
54
  }
32
55
  }
33
56
  ```
34
57
 
35
- ### Standalone
58
+ Mint a mosadd.com key at **[mosadd.com/keys](https://mosadd.com/keys)** — shown once as `mosadd_sk_live_…`. The same key also works as a Bearer header against `https://mcp.mosadd.com/mcp`; with a browser, sign in there instead (OAuth).
36
59
 
37
- ```bash
38
- MOSADD_SUPABASE_URL=... MOSADD_SUPABASE_ANON_KEY=... MOSADD_USER_JWT=... npx @mosadd/mcp@alpha
39
- ```
40
-
41
- ## BYOK — get your env values
60
+ ### 3. BYOK + `MOSADD_USER_JWT` — advanced / debugging
42
61
 
43
- While the hosted gateway is in development, the alpha runs in **local BYOK mode** — you supply your own Supabase credentials to talk to your own mosadd backend.
62
+ Bring your own Supabase URL + anon key + a raw session token. **The JWT expires (~1h)** — prefer option 1 or 2, or the hosted endpoint `https://mcp.mosadd.com/mcp`, for anything ongoing.
44
63
 
45
64
  - `MOSADD_SUPABASE_URL` — your Supabase project URL (e.g. `https://abc.supabase.co`)
46
65
  - `MOSADD_SUPABASE_ANON_KEY` — the public anon key from project settings
47
- - `MOSADD_USER_JWT` — a Supabase session token for your mosadd user. Get it from the browser:
48
- 1. Sign in to mosadd.com
49
- 2. Open DevTools → Application → Local Storage → `sb-<ref>-auth-token`
50
- 3. Copy the `access_token` field
66
+ - `MOSADD_USER_JWT` — sign in to mosadd.com → DevTools → Application → Local Storage → `sb-<ref>-auth-token` → copy the `access_token` field
51
67
 
52
- In Phase 2, run `mosadd login` to OAuth into hub.mosadd.com — no JWT-juggling required.
68
+ The hosted gateway at `https://mcp.mosadd.com/mcp` is the zero-install remote path: OAuth sign-in, or Bearer with a mosadd.com key.
53
69
 
54
70
  ## Tools shipped in alpha
55
71
 
56
- **57 live tools across 6 live modules** (mDM, mIRC, mROOM, mAIL, mTALK, mRAG) + the `comms_capabilities` discovery tool. Highlights per module:
72
+ **85 tools** — 3 MVP modules (mDM, mIRC[+mURL], mAYL) + capabilities (mTALK voice, mRAG search + knowledge-graph traversal, comms agent-actions) + the `comms_capabilities` discovery tool. Highlights:
57
73
 
58
74
  | Module | Tools | What it does |
59
75
  |---|---|---|
60
- | **mDM** (12) | `mDM_list_contacts`, `mDM_send`, `mDM_send_unencrypted`, `mDM_edit`, `mDM_delete`, `mDM_list`, `mDM_publish_keys`, `mDM_respond_request` + 4 voice ops | 1:1 text + voice. Multi-thread per contact, X3DH / Double-Ratchet E2EE on `mDM_send` |
61
- | **mIRC** (20) | `mIRC_create/list/get/update/delete`, member RBAC ops, `mIRC_post_message`, `mIRC_list_messages` + admin | Persistent Discord/Slack-style channels |
62
- | **mROOM** (9) | `mROOM_create`, **`mROOM_create_guest_link`**, `mROOM_join/leave/close/list`, `mROOM_send_message`, `mROOM_list_messages` | Ephemeral rooms + single-call no-account guest links |
63
- | **mTALK** (5) | `mTALK_open`, `mTALK_join`, `mTALK_press`, `mTALK_release`, `mTALK_state` | Half-duplex push-to-talk: one speaker, FIFO queue, anti-hog auto-release |
64
- | **mAIL** (7) | `mAIL_send`, `mAIL_view`, `mAIL_list`, `mAIL_delete`, `mAIL_stats`, `mAIL_events`, `mAIL_metrics` | Mail; every user gets `<id>@mosadd.com` |
65
- | **mRAG** (4) | `mRAG_ingest`, `mRAG_search`, `mRAG_list_sources`, `mRAG_delete` | RAG recall over the user's own data (hybrid vector + BM25) |
76
+ | **mDM** (16) | `mDM_list_contacts`, `mDM_send`, `mDM_send_unencrypted` (DEPRECATED — migration-window fallback, only when the peer hasn't published keys), `mDM_edit`, `mDM_delete`, `mDM_list`, `mDM_publish_keys`, `mDM_respond_request`, `mDM_call_start/answer/end`, `mDM_voice_note`, `mDM_send_voice`, `mDM_send_file` | 1:1 text, voice notes, calls + file/voice attachments. Multi-thread per contact. Between two people `mDM_send` encrypts end-to-end (X3DH / Double Ratchet, `mosadd.e2ee.v2`); with an agent line on either side (alpha.54 and later) it sends plain text the service can read |
77
+ | **mIRC** (25) | `mIRC_create/list/get/update/delete/discover/report`, member RBAC (`mIRC_join/leave/invite/kick/ban/unban/set_role/set_ptt/approve_request/reject_request/request_access`), `mIRC_post_message`, `mIRC_list_messages`, edge (`mIRC_mint_channel_token`, `mIRC_send_edge`, `mIRC_history_edge`), `mIRC_send_voice/file` | Persistent Discord/Slack-style channels + the agent-coordination edge transport |
78
+ | **mURL** (7) | `mURL_read_channel`, `mURL_post`, `mURL_presence`, `mURL_list_channels`, `mURL_create`, `mURL_update`, `mURL_delete` | Open-web rooms folded under mIRC (not a separate MVP module). Read/post/presence/discovery + owner lifecycle. Transport-encrypted, server-readable/public by design |
79
+ | **mAYL** (16) | `mAYL_send`, `mAYL_view`, `mAYL_list`, `mAYL_delete`, `mAYL_stats`, `mAYL_events`, `mAYL_metrics`, `mAYL_revoke`, `mAYL_audit_export`, `mAYL_consent`, `mAYL_notify`, `mAYL_send_as_agent`, `mAYL_agentbox_provision`, `mAYL_agentbox_list`, `mAYL_agentbox_extend`, `mAYL_agentbox_release` | Mail; every user gets `<id>@mosadd.com`. The four `mAYL_agentbox_*` tools let an AGENT mint, list, extend and release its OWN two-way disposable inbox (`agent-<hex>@mosadd.com`) — `create_inbox` parity with AgentMail, on our stack, with provenance. Transport + at-rest encrypted (server-readable), NOT E2EE. `mAYL_revoke` recalls secure-reader access; `mAYL_audit_export` emits an HMAC-SHA256-signed engagement audit; `mAYL_consent` manages recipient tracking opt-outs (GDPR); `mAYL_notify` pulls the inbound-mail feed. (Was the mp0st codename; the `mp0st_*` aliases are retired — mAYL is the one name) |
80
+ | **mTALK** (6) | `mTALK_open`, `mTALK_join`, `mTALK_press`, `mTALK_release`, `mTALK_state`, `mTALK_ingest_ptt` | Half-duplex push-to-talk: one speaker, FIFO queue, anti-hog auto-release + transcript ingest to mRAG |
81
+ | **mRAG** (8) | `mRAG_ingest`, `mRAG_search`, `mRAG_list_sources`, `mRAG_delete`, `mRAG_graph_refresh`, `mRAG_graph_overview`, `mRAG_graph_neighbors`, `mRAG_graph_timeline` | RAG recall over the user's own data (hybrid vector + BM25) + knowledge-graph traversal (who/what/when) |
82
+ | **comms_** (4) | `comms_action_create`, `comms_action_frame_get`, `comms_capabilities`, `comms_embed_create` | `comms_action_create` mints an agent→user one-link browser action (Tier 1); `comms_action_frame_get` fetches a framed action; `comms_capabilities` is one-call discovery of every tool's transport `requires` flag; `comms_embed_create` mints a publishable embed key + a paste-in `<script>` snippet that drops a live mIRC channel into any website (`embed.mosadd.com/v1.js`, skins + sidebar/launcher modes) |
83
+ | **Irondome** (2) | `threat_catalog`, `threat_classify` | On-device defensive classification over the 193-event threat taxonomy — pure, offline, no backend and no surveillance. The engine decides, the caller acts. A taxonomy entry is a classifiable event, [not a detector](../threat-engine/README.md#read-this-first-a-taxonomy-entry-is-not-a-detector) |
84
+
85
+ Module tools: mDM (16) + mIRC (25) + mURL (7) + mAYL (16) = 64; capabilities: mTALK (6) + mRAG (8) + comms_ (5, incl. the `comms_capabilities` discovery tool, `comms_embed_create` — re-registered 2026-07-17 now that `embed.mosadd.com/v1.js` is live — and `comms_session_attach`, added 2026-08-14) + Irondome (2) = 21 — **85 callable tools** in total. The mRAG capability now bundles 4 search/ingest tools plus the 4 `mRAG_graph_*` knowledge-graph traversal tools (added 2026-08-11). The exact live number is exported as `TOOL_COUNT` (`= allTools.length`) — reference that, never a hand-typed figure. mDM and mIRC each include their two attachment tools (`*_send_voice` / `*_send_file`); mAYL includes `mAYL_send_as_agent` and mTALK includes `mTALK_ingest_ptt` — both proven end-to-end and registered 2026-07-29. Not registered (so agents only ever see tools that actually work): `mCALL` (telephony, carrier-pending), `mROOM` (folded into ephemeral private mIRC), and the retired `mp0st_*` mAYL aliases.
66
86
 
67
87
  All tool names follow [RFC 0001](https://github.com/Hei33enberg/mosadd-os/blob/main/docs/rfcs/0001-module-naming.md) — `m<MODULE>_<operation>` snake_case.
68
88
 
@@ -76,7 +96,7 @@ Claude calls `mDM_list_contacts` → you see your contact list.
76
96
 
77
97
  > Send "hello from Claude" to <id> with thread label `notes`.
78
98
 
79
- Claude calls `mDM_send({ to, text, thread_label: "notes" })` → message appears in your mosadd app under a `notes` thread.
99
+ Claude calls `mDM_send({ to, text, thread_label: "notes" })` → message appears in your mosADD app under a `notes` thread.
80
100
 
81
101
  ## Architecture
82
102
 
@@ -90,7 +110,7 @@ Agent (Claude / Cursor / ...)
90
110
  │ supabase.functions.invoke('message-send', ...)
91
111
  │ + Authorization: Bearer <MOSADD_USER_JWT>
92
112
  ▼
93
- mosadd backend Edge Function
113
+ mosADD backend Edge Function
94
114
  │
95
115
  │ RLS-checked insert
96
116
  ▼
@@ -101,26 +121,45 @@ Postgres `messages` table
101
121
  mosadd.com app (receiver)
102
122
  ```
103
123
 
104
- For PTT / CALL / ROOM (real-time media), the architecture separates **control plane** (MCP) from **data plane** (WebRTC daemon). See [docs/architecture/control-data-plane.md](https://github.com/Hei33enberg/mosadd-os/blob/main/docs/architecture/control-data-plane.md) when it lands.
124
+ For PTT / CALL (real-time media), the architecture separates **control plane** (MCP) from **data plane** (WebRTC daemon). That design doc is not written yet; what the hosted service guarantees today is in [docs/architecture/phase-2-hub.md](https://github.com/Hei33enberg/mosADD-OS/blob/main/docs/architecture/phase-2-hub.md).
125
+
126
+ ## CLI
127
+
128
+ `npx @mosadd/mcp` with no arguments starts the MCP server over stdio (what your agent runtime runs). These commands print and exit instead:
129
+
130
+ | Command | What it does |
131
+ |---|---|
132
+ | `npx @mosadd/mcp --version` (`-v`) | prints the installed version (from `package.json`) |
133
+ | `npx @mosadd/mcp --help` (`-h`) | prints the commands and the environment variables, including `MOSADD_API_KEY` |
134
+ | `npx @mosadd/mcp tools` | lists every registered tool, grouped by module |
135
+ | `npx @mosadd/mcp login` / `logout` / `whoami` | save, delete, or show the signed-in session |
136
+
137
+ The server's `serverInfo.version` and its "ready" log line use the same `package.json` version.
105
138
 
106
139
  ## Configuration via env vars
107
140
 
108
141
  | Env | Description | Required |
109
142
  |---|---|---|
110
- | `MOSADD_SUPABASE_URL` | Supabase project URL — DM / IRC / ROOM / KB backend | yes (BYOK) |
143
+ | `MOSADD_SUPABASE_URL` | Supabase project URL — DM / IRC / mail / KB backend | yes (BYOK) |
111
144
  | `MOSADD_SUPABASE_ANON_KEY` | Supabase anon key | yes (BYOK) |
112
145
  | `MOSADD_USER_JWT` | User session token | yes (for tools that touch user data) |
113
- | `MOSADD_RESEND_API_KEY` | Resend API key — enables `mAIL` outbound | no (mAIL disabled if unset) |
114
- | `MOSADD_LIVEKIT_URL` | LiveKit `wss://…` URL — enables `mTALK` / `mROOM` voice | no (voice disabled if unset) |
146
+ | `MOSADD_RESEND_API_KEY` | Resend API key — enables `mAYL` outbound mail (the `mp0st_*` aliases are retired — `mAYL_*` is the one name) | no (mAYL disabled if unset) |
147
+ | `MOSADD_LIVEKIT_URL` | LiveKit `wss://…` URL — enables `mTALK` voice | no (voice disabled if unset) |
115
148
  | `MOSADD_LIVEKIT_API_KEY` | LiveKit API key | no (with `…_URL` / `…_API_SECRET`) |
116
149
  | `MOSADD_LIVEKIT_API_SECRET` | LiveKit API secret | no |
117
150
  | `MOSADD_API_KEY` | Hub API key (Phase 2 hosted mode) | no |
118
151
  | `MOSADD_HUB_URL` | Override hub url | no |
119
- | `MOSADD_MODE` | `local` / `cloud` / `self-host` | no (auto-detected) |
152
+ | `MOSADD_MODE` | `local` / `cloud` (the code accepts one more legacy value; there is no self-hosted service) | no (auto-detected) |
120
153
  | `MOSADD_LOG_LEVEL` | `debug` / `info` / `warn` / `error` | no (default `info`) |
121
154
 
122
155
  Missing optional keys fail closed — that channel is simply absent from `comms_capabilities`.
123
156
 
157
+ ## Links
158
+
159
+ - **Hosted endpoint** — `https://mcp.mosadd.com/mcp` (OAuth sign-in) · keys at [mosadd.com/keys](https://mosadd.com/keys) · see the [repo README](https://github.com/Hei33enberg/mosADD-OS#connect-your-ai-in-one-line)
160
+ - **mosADD** — [mosadd.com](https://mosadd.com) · [docs](https://mosadd.com/docs/quickstart)
161
+ - **Source** — [github.com/Hei33enberg/mosADD-OS](https://github.com/Hei33enberg/mosADD-OS) (MIT)
162
+
124
163
  ## License
125
164
 
126
- Apache-2.0. See repo [LICENSE](https://github.com/Hei33enberg/mosadd-os/blob/main/LICENSE) and [NOTICE](https://github.com/Hei33enberg/mosadd-os/blob/main/NOTICE).
165
+ MIT from 2026-09-29 (earlier releases: Apache-2.0). See repo [LICENSE](https://github.com/Hei33enberg/mosADD-OS/blob/main/LICENSE) and [NOTICE](https://github.com/Hei33enberg/mosADD-OS/blob/main/NOTICE).