@mosadd/mcp 3.0.0-alpha.3 → 3.0.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +212 -0
- package/README.md +150 -116
- package/dist/bin/mcp.js +42 -3
- package/dist/chunk-6PGDNIKR.js +2556 -0
- package/dist/index.d.ts +99 -7
- package/dist/index.js +7 -3
- package/package.json +10 -7
- package/src/__tests__/golden-path.test.ts +137 -132
- package/src/__tests__/integration.test.ts +179 -175
- package/src/__tests__/mdm-e2ee.test.ts +212 -149
- package/src/__tests__/mtalk.test.ts +122 -0
- package/src/__tests__/server.test.ts +71 -67
- package/src/bin/login.ts +138 -138
- package/src/bin/mcp.ts +145 -97
- package/src/config.ts +66 -66
- package/src/crypto/mdm-session.ts +502 -378
- package/src/index.ts +19 -17
- package/src/observability/sentry.ts +79 -79
- package/src/providers/blob-upload.ts +116 -0
- package/src/providers/memory-voice.ts +79 -0
- package/src/providers/supabase-dm.ts +122 -117
- package/src/providers/supabase-voice.ts +91 -0
- package/src/providers/supabase.ts +148 -96
- package/src/server.ts +123 -103
- package/src/tools/actions.ts +162 -0
- package/src/tools/attachments.ts +268 -0
- package/src/tools/capabilities.ts +68 -68
- package/src/tools/embed.ts +108 -0
- package/src/tools/index.ts +104 -37
- package/src/tools/knowledge.ts +191 -0
- package/src/tools/mail-aliases.ts +25 -0
- package/src/tools/mail-provenance.ts +135 -0
- package/src/tools/mail.ts +381 -89
- package/src/tools/mcall.ts +216 -0
- package/src/tools/mdm-voice.ts +212 -0
- package/src/tools/mdm.ts +479 -379
- package/src/tools/mirc-edge.ts +190 -0
- package/src/tools/mirc-members.ts +198 -177
- package/src/tools/mirc-messages.ts +155 -0
- package/src/tools/mirc.ts +190 -170
- package/src/tools/mroom-messages.ts +142 -142
- package/src/tools/mroom.ts +221 -189
- package/src/tools/mtalk.ts +121 -0
- package/src/tools/murl.ts +298 -0
- package/src/tools/ptt-ingest.ts +97 -0
- package/src/tools/threat.ts +119 -0
- package/src/types.ts +94 -79
- package/src/voice/floor.ts +132 -0
- package/dist/chunk-HD5RLE5K.js +0 -1193
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
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 the `3.0.0-alpha.N` pre-release line until the hosted
|
|
7
|
+
gateway (Phase 2) ships.
|
|
8
|
+
|
|
9
|
+
## [Unreleased]
|
|
10
|
+
|
|
11
|
+
## [3.0.0-alpha.30] — 2026-07-17
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **`comms_embed_create` RE-REGISTERED — tool count 68 → 69.** The paste-in
|
|
15
|
+
live-channel widget is finally end-to-end real: `https://embed.mosadd.com/v1.js`
|
|
16
|
+
is deployed (served by the mosadd Vercel project; skins are inlined in the
|
|
17
|
+
bundle), and the whole backend (`embed-keys` publishable keys, `mirc-embed-token`
|
|
18
|
+
Origin-allowlisted 5-min JWTs with MAT plan tiers, `embed-plan-settings` PAYG,
|
|
19
|
+
GDPR `embed-dsr-delete`) was already live. The tool mints an `m_pk_live_…` key
|
|
20
|
+
and returns a `<script>` snippet with skin + position (incl. sidebar-left/right)
|
|
21
|
+
options. Part of the mURL→mIRC rework P3 ("open WWW channel: dedicated page +
|
|
22
|
+
branding + embed").
|
|
23
|
+
|
|
24
|
+
## [3.0.0-alpha.29] — 2026-07-17
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **mURL owner-side management — 3 new tools.** `mURL_create` (claim a domain channel and
|
|
28
|
+
become its owner; idempotent, 409 if another account owns it), `mURL_update` (set branding /
|
|
29
|
+
mark `claimed` / `blocked` to close / reopen as `open`), `mURL_delete` (remove a channel you
|
|
30
|
+
own). Wired to the deployed, owner-scoped `murl-manage` EF via the same user-JWT auth as
|
|
31
|
+
`mURL_list_channels action='mine'`. mURL goes from read-only (read/post/presence/list) to a
|
|
32
|
+
full lifecycle — an agent can now provision and manage a domain's room, not just chat in it.
|
|
33
|
+
- **`TOOL_COUNT` export** (`= allTools.length`) — one source of truth for the callable-tool
|
|
34
|
+
count, mirroring `@mosadd/threat-engine`'s `THREAT_EVENT_COUNT`. Docs reference it, not a
|
|
35
|
+
hand-typed number that drifts.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
- **Tool count corrected to 68** — it had been advertised inconsistently as "70+" / "65" across
|
|
39
|
+
READMEs, docs, registry submissions and the dev site. The registry holds exactly 68 callable
|
|
40
|
+
tools: mDM 14 · mIRC 22 · mURL 7 · mAYL 11 · mTALK 5 · mRAG 4 · comms_ 3 · Irondome (`threat_*`) 2.
|
|
41
|
+
Also fixed two stale claims in the reference table: `threat_*` IS registered (was labelled
|
|
42
|
+
"unregistered"), and the `mp0st_*` mAYL aliases are retired (were claimed as still functioning).
|
|
43
|
+
|
|
44
|
+
## [3.0.0-alpha.23] — 2026-06-26
|
|
45
|
+
|
|
46
|
+
Toolkit hardening pass: every registered tool's request/response contract was
|
|
47
|
+
adversarially verified against the deployed edge functions. Two tools were broken on
|
|
48
|
+
every call; the rest had silent field drops, wrong results, or a confidentiality/access gap.
|
|
49
|
+
|
|
50
|
+
### Fixed
|
|
51
|
+
- **Edge-function errors are now legible.** `invokeFunction` only ever surfaced the fixed
|
|
52
|
+
string "Edge Function returned a non-2xx status code"; the real reason lives in
|
|
53
|
+
`error.context`. It now reads that body (and the HTTP status), so every EF-backed tool
|
|
54
|
+
returns an actionable error the agent can act on — the single highest-impact fix.
|
|
55
|
+
- **mDM_edit no longer strips E2EE.** It used to store a server-readable plaintext body even
|
|
56
|
+
on an E2EE thread (and the forward-only ratchet means an edit can't be re-sealed). It now
|
|
57
|
+
refuses to edit E2EE messages (use delete + re-send) and only edits legacy plaintext.
|
|
58
|
+
- **mp0st_send cc/bcc/reply_to are actually delivered** — the backend dropped them silently;
|
|
59
|
+
now forwarded to the mail provider (edge-function fix, deployed).
|
|
60
|
+
- **mDM call rooms are access-gated (security)** — call-room tokens were mintable by any
|
|
61
|
+
authenticated user who learned the room name; the backend now restricts them to the two
|
|
62
|
+
participants, and the room name is per-pair so the gate is robust (edge-function fix, deployed).
|
|
63
|
+
- **mDM_call_end / mDM_voice_note** now return the real message id (was always undefined).
|
|
64
|
+
- **mp0st_view** no longer advertises a `received_at` field the backend doesn't return (it's `sent_at`).
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
- **Unregistered `comms_embed_create`** — its `embed-keys` edge function isn't deployed (404
|
|
68
|
+
on every call) and the embed surface is parked. Tool count **62 → 61**. Re-register when the
|
|
69
|
+
backend + widget ship.
|
|
70
|
+
- **mIRC tools stop advertising fields the backend ignores.** Removed: `mIRC_kick` `reason`,
|
|
71
|
+
`mIRC_request_access` `message`, `mIRC_ban` `reason`+`until` (the latter silently made a
|
|
72
|
+
"temporary" ban permanent), and `access_mode` on `mIRC_update`/`mIRC_list` (no-ops). Added
|
|
73
|
+
`wrapped_group_key` to `mIRC_create`/`mIRC_approve_request` so E2EE (password/private)
|
|
74
|
+
channels are honestly callable. Descriptions corrected to match.
|
|
75
|
+
- **mp0st_consent** now fails fast client-side when `check`/`optin` is missing a recipient.
|
|
76
|
+
|
|
77
|
+
### Verified (no changes needed)
|
|
78
|
+
- Install/boot, full build + typecheck across all packages, dependency-export resolution, and
|
|
79
|
+
the mDM X3DH + Double-Ratchet crypto round-trip all pass.
|
|
80
|
+
|
|
81
|
+
## [3.0.0-alpha.22] — 2026-06-26
|
|
82
|
+
|
|
83
|
+
### Fixed
|
|
84
|
+
- **alpha.21 was broken on a fresh install** — it crashed on startup with
|
|
85
|
+
`SyntaxError: The requested module '@mosadd/crypto' does not provide an export named
|
|
86
|
+
'initRatchetInitiator'`. The workspace dependency packages (`@mosadd/crypto`, `protocol`,
|
|
87
|
+
`providers`, `threat-engine`) had drifted: their *source* gained new exports (the mDM
|
|
88
|
+
Double-Ratchet work) but their version was never bumped, so npm still served the stale
|
|
89
|
+
alpha.4/alpha.5 builds while `@mosadd/mcp` was built against the newer API. Bumped the whole
|
|
90
|
+
alpha-line in lockstep to alpha.22 and republished so every published package matches current
|
|
91
|
+
source and `workspace:*` cross-deps resolve. Verified: a clean `npm i @mosadd/mcp@alpha`
|
|
92
|
+
now boots and lists 62 tools. (The previous alpha.20 was broken-on-install the same way.)
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
- **Unregistered 2 scaffold tools that failed on every call.** `mp0st_send_as_agent`
|
|
96
|
+
(POSTed to a non-existent `hub-claim-mint` endpoint → 404, and sent provenance body
|
|
97
|
+
fields the deployed `mp0st-send` EF never reads) and `mTALK_ingest_ptt` (request body
|
|
98
|
+
didn't match the deployed `ptt-ingest` EF → 400). Both are now commented out in
|
|
99
|
+
`tools/index.ts` like the other not-registered modules, so an agent only ever discovers
|
|
100
|
+
tools that actually work. Registered tool count **64 → 62** (mp0st 12→11, mTALK 6→5).
|
|
101
|
+
Source is kept; both re-register once their backend contracts are wired + tested.
|
|
102
|
+
|
|
103
|
+
### Fixed
|
|
104
|
+
- **mIRC `reject_request` / `approve_request` field (LINEAR-3522):** the tools sent
|
|
105
|
+
`request_id` but `channel-members-manage` reads `target_identity_id` → 400 every
|
|
106
|
+
call. Renamed to `identity_id` (normalized to `target_identity_id`). `reject` now
|
|
107
|
+
works; `approve` of an E2EE channel still needs a wrapped group key (LINEAR-3523).
|
|
108
|
+
- **mDM / mIRC message pagination (LINEAR-3524):** `mDM_list` read `cursor`/`has_more`
|
|
109
|
+
but `message-list` history mode returns `next_before`, and `mIRC_list_messages`
|
|
110
|
+
sent `cursor` (ignored; EF reads `before`) and read `next_cursor` (never returned)
|
|
111
|
+
→ neither paged past page 1. Send `before`, read `next_before`.
|
|
112
|
+
|
|
113
|
+
## [3.0.0-alpha.19] — 2026-06-19
|
|
114
|
+
|
|
115
|
+
### Removed
|
|
116
|
+
- **BREAKING — mROOM module killed (LINEAR-3414):** the 11 `mROOM_*` tools
|
|
117
|
+
(`mROOM_create`, `mROOM_create_guest_link`, `mROOM_join`, `mROOM_leave`,
|
|
118
|
+
`mROOM_close`, `mROOM_list`, `mROOM_voice_join`, `mROOM_send_message`,
|
|
119
|
+
`mROOM_list_messages`, `mROOM_send_voice`, `mROOM_send_file`) are no longer
|
|
120
|
+
registered. Ephemeral private rooms are re-cut into private mIRC channels.
|
|
121
|
+
The source stays in `tools/mroom*.ts` (unregistered, like mURL/mCALL).
|
|
122
|
+
|
|
123
|
+
### Added
|
|
124
|
+
- **Defensive threat engine as MCP tools (LINEAR-3498):** `threat_catalog`
|
|
125
|
+
(list the canonical 160+ threat-event taxonomy) and `threat_classify`
|
|
126
|
+
(pure `evaluateEvent` decision → action/severity/reason). Wraps
|
|
127
|
+
`@mosadd/threat-engine`; deterministic, offline, `requires: "any"`.
|
|
128
|
+
|
|
129
|
+
Net: 70 → **64 callable tools** across 5 live modules + comms + threat.
|
|
130
|
+
|
|
131
|
+
### Changed
|
|
132
|
+
- **BREAKING — mail tool rename:** the 12 email MCP tools are renamed
|
|
133
|
+
`mAIL_*` → `mp0st_*` (`mp0st_list`, `mp0st_send`, `mp0st_view`, `mp0st_delete`,
|
|
134
|
+
`mp0st_stats`, `mp0st_events`, `mp0st_metrics`, `mp0st_revoke`,
|
|
135
|
+
`mp0st_audit_export`, `mp0st_consent`, `mp0st_notify`, `mp0st_send_as_agent`).
|
|
136
|
+
No aliases — the old `mAIL_*` names no longer resolve. Backend Edge Functions
|
|
137
|
+
(`mp0st-*`) are unchanged.
|
|
138
|
+
|
|
139
|
+
## [3.0.0-alpha.18] — 2026-06-18
|
|
140
|
+
|
|
141
|
+
### Added
|
|
142
|
+
- **`comms_embed_create`** — embed a LIVE mosadd channel into an app/site a builder-agent is
|
|
143
|
+
generating (Lovable / Bolt / Cursor / v0). Mints a publishable embed key (`m_pk_live_…`,
|
|
144
|
+
origin-scoped, via the `embed-keys` EF) and returns a paste-in widget snippet
|
|
145
|
+
(`<div>` + `<script src="https://embed.mosadd.com/v1.js" data-key=…>`). The widget exchanges
|
|
146
|
+
the publishable key for a short-lived channel-scoped JWT at runtime; the hub key never enters
|
|
147
|
+
the browser. Extends `mROOM_create_guest_link` (link → embeddable widget). CDN override via
|
|
148
|
+
`MOSADD_EMBED_CDN`. (Widget served from the dedicated `embed.mosadd.com` deploy.)
|
|
149
|
+
|
|
150
|
+
## [3.0.0-alpha.17] — 2026-06-18
|
|
151
|
+
|
|
152
|
+
### Added
|
|
153
|
+
- **Action Links — screen share.** `comms_action_create` gains a `screen_share` action
|
|
154
|
+
type, and a new `comms_action_frame_get` tool lets the creating agent read frames of the
|
|
155
|
+
recipient's shared screen (consent-gated, browser-sandbox only). Turns Action Links into
|
|
156
|
+
"remote-desktop-lite" — the agent sees what the human chooses to share.
|
|
157
|
+
|
|
158
|
+
### Changed
|
|
159
|
+
- **Durable `mosadd login`.** The saved session (`~/.mosadd/session.json`) is now refreshed
|
|
160
|
+
from its refresh token at server boot, so a single `mosadd login` keeps working across
|
|
161
|
+
restarts — no more re-login when the access token expires.
|
|
162
|
+
- Onboarding README restructured (recommended auth path — `mosadd login` — first; hub API
|
|
163
|
+
key second; DevTools JWT demoted), and the 61→70 / `mosadd.dev`→`mosadd.com` reconciliation
|
|
164
|
+
(first shipped on the published package with this release).
|
|
165
|
+
|
|
166
|
+
## [3.0.0-alpha.16] — 2026-06-17
|
|
167
|
+
|
|
168
|
+
### Fixed
|
|
169
|
+
- `mAIL_view` now calls the `mp0st-get` Edge Function (read a message by id,
|
|
170
|
+
owner-scoped) instead of `mp0st-view` (the tracking-pixel endpoint, which
|
|
171
|
+
returned "Missing tracking ID"). ([LINEAR-2917])
|
|
172
|
+
- CI publish drops `--provenance` — npm returned 422 because the source repo
|
|
173
|
+
(`mosadd-os`) is private, so provenance attestation is not available.
|
|
174
|
+
|
|
175
|
+
### Added (cumulative since alpha.4 — tool count 61 → 70)
|
|
176
|
+
- **Action links (Tier 1):** `comms_action_create` mints a one-link browser
|
|
177
|
+
action an agent can hand to a human (run-with-consent in the mosadd sandbox).
|
|
178
|
+
- **mAIL provenance:** `mAIL_send_as_agent` stamps agent/human provenance on the
|
|
179
|
+
message so the recipient sees who actually sent it.
|
|
180
|
+
- **File & voice attachments:** `mDM_send_voice` / `mDM_send_file`,
|
|
181
|
+
`mROOM_send_voice` / `mROOM_send_file`, `mIRC_send_voice` / `mIRC_send_file`
|
|
182
|
+
(reuse the existing `chat-files` bucket — no new transport).
|
|
183
|
+
- **mTALK → RAG:** `mTALK_ingest_ptt` feeds push-to-talk audio into the RAG index
|
|
184
|
+
(opt-in, gated server-side).
|
|
185
|
+
- **mROOM:** `mROOM_create_guest_link` (single-call, no-account guest links) and
|
|
186
|
+
`mROOM_voice_join`.
|
|
187
|
+
- **mIRC edge transport:** `mIRC_mint_channel_token`, `mIRC_send_edge`,
|
|
188
|
+
`mIRC_history_edge` — the low-latency path the agent-coordination skill rides.
|
|
189
|
+
|
|
190
|
+
### Changed
|
|
191
|
+
- README, `package.json`, and the plugin `marketplace.json` reconciled to the
|
|
192
|
+
current surface: **70 tools across 6 modules** + `comms_capabilities`
|
|
193
|
+
discovery (71 callable), version `alpha.16`, and `mosadd.dev` → `mosadd.com`
|
|
194
|
+
(the dev surface was consolidated into the main site). ([LINEAR-3391])
|
|
195
|
+
- `mCALL` (telephony, carrier-pending) and `mURL` (brand/consumer surface)
|
|
196
|
+
remain **unregistered** in `tools/index.ts` — an agent only ever discovers
|
|
197
|
+
tools that actually work.
|
|
198
|
+
|
|
199
|
+
## [3.0.0-alpha.4]
|
|
200
|
+
|
|
201
|
+
### Added
|
|
202
|
+
- Initial public alpha: **61 tools across 6 live modules** — mDM (incl. voice),
|
|
203
|
+
mIRC, mROOM, mAIL, mTALK, mRAG — plus the `comms_capabilities` discovery tool.
|
|
204
|
+
- BYOK mode: the server talks to your own mosadd Supabase backend via
|
|
205
|
+
`MOSADD_SUPABASE_URL` / `MOSADD_SUPABASE_ANON_KEY` / `MOSADD_USER_JWT`.
|
|
206
|
+
- Apache-2.0 license; tool names follow [RFC 0001] (`m<MODULE>_<operation>`).
|
|
207
|
+
|
|
208
|
+
[3.0.0-alpha.16]: https://github.com/Hei33enberg/mosadd-os/tree/main/packages/mcp
|
|
209
|
+
[3.0.0-alpha.4]: https://github.com/Hei33enberg/mosadd-os/tree/main/packages/mcp
|
|
210
|
+
[LINEAR-2917]: https://linear.app/ip-ra/issue/LINEAR-2917
|
|
211
|
+
[LINEAR-3391]: https://linear.app/ip-ra/issue/LINEAR-3391
|
|
212
|
+
[RFC 0001]: https://github.com/Hei33enberg/mosadd-os/blob/main/docs/rfcs/0001-module-naming.md
|
package/README.md
CHANGED
|
@@ -1,116 +1,150 @@
|
|
|
1
|
-
# @mosadd/mcp
|
|
2
|
-
|
|
3
|
-
MCP server for [
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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, 69 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
|
+
> **69 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 69 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
|
+
**69 tools** — 4 modules (mDM, mIRC, mURL, mAYL) + capabilities (mTALK voice, mRAG search, comms agent-actions) + the `comms_capabilities` discovery tool. Highlights per module:
|
|
71
|
+
|
|
72
|
+
| Module | Tools | What it does |
|
|
73
|
+
|---|---|---|
|
|
74
|
+
| **mDM** (14) | `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** (22) | `mIRC_create/list/get/update/delete`, member RBAC (`mIRC_join/leave/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** (11) | `mAYL_send`, `mAYL_view`, `mAYL_list`, `mAYL_delete`, `mAYL_stats`, `mAYL_events`, `mAYL_metrics`, `mAYL_revoke`, `mAYL_audit_export`, `mAYL_consent`, `mAYL_notify` | Mail; every user gets `<id>@mosadd.com`. 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** (5) | `mTALK_open`, `mTALK_join`, `mTALK_press`, `mTALK_release`, `mTALK_state` | Half-duplex push-to-talk: one speaker, FIFO queue, anti-hog auto-release |
|
|
79
|
+
| **mRAG** (4) | `mRAG_ingest`, `mRAG_search`, `mRAG_list_sources`, `mRAG_delete` | RAG recall over the user's own data (hybrid vector + BM25) |
|
|
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 166-event threat taxonomy — pure, offline, no backend and no surveillance. The engine decides, the caller acts |
|
|
82
|
+
|
|
83
|
+
Module tools: mDM (14) + mIRC (22) + mURL (7) + mAYL (11) = 54; capabilities: mTALK (5) + mRAG (4) + comms_ (4, incl. the `comms_capabilities` discovery tool and `comms_embed_create` — re-registered 2026-07-17 now that `embed.mosadd.com/v1.js` is live) + Irondome (2) = 15 — **69 callable tools** in total. 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`). Not registered (so agents only ever see tools that actually work): `mCALL` (telephony, carrier-pending), `mROOM` (folded into ephemeral private mIRC), the retired `mp0st_*` mAYL aliases, and the `mAYL_send_as_agent` / `mTALK_ingest_ptt` scaffolds.
|
|
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 (deprecated `mp0st_*` aliases still function) | 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).
|
package/dist/bin/mcp.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
createMosaddServer
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import
|
|
4
|
+
} from "../chunk-6PGDNIKR.js";
|
|
5
|
+
import {
|
|
6
|
+
isSessionExpired,
|
|
7
|
+
loadSession,
|
|
8
|
+
saveSession
|
|
9
|
+
} from "../chunk-Z7WR52GE.js";
|
|
6
10
|
|
|
7
11
|
// src/bin/mcp.ts
|
|
8
12
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
13
|
+
import { createClient } from "@supabase/supabase-js";
|
|
9
14
|
var DEFAULT_EXCHANGE = "https://rooffhgbxafyjcwmwpsy.supabase.co/functions/v1/hub-key-exchange";
|
|
10
15
|
async function bootstrapFromApiKey() {
|
|
11
16
|
const apiKey = process.env.MOSADD_API_KEY;
|
|
@@ -33,6 +38,36 @@ async function bootstrapFromApiKey() {
|
|
|
33
38
|
);
|
|
34
39
|
}
|
|
35
40
|
}
|
|
41
|
+
async function bootstrapFromSavedSession() {
|
|
42
|
+
if (process.env.MOSADD_USER_JWT) return;
|
|
43
|
+
const session = loadSession();
|
|
44
|
+
if (!session?.refreshToken) return;
|
|
45
|
+
if (!isSessionExpired(session)) return;
|
|
46
|
+
try {
|
|
47
|
+
const client = createClient(session.url, session.anonKey, {
|
|
48
|
+
auth: { persistSession: false, autoRefreshToken: false, detectSessionInUrl: false }
|
|
49
|
+
});
|
|
50
|
+
const { data, error } = await client.auth.refreshSession({ refresh_token: session.refreshToken });
|
|
51
|
+
if (error || !data.session) {
|
|
52
|
+
process.stderr.write(
|
|
53
|
+
JSON.stringify({ level: "warn", msg: "mosadd session refresh failed \u2014 run `mosadd login`", error: error?.message }) + "\n"
|
|
54
|
+
);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
saveSession({
|
|
58
|
+
url: session.url,
|
|
59
|
+
anonKey: session.anonKey,
|
|
60
|
+
accessToken: data.session.access_token,
|
|
61
|
+
refreshToken: data.session.refresh_token ?? session.refreshToken,
|
|
62
|
+
expiresAt: data.session.expires_at,
|
|
63
|
+
email: data.user?.email ?? session.email
|
|
64
|
+
});
|
|
65
|
+
} catch (err) {
|
|
66
|
+
process.stderr.write(
|
|
67
|
+
JSON.stringify({ level: "warn", msg: "mosadd session refresh error \u2014 run `mosadd login`", error: String(err) }) + "\n"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
36
71
|
async function main() {
|
|
37
72
|
const sub = process.argv[2];
|
|
38
73
|
if (sub === "login" || sub === "logout" || sub === "whoami") {
|
|
@@ -41,11 +76,15 @@ async function main() {
|
|
|
41
76
|
return;
|
|
42
77
|
}
|
|
43
78
|
await bootstrapFromApiKey();
|
|
79
|
+
await bootstrapFromSavedSession();
|
|
44
80
|
const server = createMosaddServer({
|
|
45
81
|
apiKey: process.env.MOSADD_API_KEY,
|
|
46
82
|
hubUrl: process.env.MOSADD_HUB_URL,
|
|
47
83
|
mode: process.env.MOSADD_MODE,
|
|
48
|
-
logLevel: process.env.MOSADD_LOG_LEVEL
|
|
84
|
+
logLevel: process.env.MOSADD_LOG_LEVEL,
|
|
85
|
+
// stdio is single-tenant: the session lives in env (set by bootstrapFromApiKey
|
|
86
|
+
// above), so auto-publish this identity's prekeys on boot → mDM is reachable.
|
|
87
|
+
autoPublishKeys: true
|
|
49
88
|
});
|
|
50
89
|
const transport = new StdioServerTransport();
|
|
51
90
|
await server.connect(transport);
|