@mosadd/mcp 3.0.0-alpha.55 → 3.0.0-alpha.56

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 (53) hide show
  1. package/CHANGELOG.md +5 -11
  2. package/LICENSE +21 -0
  3. package/README.md +151 -150
  4. package/dist/bin/mcp.js +1 -1
  5. package/dist/{chunk-IWUGKLDX.js → chunk-T3KDVUAT.js} +14 -10
  6. package/dist/index.js +1 -1
  7. package/package.json +10 -10
  8. package/src/__tests__/blob-upload.test.ts +93 -93
  9. package/src/__tests__/channel-e2ee.test.ts +62 -62
  10. package/src/__tests__/flota-jawnie.test.ts +2 -2
  11. package/src/__tests__/golden-path.test.ts +139 -139
  12. package/src/__tests__/integration.test.ts +209 -182
  13. package/src/__tests__/mdm-e2ee.test.ts +212 -212
  14. package/src/__tests__/mdm-mcp-readable.test.ts +390 -390
  15. package/src/__tests__/mirc-invite.test.ts +112 -112
  16. package/src/__tests__/mtalk.test.ts +122 -122
  17. package/src/__tests__/presence.test.ts +199 -199
  18. package/src/__tests__/server.test.ts +71 -71
  19. package/src/__tests__/tool-count-consistency.test.ts +255 -199
  20. package/src/bin/login.ts +138 -138
  21. package/src/bin/mcp.ts +145 -145
  22. package/src/config.ts +66 -66
  23. package/src/crypto/channel-e2ee.ts +288 -288
  24. package/src/crypto/mdm-session.ts +842 -842
  25. package/src/index.ts +19 -19
  26. package/src/observability/sentry.ts +79 -79
  27. package/src/providers/blob-upload.ts +162 -162
  28. package/src/providers/memory-voice.ts +79 -79
  29. package/src/providers/supabase-dm.ts +202 -202
  30. package/src/providers/supabase-voice.ts +91 -91
  31. package/src/server.ts +195 -195
  32. package/src/tools/actions.ts +166 -166
  33. package/src/tools/attachments.ts +276 -276
  34. package/src/tools/capabilities.ts +70 -70
  35. package/src/tools/channel-payload.ts +2 -2
  36. package/src/tools/embed.ts +110 -110
  37. package/src/tools/index.ts +181 -181
  38. package/src/tools/knowledge.ts +344 -344
  39. package/src/tools/mail-aliases.ts +25 -25
  40. package/src/tools/mail-provenance.ts +137 -137
  41. package/src/tools/mail.ts +403 -403
  42. package/src/tools/mdm-as-agent.ts +138 -126
  43. package/src/tools/mdm.ts +3 -3
  44. package/src/tools/mirc-edge.ts +196 -196
  45. package/src/tools/mirc-members.ts +287 -287
  46. package/src/tools/mirc-messages.ts +1 -1
  47. package/src/tools/mirc.ts +308 -308
  48. package/src/tools/mroom.ts +221 -221
  49. package/src/tools/mtalk.ts +131 -131
  50. package/src/tools/presence.ts +442 -442
  51. package/src/tools/voice-format.ts +28 -28
  52. package/src/types.ts +121 -121
  53. package/src/voice/floor.ts +132 -132
package/CHANGELOG.md CHANGED
@@ -8,18 +8,12 @@ gateway (Phase 2) ships.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [3.0.0-alpha.56] — 2026-11-10
12
+
11
13
  ### Added
12
- - **`mIRC_invite`** (2026-09-03, LINEAR-5870) — the member-add primitive the toolkit never
13
- exposed. Wraps `channel-members-manage` `invite`: an agent/robot **you own** joins at once
14
- (`{ auto_joined: true }` — `channel_members` + linked `space_members` + `channel_keys` when a
15
- `wrapped_group_key` is passed; no code to redeem), a human or somebody else's agent gets an
16
- **invite code** to redeem in the app. Why P0: `mIRC_join` adds the KEY's identity (the human),
17
- while channel posts are signed by the AGENT — so every channel created from the toolkit was
18
- mute (`agent_not_in_channel`) until its agent was added from the app's member drawer.
19
- - **`mIRC_create` `invite_agents?: string[]`** — fan-out to `mIRC_invite` right after creation;
20
- per-agent failures are reported in `invites[]`, the channel is never rolled back.
21
-
22
- Tool count **84 → 85** (mIRC **24 → 25**); `TOOL_COUNT` (`= allTools.length`) stays the truth.
14
+ - **`mDM_send_as_agent` `thread_label?`** (LINEAR-6577) — same optional label alphabet as
15
+ `mDM_send` (`[a-zA-Z0-9._-]`, 1–120). Omit = MAIN unlabeled thread (ops lock for SOVEREIGN/King
16
+ until rename/UI merge). A new label opens a new `dm:A:B:label` thread.
23
17
 
24
18
  ## [3.0.0-alpha.55] — 2026-09-29
25
19
 
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 m.0S / mosADD contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,150 +1,151 @@
1
- # @mosadd/mcp
2
-
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 E2EE), mIRC (in-app channels), mURL (open/embeddable 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
-
5
- One key, one server, 85 tools — MCP-native, no SDK to wire up. **Encrypted where it counts, honest where it isn't:** only mDM is end-to-end (Signal X3DH + Double Ratchet, keys on-device, never on our servers); every other channel is server-readable and labeled as such.
6
-
7
- > **85 tools** across **4 modules** (mDM, mIRC, mURL, mAYL) + cross-cutting capabilities (mTALK voice, mRAG search, comms agent-actions) + agent→user action links + 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`.
8
-
9
- ## Connect your agent
10
-
11
- Three ways to authenticate, friendliest first — all three end with the same 85 tools.
12
-
13
- ### 1. `mosadd login` — recommended (one command, stays logged in)
14
-
15
- 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.
16
-
17
- ```bash
18
- npx -y @mosadd/mcp@alpha login
19
- # prompts for your Supabase URL + anon key (both public) and your mosADD email + password
20
- ```
21
-
22
- Then register the server with **no env block**:
23
-
24
- ```bash
25
- # Claude Code
26
- claude mcp add mosadd -- npx -y @mosadd/mcp@alpha
27
- ```
28
-
29
- ```json
30
- // Claude Desktop / Cursor / Cline / Windsurf — mcpServers config, no env needed
31
- {
32
- "mcpServers": {
33
- "mosadd": { "command": "npx", "args": ["-y", "@mosadd/mcp@alpha"] }
34
- }
35
- }
36
- ```
37
-
38
- `npx @mosadd/mcp@alpha whoami` shows who you're signed in as; `… logout` clears it.
39
-
40
- ### 2. `MOSADD_API_KEY` — headless / CI (one long-lived key)
41
-
42
- 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`.
43
-
44
- ```json
45
- {
46
- "mcpServers": {
47
- "mosadd": {
48
- "command": "npx",
49
- "args": ["-y", "@mosadd/mcp@alpha"],
50
- "env": { "MOSADD_API_KEY": "mosadd_sk_live_…" }
51
- }
52
- }
53
- }
54
- ```
55
-
56
- Mint a key at **[mosadd.com/keys](https://mosadd.com/keys)** — the hub shows it once, in the `mosadd_sk_live_…` format above. You can also use it as a Bearer token against the hosted MCP gateway at `https://mcp.mosadd.com/mcp`.
57
-
58
- ### 3. BYOK + `MOSADD_USER_JWT` — advanced / debugging
59
-
60
- Bring your own Supabase URL + anon key + a raw session token. **The JWT expires (~1h)** — prefer option 1 or 2 for anything ongoing.
61
-
62
- - `MOSADD_SUPABASE_URL` — your Supabase project URL (e.g. `https://abc.supabase.co`)
63
- - `MOSADD_SUPABASE_ANON_KEY` — the public anon key from project settings
64
- - `MOSADD_USER_JWT` — sign in to mosadd.com → DevTools → Application → Local Storage → `sb-<ref>-auth-token` → copy the `access_token` field
65
-
66
- In Phase 2 the hosted gateway at `mcp.mosadd.com` removes even this — add a URL + key once, server-side, and the broker holds the credentials.
67
-
68
- ## Tools shipped in alpha
69
-
70
- **85 tools** — 4 modules (mDM, mIRC, mURL, mAYL) + capabilities (mTALK voice, mRAG search + knowledge-graph traversal, comms agent-actions) + the `comms_capabilities` discovery tool. Highlights per module:
71
-
72
- | Module | Tools | What it does |
73
- |---|---|---|
74
- | **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. `mDM_send` is end-to-end encrypted by default (X3DH / Double Ratchet, `mosadd.e2ee.v2`); the operator cannot read message content |
75
- | **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 |
76
- | **mURL** (7) | `mURL_read_channel`, `mURL_post`, `mURL_presence`, `mURL_list_channels`, `mURL_create`, `mURL_update`, `mURL_delete` | IRC-for-URLs — open-web text rooms, agent-native. Read/post/presence/discovery with a hub key, PLUS owner-side lifecycle: `mURL_create` (claim a domain), `mURL_update` (branding + open/claimed/blocked), `mURL_delete` (`murl-manage` EF, owner-scoped via your login session). Transport-encrypted, server-readable/public by design |
77
- | **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) |
78
- | **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 |
79
- | **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) |
80
- | **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) |
81
- | **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) |
82
-
83
- 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.
84
-
85
- 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.
86
-
87
- ## Try it (60-second demo)
88
-
89
- In Claude Code with env vars set:
90
-
91
- > List my mosadd contacts.
92
-
93
- Claude calls `mDM_list_contacts` → you see your contact list.
94
-
95
- > Send "hello from Claude" to <id> with thread label `notes`.
96
-
97
- Claude calls `mDM_send({ to, text, thread_label: "notes" })` → message appears in your mosADD app under a `notes` thread.
98
-
99
- ## Architecture
100
-
101
- ```
102
- Agent (Claude / Cursor / ...)
103
- │
104
- │ stdio MCP
105
- ▼
106
- @mosadd/mcp server (this package)
107
- │
108
- │ supabase.functions.invoke('message-send', ...)
109
- │ + Authorization: Bearer <MOSADD_USER_JWT>
110
- ▼
111
- mosADD backend Edge Function
112
- │
113
- │ RLS-checked insert
114
- ▼
115
- Postgres `messages` table
116
- │
117
- │ Realtime broadcast
118
- ▼
119
- mosadd.com app (receiver)
120
- ```
121
-
122
- For PTT / CALL (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.
123
-
124
- ## Configuration via env vars
125
-
126
- | Env | Description | Required |
127
- |---|---|---|
128
- | `MOSADD_SUPABASE_URL` | Supabase project URL — DM / IRC / mail / KB backend | yes (BYOK) |
129
- | `MOSADD_SUPABASE_ANON_KEY` | Supabase anon key | yes (BYOK) |
130
- | `MOSADD_USER_JWT` | User session token | yes (for tools that touch user data) |
131
- | `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) |
132
- | `MOSADD_LIVEKIT_URL` | LiveKit `wss://…` URL — enables `mTALK` voice | no (voice disabled if unset) |
133
- | `MOSADD_LIVEKIT_API_KEY` | LiveKit API key | no (with `…_URL` / `…_API_SECRET`) |
134
- | `MOSADD_LIVEKIT_API_SECRET` | LiveKit API secret | no |
135
- | `MOSADD_API_KEY` | Hub API key (Phase 2 hosted mode) | no |
136
- | `MOSADD_HUB_URL` | Override hub url | no |
137
- | `MOSADD_MODE` | `local` / `cloud` / `self-host` | no (auto-detected) |
138
- | `MOSADD_LOG_LEVEL` | `debug` / `info` / `warn` / `error` | no (default `info`) |
139
-
140
- Missing optional keys fail closed — that channel is simply absent from `comms_capabilities`.
141
-
142
- ## Links
143
-
144
- - **Mint a key + docs** — [mosadd.com/keys](https://mosadd.com/keys) · [mosadd.com/docs](https://mosadd.com/docs) · [mosadd.com/mcp](https://mosadd.com/mcp)
145
- - **Hosted gateway** — `https://mcp.mosadd.com/mcp` (BYOK key broker, zero-install for remote agents)
146
- - **Source + self-host** — [github.com/Hei33enberg/mosADD-OS](https://github.com/Hei33enberg/mosADD-OS) (Apache-2.0)
147
-
148
- ## License
149
-
150
- 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).
1
+ # @mosadd/mcp
2
+
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 messages), mIRC (in-app channels), mURL (open/embeddable 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
+
5
+ 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 m.0S key 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).
6
+
7
+ > **85 tools** across **4 modules** (mDM, mIRC, mURL, mAYL) + cross-cutting capabilities (mTALK voice, mRAG search, comms agent-actions) + agent→user action links + 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`.
8
+
9
+ ## Connect your agent
10
+
11
+ Three ways to authenticate, friendliest first — all three end with the same 85 tools.
12
+
13
+ ### 1. `mosadd login` — recommended (one command, stays logged in)
14
+
15
+ 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.
16
+
17
+ ```bash
18
+ npx -y @mosadd/mcp@3.0.0-alpha.56 login
19
+ # prompts for your Supabase URL + anon key (both public) and your mosADD email + password
20
+ ```
21
+
22
+ Then register the server with **no env block**:
23
+
24
+ ```bash
25
+ # Claude Code
26
+ claude mcp add mosadd -- npx -y @mosadd/mcp@3.0.0-alpha.56
27
+ ```
28
+
29
+ ```json
30
+ // Claude Desktop / Cursor / Cline / Windsurf — mcpServers config, no env needed
31
+ {
32
+ "mcpServers": {
33
+ "mosadd": { "command": "npx", "args": ["-y", "@mosadd/mcp@3.0.0-alpha.56"] }
34
+ }
35
+ }
36
+ ```
37
+
38
+ `npx @mosadd/mcp@3.0.0-alpha.56 whoami` shows who you're signed in as; `… logout` clears it.
39
+
40
+ ### 2. `MOSADD_API_KEY` — headless / CI (one long-lived key)
41
+
42
+ 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`.
43
+
44
+ ```json
45
+ {
46
+ "mcpServers": {
47
+ "mosadd": {
48
+ "command": "npx",
49
+ "args": ["-y", "@mosadd/mcp@3.0.0-alpha.56"],
50
+ "env": { "MOSADD_API_KEY": "mosadd_sk_live_…" }
51
+ }
52
+ }
53
+ }
54
+ ```
55
+
56
+ Mint a key at **[mosadd.com/keys](https://mosadd.com/keys)** — the hub shows it once, in the `mosadd_sk_live_…` format above. You can also use it as a Bearer token against the hosted MCP gateway at `https://mcp.mosadd.com/mcp`.
57
+
58
+ ### 3. BYOK + `MOSADD_USER_JWT` — advanced / debugging
59
+
60
+ Bring your own Supabase URL + anon key + a raw session token. **The JWT expires (~1h)** — prefer option 1 or 2 for anything ongoing.
61
+
62
+ - `MOSADD_SUPABASE_URL` — your Supabase project URL (e.g. `https://abc.supabase.co`)
63
+ - `MOSADD_SUPABASE_ANON_KEY` — the public anon key from project settings
64
+ - `MOSADD_USER_JWT` — sign in to mosadd.com → DevTools → Application → Local Storage → `sb-<ref>-auth-token` → copy the `access_token` field
65
+
66
+ In Phase 2 the hosted gateway at `mcp.mosadd.com` removes even this — add a URL + key once, server-side, and the broker holds the credentials.
67
+
68
+ ## Tools shipped in alpha
69
+
70
+ **85 tools** — 4 modules (mDM, mIRC, mURL, mAYL) + capabilities (mTALK voice, mRAG search + knowledge-graph traversal, comms agent-actions) + the `comms_capabilities` discovery tool. Highlights per module:
71
+
72
+ | Module | Tools | What it does |
73
+ |---|---|---|
74
+ | **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 |
75
+ | **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 |
76
+ | **mURL** (7) | `mURL_read_channel`, `mURL_post`, `mURL_presence`, `mURL_list_channels`, `mURL_create`, `mURL_update`, `mURL_delete` | IRC-for-URLs — open-web text rooms, agent-native. Read/post/presence/discovery with a hub key, PLUS owner-side lifecycle: `mURL_create` (claim a domain), `mURL_update` (branding + open/claimed/blocked), `mURL_delete` (`murl-manage` EF, owner-scoped via your login session). Transport-encrypted, server-readable/public by design |
77
+ | **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) |
78
+ | **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 |
79
+ | **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) |
80
+ | **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) |
81
+ | **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) |
82
+
83
+ 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.
84
+
85
+ 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.
86
+
87
+ ## Try it (60-second demo)
88
+
89
+ In Claude Code with env vars set:
90
+
91
+ > List my mosadd contacts.
92
+
93
+ Claude calls `mDM_list_contacts` → you see your contact list.
94
+
95
+ > Send "hello from Claude" to <id> with thread label `notes`.
96
+
97
+ Claude calls `mDM_send({ to, text, thread_label: "notes" })` → message appears in your mosADD app under a `notes` thread.
98
+
99
+ ## Architecture
100
+
101
+ ```
102
+ Agent (Claude / Cursor / ...)
103
+ │
104
+ │ stdio MCP
105
+ ▼
106
+ @mosadd/mcp server (this package)
107
+ │
108
+ │ supabase.functions.invoke('message-send', ...)
109
+ │ + Authorization: Bearer <MOSADD_USER_JWT>
110
+ ▼
111
+ mosADD backend Edge Function
112
+ │
113
+ │ RLS-checked insert
114
+ ▼
115
+ Postgres `messages` table
116
+ │
117
+ │ Realtime broadcast
118
+ ▼
119
+ mosadd.com app (receiver)
120
+ ```
121
+
122
+ For PTT / CALL (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.
123
+
124
+ ## Configuration via env vars
125
+
126
+ | Env | Description | Required |
127
+ |---|---|---|
128
+ | `MOSADD_SUPABASE_URL` | Supabase project URL — DM / IRC / mail / KB backend | yes (BYOK) |
129
+ | `MOSADD_SUPABASE_ANON_KEY` | Supabase anon key | yes (BYOK) |
130
+ | `MOSADD_USER_JWT` | User session token | yes (for tools that touch user data) |
131
+ | `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) |
132
+ | `MOSADD_LIVEKIT_URL` | LiveKit `wss://…` URL — enables `mTALK` voice | no (voice disabled if unset) |
133
+ | `MOSADD_LIVEKIT_API_KEY` | LiveKit API key | no (with `…_URL` / `…_API_SECRET`) |
134
+ | `MOSADD_LIVEKIT_API_SECRET` | LiveKit API secret | no |
135
+ | `MOSADD_API_KEY` | Hub API key (Phase 2 hosted mode) | no |
136
+ | `MOSADD_HUB_URL` | Override hub url | no |
137
+ | `MOSADD_MODE` | `local` / `cloud` (the code accepts one more legacy value; there is no self-hosted service) | no (auto-detected) |
138
+ | `MOSADD_LOG_LEVEL` | `debug` / `info` / `warn` / `error` | no (default `info`) |
139
+
140
+ Missing optional keys fail closed — that channel is simply absent from `comms_capabilities`.
141
+
142
+ ## Links
143
+
144
+ - **Mint a key + docs** — [mosadd.com/keys](https://mosadd.com/keys) · [mosadd.com/docs](https://mosadd.com/docs) · [mosadd.com/mcp](https://mosadd.com/mcp)
145
+ - **Hosted gateway** — `https://mcp.mosadd.com/mcp` (BYOK key broker, zero-install for remote agents)
146
+ - **Source** — [github.com/Hei33enberg/mosADD-OS](https://github.com/Hei33enberg/mosADD-OS) (MIT)
147
+ - **m.0S endpoint** — `https://mcp.mosadd.dev/mcp` with a key from [app.mosadd.dev](https://app.mosadd.dev); see the [repo README](https://github.com/Hei33enberg/mosADD-OS#start-in-5-minutes)
148
+
149
+ ## License
150
+
151
+ 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).
package/dist/bin/mcp.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createMosaddServer
4
- } from "../chunk-IWUGKLDX.js";
4
+ } from "../chunk-T3KDVUAT.js";
5
5
  import {
6
6
  isSessionExpired,
7
7
  loadSession,
@@ -825,7 +825,7 @@ async function mDM_send(input, ctx) {
825
825
  const peerKind = selfKind === "agent" || noteToSelf ? selfKind : await peerKindOf(dm, input.to);
826
826
  if (selfKind === "agent" || peerKind === "agent" || noteToSelf) {
827
827
  const payload = packPlaintextPayload(input.text);
828
- ctx.log("debug", "mDM_send fleet plaintext (rozkaz Krola 20.09 + 28.09)", {
828
+ ctx.log("debug", "mDM_send agent-line plaintext (owner decisions 20.09 + 28.09)", {
829
829
  thread_id: threadId,
830
830
  self_kind: selfKind,
831
831
  peer_kind: peerKind,
@@ -1165,21 +1165,25 @@ var mdmTools = [
1165
1165
  import { z as z2 } from "zod";
1166
1166
  var mDM_send_as_agent_input = z2.object({
1167
1167
  agent: z2.string().min(1).max(200).describe(
1168
- "Which of YOUR agents to speak as \u2014 its mosADD address (dispatcher@mosadd.com), its identity id, or its display name. Must be an agent you own."
1168
+ "Which of YOUR agents to speak as \u2014 its mosADD address (<agent>@mosadd.com), its identity id, or its display name. Must be an agent you own."
1169
1169
  ),
1170
1170
  text: z2.string().min(1).max(8e3).describe("The message body, as the agent would write it."),
1171
1171
  to: z2.string().max(200).optional().describe(
1172
1172
  "Recipient identity id or mosADD address. Defaults to YOU (the key's owner) \u2014 the common case is an agent reporting to its owner. Must be a person, not another agent."
1173
1173
  ),
1174
+ thread_label: z2.string().min(1).max(120).regex(/^[a-zA-Z0-9._-]+$/).optional().describe(
1175
+ "Optional thread label (same as mDM_send). Omit for the MAIN unlabeled thread \u2014 required for SOVEREIGN/King traffic until rename/UI merge (LINEAR-6577). A new label opens a new thread."
1176
+ ),
1174
1177
  silent: z2.boolean().optional().describe("Deliver without waking a phone: the message still arrives and shows unread, only the OS push is skipped.")
1175
1178
  });
1176
1179
  var mDM_list_my_agents_input = z2.object({});
1177
1180
  async function mDM_send_as_agent(input, ctx) {
1178
- ctx.log("debug", "mDM_send_as_agent", { agent: input.agent });
1181
+ ctx.log("debug", "mDM_send_as_agent", { agent: input.agent, thread_label: input.thread_label });
1179
1182
  return await invokeFunction("mdm-send-as-agent", {
1180
1183
  agent: input.agent,
1181
1184
  text: input.text,
1182
1185
  ...input.to ? { to: input.to } : {},
1186
+ ...input.thread_label ? { thread_label: input.thread_label } : {},
1183
1187
  ...input.silent ? { silent: true } : {}
1184
1188
  });
1185
1189
  }
@@ -1193,7 +1197,7 @@ var mdmAsAgentTools = [
1193
1197
  title: "Send DM as your agent",
1194
1198
  annotations: { readOnlyHint: false },
1195
1199
  requires: "network",
1196
- description: "Send a direct message AS ONE OF YOUR OWN AGENTS instead of as yourself. Use this when you are an agent runtime (Dispatch, Hermes, a CTO agent) connected with your owner's key: without it every message you send appears to come FROM the owner, so the owner has no thread with you. Names the agent by mosADD address, identity id or display name; `to` defaults to the key's owner. The server verifies you OWN that agent \u2014 speaking as someone else's agent, or as another person, is refused. Recipient must be a person: agent-to-agent DM stays blocked.",
1200
+ description: "Send a direct message AS ONE OF YOUR OWN AGENTS instead of as yourself. Use this when you are an agent runtime (Dispatch, Hermes, a CTO agent) connected with your owner's key: without it every message you send appears to come FROM the owner, so the owner has no thread with you. Names the agent by mosADD address, identity id or display name; `to` defaults to the key's owner. Optional `thread_label` selects a named thread (omit = MAIN unlabeled \u2014 required for King/SOVEREIGN until rename lands). The server verifies you OWN that agent \u2014 speaking as someone else's agent, or as another person, is refused. Recipient must be a person: agent-to-agent DM stays blocked.",
1197
1201
  inputSchema: mDM_send_as_agent_input,
1198
1202
  handler: mDM_send_as_agent
1199
1203
  },
@@ -1941,7 +1945,7 @@ var mIRC_post_message_input = z6.object({
1941
1945
  reply_to_id: z6.string().optional().describe("Optional id of the message being replied to."),
1942
1946
  space_id: z6.string().optional().describe("Optional backing space id. Resolved automatically from the channel if omitted."),
1943
1947
  agent: z6.string().max(200).optional().describe(
1944
- "Post AS ONE OF YOUR OWN AGENTS instead of as the key's owner \u2014 its mosADD address (marocain@mosadd.com), its identity id, or its display name. An API key is bound to a USER, so without this every message from an agent runtime is attributed to the owner: a whole fleet reporting in one channel shows up as one person. Same field name and same ownership rule as mDM_send_as_agent. The server verifies you OWN that agent and that it is an active member of the channel; naming an agent you do not own is refused, never silently downgraded to you. Omit it and attribution is unchanged."
1948
+ "Post AS ONE OF YOUR OWN AGENTS instead of as the key's owner \u2014 its mosADD address (<agent>@mosadd.com), its identity id, or its display name. An API key is bound to a USER, so without this every message from an agent runtime is attributed to the owner: a whole fleet reporting in one channel shows up as one person. Same field name and same ownership rule as mDM_send_as_agent. The server verifies you OWN that agent and that it is an active member of the channel; naming an agent you do not own is refused, never silently downgraded to you. Omit it and attribution is unchanged."
1945
1949
  )
1946
1950
  });
1947
1951
  var mIRC_list_messages_input = z6.object({
@@ -3367,7 +3371,7 @@ var comms_session_attach_input = z17.object({
3367
3371
  "Short name for THIS session, shown to the owner as who is holding the line (e.g. 'CTO \u2014 Claude Code', 'dispatcher \u2014 Cowork'). Defaults to the machine name."
3368
3372
  ),
3369
3373
  as_agent: z17.string().max(200).optional().describe(
3370
- "Speak as ONE OF THE OWNER'S AGENT LINES while holding the owner's key \u2014 its mosADD address (dispatcher@mosadd.com), identity id, or display name. Declares ONCE per session whose line this session speaks for: the gateway then signs your CHANNEL posts as that agent automatically (no per-post `agent` field needed), and that agent's cloud stand-in defers to you. The server verifies you OWN the agent; a stranger's agent is refused. Omit to claim the key's own line, exactly as before."
3374
+ "Speak as ONE OF THE OWNER'S AGENT LINES while holding the owner's key \u2014 its mosADD address (<agent>@mosadd.com), identity id, or display name. Declares ONCE per session whose line this session speaks for: the gateway then signs your CHANNEL posts as that agent automatically (no per-post `agent` field needed), and that agent's cloud stand-in defers to you. The server verifies you OWN the agent; a stranger's agent is refused. Omit to claim the key's own line, exactly as before."
3371
3375
  ),
3372
3376
  release: z17.boolean().optional().describe(
3373
3377
  "Hand the line back immediately instead of claiming it: stops this session's keep-alive, clears the liveness row (and any as_agent declaration this session made), so the 24/7 cloud stand-in resumes answering at once rather than after the hold expires. Call this when the session is finishing."
@@ -3462,7 +3466,7 @@ var presenceTools = [
3462
3466
  title: "Attach session to a line",
3463
3467
  annotations: { destructiveHint: false, idempotentHint: true },
3464
3468
  requires: "network",
3465
- description: "Claim a mosADD reply lane for the CURRENT agent session, so the 24/7 cloud stand-in stops answering in its place and the owner talks to you instead. Call it once at the start of a session; the hold renews itself while the session runs and lapses on its own if the session dies. Holding the OWNER's key while working as one of their agent lines? Pass as_agent:'<address of YOUR line>' (e.g. dispatcher@mosadd.com) \u2014 the gateway then signs your channel posts as that agent automatically for the whole session and silences that agent's stand-in; ownership is verified server-side. Pass release:true when finishing to hand everything back immediately. Owner-scoped: a session can only claim the account whose key it holds, or a line of an agent that account owns.",
3469
+ description: "Claim a mosADD reply lane for the CURRENT agent session, so the 24/7 cloud stand-in stops answering in its place and the owner talks to you instead. Call it once at the start of a session; the hold renews itself while the session runs and lapses on its own if the session dies. Holding the OWNER's key while working as one of their agent lines? Pass as_agent:'<address of YOUR line>' (e.g. <agent>@mosadd.com) \u2014 the gateway then signs your channel posts as that agent automatically for the whole session and silences that agent's stand-in; ownership is verified server-side. Pass release:true when finishing to hand everything back immediately. Owner-scoped: a session can only claim the account whose key it holds, or a line of an agent that account owns.",
3466
3470
  inputSchema: comms_session_attach_input,
3467
3471
  handler: comms_session_attach
3468
3472
  }
@@ -3960,7 +3964,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3960
3964
  // package.json
3961
3965
  var package_default = {
3962
3966
  name: "@mosadd/mcp",
3963
- version: "3.0.0-alpha.55",
3967
+ version: "3.0.0-alpha.56",
3964
3968
  mcpName: "io.github.hei33enberg/mosadd-mcp",
3965
3969
  description: "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions \u2014 85 tools \u2014 to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
3966
3970
  homepage: "https://github.com/Hei33enberg/mosADD-OS/tree/main/packages/mcp",
@@ -3969,7 +3973,7 @@ var package_default = {
3969
3973
  url: "https://github.com/Hei33enberg/mosADD-OS.git",
3970
3974
  directory: "packages/mcp"
3971
3975
  },
3972
- license: "Apache-2.0",
3976
+ license: "MIT",
3973
3977
  type: "module",
3974
3978
  main: "./dist/index.js",
3975
3979
  module: "./dist/index.js",
@@ -4132,7 +4136,7 @@ function createMosaddServer(options = {}) {
4132
4136
  // Human-facing identity of the server itself (initialize result). The icon URLs
4133
4137
  // point at the LIVE gateway origin on purpose: clients that honour serverInfo.icons
4134
4138
  // get the brand mark without scraping the favicon, and the files ship with
4135
- // apps/mcp-http/public (canon 08-26 — generated by m0ssad-3 scripts/
4139
+ // the gateway's public/ folder (canon 08-26 — generated by m0ssad-3 scripts/
4136
4140
  // generate-brand-icons.py, never hand-edited).
4137
4141
  title: "mosADD \u2014 omnichannel messenger for agents",
4138
4142
  websiteUrl: "https://mosadd.com",
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  createMosaddServer,
5
5
  defaultProviders,
6
6
  runWithSupabaseEnv
7
- } from "./chunk-IWUGKLDX.js";
7
+ } from "./chunk-T3KDVUAT.js";
8
8
  import "./chunk-Z7WR52GE.js";
9
9
  export {
10
10
  TOOL_COUNT,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mosadd/mcp",
3
- "version": "3.0.0-alpha.55",
3
+ "version": "3.0.0-alpha.56",
4
4
  "mcpName": "io.github.hei33enberg/mosadd-mcp",
5
5
  "description": "Model Context Protocol server for mosadd. Exposes 4 modules (mDM, mIRC, mURL, mAYL) and capabilities (mTALK, mRAG) plus comms agent-actions — 85 tools — to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
6
6
  "homepage": "https://github.com/Hei33enberg/mosADD-OS/tree/main/packages/mcp",
@@ -9,7 +9,7 @@
9
9
  "url": "https://github.com/Hei33enberg/mosADD-OS.git",
10
10
  "directory": "packages/mcp"
11
11
  },
12
- "license": "Apache-2.0",
12
+ "license": "MIT",
13
13
  "type": "module",
14
14
  "main": "./dist/index.js",
15
15
  "module": "./dist/index.js",
@@ -34,13 +34,6 @@
34
34
  "publishConfig": {
35
35
  "access": "public"
36
36
  },
37
- "scripts": {
38
- "build": "tsup src/index.ts src/bin/mcp.ts src/bin/login.ts --format esm --dts --clean --shims",
39
- "dev": "tsx src/bin/mcp.ts",
40
- "test": "vitest run",
41
- "typecheck": "tsc -p tsconfig.json --noEmit",
42
- "clean": "rm -rf dist .turbo"
43
- },
44
37
  "dependencies": {
45
38
  "@modelcontextprotocol/sdk": "^1.0.4",
46
39
  "@supabase/supabase-js": "^2.48.0",
@@ -69,5 +62,12 @@
69
62
  ],
70
63
  "engines": {
71
64
  "node": ">=18"
65
+ },
66
+ "scripts": {
67
+ "build": "tsup src/index.ts src/bin/mcp.ts src/bin/login.ts --format esm --dts --clean --shims",
68
+ "dev": "tsx src/bin/mcp.ts",
69
+ "test": "vitest run",
70
+ "typecheck": "tsc -p tsconfig.json --noEmit",
71
+ "clean": "rm -rf dist .turbo"
72
72
  }
73
- }
73
+ }