@mosadd/mcp 3.0.0-alpha.6 → 3.0.0-alpha.7

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/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
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.
4
4
 
5
- > **3.0.0-alpha.4** — **52 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
+ > **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.
6
6
 
7
7
  ## Install
8
8
 
@@ -53,7 +53,7 @@ In Phase 2, run `mosadd login` to OAuth into hub.mosadd.com — no JWT-juggling
53
53
 
54
54
  ## Tools shipped in alpha
55
55
 
56
- **52 live tools across 6 live modules** (mDM, mIRC, mROOM, mAIL, mTALK, mRAG) + the `comms_capabilities` discovery tool. Highlights per module:
56
+ **57 live tools across 6 live modules** (mDM, mIRC, mROOM, mAIL, mTALK, mRAG) + the `comms_capabilities` discovery tool. Highlights per module:
57
57
 
58
58
  | Module | Tools | What it does |
59
59
  |---|---|---|
@@ -61,8 +61,8 @@ In Phase 2, run `mosadd login` to OAuth into hub.mosadd.com — no JWT-juggling
61
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
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
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** (4) | `mAIL_send`, `mAIL_view`, `mAIL_list`, `mAIL_delete` | Mail; every user gets `<id>@mosadd.com` |
65
- | **mRAG** (2) | `mRAG_ingest`, `mRAG_search` | RAG recall over the user's own data (hybrid vector + BM25) |
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) |
66
66
 
67
67
  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
68
 
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-KAPG5FBN.js";
4
+ } from "../chunk-EFTB743G.js";
5
5
  import "../chunk-Z7WR52GE.js";
6
6
 
7
7
  // src/bin/mcp.ts
@@ -1382,6 +1382,13 @@ var mAIL_list_input = z9.object({
1382
1382
  limit: z9.number().int().min(1).max(200).optional().describe("Max emails to return. Default 50."),
1383
1383
  before: z9.string().optional().describe("Pagination cursor: pass the previous response's next_cursor to get the next (older) page.")
1384
1384
  });
1385
+ var mAIL_stats_input = z9.object({
1386
+ message_id: MessageId
1387
+ });
1388
+ var mAIL_events_input = z9.object({
1389
+ message_id: MessageId
1390
+ });
1391
+ var mAIL_metrics_input = z9.object({});
1385
1392
  async function mAIL_send(input, ctx) {
1386
1393
  readSupabaseEnv();
1387
1394
  if (!input.body_text && !input.body_html) {
@@ -1411,6 +1418,23 @@ async function mAIL_delete(input, ctx) {
1411
1418
  message_id: input.message_id
1412
1419
  });
1413
1420
  }
1421
+ async function mAIL_stats(input, ctx) {
1422
+ readSupabaseEnv();
1423
+ ctx.log("debug", "mAIL_stats invoking mp0st-stats", { message_id: input.message_id });
1424
+ return await invokeFunction("mp0st-stats", {
1425
+ message_id: input.message_id
1426
+ });
1427
+ }
1428
+ async function mAIL_events(input, ctx) {
1429
+ readSupabaseEnv();
1430
+ ctx.log("debug", "mAIL_events invoking mp0st-stats", { message_id: input.message_id });
1431
+ return await invokeFunction("mp0st-stats", { message_id: input.message_id, events: true });
1432
+ }
1433
+ async function mAIL_metrics(_input, ctx) {
1434
+ readSupabaseEnv();
1435
+ ctx.log("debug", "mAIL_metrics invoking mp0st-stats");
1436
+ return await invokeFunction("mp0st-stats", {});
1437
+ }
1414
1438
  var mailTools = [
1415
1439
  {
1416
1440
  name: "mAIL_list",
@@ -1439,6 +1463,27 @@ var mailTools = [
1439
1463
  description: "Delete one of the user's emails by message_id (from mAIL_list). Soft-delete \u2014 it stops showing in mAIL_list. Owner-scoped: only your own mail.",
1440
1464
  inputSchema: mAIL_delete_input,
1441
1465
  handler: mAIL_delete
1466
+ },
1467
+ {
1468
+ name: "mAIL_stats",
1469
+ requires: "network",
1470
+ description: "Engagement summary for one sent email (by message_id): open_count, unique_opens, click_count, whether it was likely forwarded, first/last opened time, and a breakdown of tracked event types. Opens/clicks are real (tracking pixel + link-wrap); forward detection is best-effort (IP-subnet diversity). Owner-scoped.",
1471
+ inputSchema: mAIL_stats_input,
1472
+ handler: mAIL_stats
1473
+ },
1474
+ {
1475
+ name: "mAIL_events",
1476
+ requires: "network",
1477
+ description: "Raw engagement timeline for one email (by message_id): every tracked event (pixel_open, link_click, forwarded, page_view, copy/print/focus signals) with timestamp, device type and link URL. Use mAIL_stats for the rollup; use this for the per-event detail. Owner-scoped.",
1478
+ inputSchema: mAIL_events_input,
1479
+ handler: mAIL_events
1480
+ },
1481
+ {
1482
+ name: "mAIL_metrics",
1483
+ requires: "network",
1484
+ description: "Mailbox-wide engagement aggregate across the user's sent mail: total_sent, opened_emails, open_rate_pct, total_opens, total_clicks, forwarded_emails. Owner-scoped.",
1485
+ inputSchema: mAIL_metrics_input,
1486
+ handler: mAIL_metrics
1442
1487
  }
1443
1488
  ];
1444
1489
 
@@ -1558,6 +1603,27 @@ async function mRAG_ingest(input, ctx) {
1558
1603
  });
1559
1604
  return { indexed: data.indexed ?? 0, chunk_count: data.chunk_count ?? 0 };
1560
1605
  }
1606
+ var mRAG_list_sources_input = z11.object({});
1607
+ async function mRAG_list_sources(_input, ctx) {
1608
+ readSupabaseEnv();
1609
+ ctx.log("debug", "mRAG_list_sources via rag-sources");
1610
+ return await invokeFunction("rag-sources", { action: "list" });
1611
+ }
1612
+ var mRAG_delete_input = z11.object({
1613
+ source_id: z11.string().optional().describe("Delete every indexed chunk with this source_id (from mRAG_list_sources)."),
1614
+ thread_id: z11.string().optional().describe("Delete every indexed chunk associated with this thread_id.")
1615
+ }).refine((v) => v.source_id || v.thread_id, {
1616
+ message: "Provide source_id or thread_id \u2014 mRAG_delete refuses to purge the whole index."
1617
+ });
1618
+ async function mRAG_delete(input, ctx) {
1619
+ readSupabaseEnv();
1620
+ ctx.log("debug", "mRAG_delete via rag-sources", { source_id: input.source_id, thread_id: input.thread_id });
1621
+ return await invokeFunction("rag-sources", {
1622
+ action: "delete",
1623
+ source_id: input.source_id ?? null,
1624
+ thread_id: input.thread_id ?? null
1625
+ });
1626
+ }
1561
1627
  var knowledgeTools = [
1562
1628
  {
1563
1629
  name: "mRAG_ingest",
@@ -1572,6 +1638,20 @@ var knowledgeTools = [
1572
1638
  description: "Search and answer questions over the USER'S OWN mosadd data (messages, emails, calls, notes) with a private per-user RAG index \u2014 hybrid vector + keyword retrieval, reranked, grounded in cited sources (no fabrication). Use it to recall 'what did X say about Y', summarize a thread, or pull facts the user has received. Returns an answer plus the source snippets it used. This is agent memory (mRAG = RAG over your own data) over the user's communications, available outside the mosadd app. NOTE: RAG requires content to be indexed server-side in plaintext, so anything searchable here is NOT covered by the zero-knowledge / E2EE guarantee \u2014 only data the user has explicitly opted into indexing is searchable. See docs/security/e2ee-posture.md.",
1573
1639
  inputSchema: mRAG_search_input,
1574
1640
  handler: mRAG_search
1641
+ },
1642
+ {
1643
+ name: "mRAG_list_sources",
1644
+ requires: "network",
1645
+ description: "List what is currently indexed in the user's private knowledge base, grouped by source (source_type, source_id, thread_id, title) with per-source chunk counts and first/last indexed timestamps. Use it to see what mRAG_search can recall, and to find a source_id to remove with mRAG_delete. Owner-scoped.",
1646
+ inputSchema: mRAG_list_sources_input,
1647
+ handler: mRAG_list_sources
1648
+ },
1649
+ {
1650
+ name: "mRAG_delete",
1651
+ requires: "network",
1652
+ description: "Remove indexed content from the user's knowledge base by source_id or thread_id (from mRAG_list_sources). Deletes every embedded chunk for that source so mRAG_search can no longer recall it. Requires source_id or thread_id (will not purge the whole index). Returns the number of chunks deleted. Owner-scoped.",
1653
+ inputSchema: mRAG_delete_input,
1654
+ handler: mRAG_delete
1575
1655
  }
1576
1656
  ];
1577
1657
 
package/dist/index.d.ts CHANGED
@@ -186,7 +186,7 @@ declare function createMosaddServer(options?: MosaddServerOptions): McpServer;
186
186
  /**
187
187
  * Tool registry. Each m* module contributes a set of tools.
188
188
  *
189
- * Live modules (6): mDM, mIRC, mROOM, mTALK, mAIL, mRAG — 52 tools + comms_capabilities.
189
+ * Live modules (6): mDM, mIRC, mROOM, mTALK, mAIL, mRAG — 57 tools + comms_capabilities.
190
190
  * mCALL is carrier-pending (no telephony carrier live yet): its tools live in
191
191
  * tools/mcall.ts but are NOT registered here, so an agent only ever discovers
192
192
  * tools that actually work. Re-register the one line below when a carrier ships.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  createMosaddServer,
4
4
  defaultProviders,
5
5
  runWithSupabaseEnv
6
- } from "./chunk-KAPG5FBN.js";
6
+ } from "./chunk-EFTB743G.js";
7
7
  import "./chunk-Z7WR52GE.js";
8
8
  export {
9
9
  allTools,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mosadd/mcp",
3
- "version": "3.0.0-alpha.6",
4
- "description": "Model Context Protocol server for mosadd. Exposes the 6 live m* modules (mDM, mIRC, mROOM, mTALK, mAIL, mRAG) — 52 tools — to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
3
+ "version": "3.0.0-alpha.7",
4
+ "description": "Model Context Protocol server for mosadd. Exposes the 6 live m* modules (mDM, mIRC, mROOM, mTALK, mAIL, mRAG) — 57 tools — to any agent runtime (Claude Code, Cursor, Windsurf, Cline, ChatGPT Apps, Lovable, Bolt, Goose, Manus, custom).",
5
5
  "homepage": "https://github.com/Hei33enberg/mosadd-os/tree/main/packages/mcp",
6
6
  "repository": {
7
7
  "type": "git",
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Tool registry. Each m* module contributes a set of tools.
3
3
  *
4
- * Live modules (6): mDM, mIRC, mROOM, mTALK, mAIL, mRAG — 52 tools + comms_capabilities.
4
+ * Live modules (6): mDM, mIRC, mROOM, mTALK, mAIL, mRAG — 57 tools + comms_capabilities.
5
5
  * mCALL is carrier-pending (no telephony carrier live yet): its tools live in
6
6
  * tools/mcall.ts but are NOT registered here, so an agent only ever discovers
7
7
  * tools that actually work. Re-register the one line below when a carrier ships.
@@ -112,6 +112,49 @@ async function mRAG_ingest(
112
112
  return { indexed: data.indexed ?? 0, chunk_count: data.chunk_count ?? 0 };
113
113
  }
114
114
 
115
+ const mRAG_list_sources_input = z.object({});
116
+
117
+ interface RagSourceEntry {
118
+ source_type: string;
119
+ source_id: string | null;
120
+ thread_id: string | null;
121
+ title: string | null;
122
+ chunks: number;
123
+ first_indexed: string;
124
+ last_indexed: string;
125
+ }
126
+
127
+ async function mRAG_list_sources(
128
+ _input: z.infer<typeof mRAG_list_sources_input>,
129
+ ctx: MosaddToolContext,
130
+ ): Promise<{ sources: RagSourceEntry[]; total_sources: number; total_chunks: number }> {
131
+ readSupabaseEnv();
132
+ ctx.log("debug", "mRAG_list_sources via rag-sources");
133
+ return await invokeFunction("rag-sources", { action: "list" });
134
+ }
135
+
136
+ const mRAG_delete_input = z
137
+ .object({
138
+ source_id: z.string().optional().describe("Delete every indexed chunk with this source_id (from mRAG_list_sources)."),
139
+ thread_id: z.string().optional().describe("Delete every indexed chunk associated with this thread_id."),
140
+ })
141
+ .refine((v) => v.source_id || v.thread_id, {
142
+ message: "Provide source_id or thread_id — mRAG_delete refuses to purge the whole index.",
143
+ });
144
+
145
+ async function mRAG_delete(
146
+ input: z.infer<typeof mRAG_delete_input>,
147
+ ctx: MosaddToolContext,
148
+ ): Promise<{ ok: true; deleted: number; source_id: string | null; thread_id: string | null }> {
149
+ readSupabaseEnv();
150
+ ctx.log("debug", "mRAG_delete via rag-sources", { source_id: input.source_id, thread_id: input.thread_id });
151
+ return await invokeFunction("rag-sources", {
152
+ action: "delete",
153
+ source_id: input.source_id ?? null,
154
+ thread_id: input.thread_id ?? null,
155
+ });
156
+ }
157
+
115
158
  export const knowledgeTools: MosaddTool[] = [
116
159
  {
117
160
  name: "mRAG_ingest",
@@ -129,4 +172,20 @@ export const knowledgeTools: MosaddTool[] = [
129
172
  inputSchema: mRAG_search_input,
130
173
  handler: mRAG_search as MosaddTool["handler"],
131
174
  },
175
+ {
176
+ name: "mRAG_list_sources",
177
+ requires: "network",
178
+ description:
179
+ "List what is currently indexed in the user's private knowledge base, grouped by source (source_type, source_id, thread_id, title) with per-source chunk counts and first/last indexed timestamps. Use it to see what mRAG_search can recall, and to find a source_id to remove with mRAG_delete. Owner-scoped.",
180
+ inputSchema: mRAG_list_sources_input,
181
+ handler: mRAG_list_sources as MosaddTool["handler"],
182
+ },
183
+ {
184
+ name: "mRAG_delete",
185
+ requires: "network",
186
+ description:
187
+ "Remove indexed content from the user's knowledge base by source_id or thread_id (from mRAG_list_sources). Deletes every embedded chunk for that source so mRAG_search can no longer recall it. Requires source_id or thread_id (will not purge the whole index). Returns the number of chunks deleted. Owner-scoped.",
188
+ inputSchema: mRAG_delete_input,
189
+ handler: mRAG_delete as MosaddTool["handler"],
190
+ },
132
191
  ];
package/src/tools/mail.ts CHANGED
@@ -53,6 +53,16 @@ const mAIL_list_input = z.object({
53
53
  .describe("Pagination cursor: pass the previous response's next_cursor to get the next (older) page."),
54
54
  });
55
55
 
56
+ const mAIL_stats_input = z.object({
57
+ message_id: MessageId,
58
+ });
59
+
60
+ const mAIL_events_input = z.object({
61
+ message_id: MessageId,
62
+ });
63
+
64
+ const mAIL_metrics_input = z.object({});
65
+
56
66
  interface MailListItem {
57
67
  message_id: string;
58
68
  direction: "inbound" | "outbound";
@@ -120,6 +130,64 @@ async function mAIL_delete(
120
130
  });
121
131
  }
122
132
 
133
+ interface MailEngagement {
134
+ message_id: string;
135
+ subject: string;
136
+ to: string;
137
+ direction: string;
138
+ status: string;
139
+ sent_at: string;
140
+ open_count: number;
141
+ unique_opens: number;
142
+ click_count: number;
143
+ forwarded: boolean;
144
+ first_opened_at: string | null;
145
+ last_opened_at: string | null;
146
+ events_by_type: Record<string, number>;
147
+ total_events: number;
148
+ }
149
+
150
+ async function mAIL_stats(
151
+ input: z.infer<typeof mAIL_stats_input>,
152
+ ctx: MosaddToolContext,
153
+ ): Promise<{ summary: MailEngagement }> {
154
+ readSupabaseEnv();
155
+ ctx.log("debug", "mAIL_stats invoking mp0st-stats", { message_id: input.message_id });
156
+ return await invokeFunction<{ summary: MailEngagement }>("mp0st-stats", {
157
+ message_id: input.message_id,
158
+ });
159
+ }
160
+
161
+ async function mAIL_events(
162
+ input: z.infer<typeof mAIL_events_input>,
163
+ ctx: MosaddToolContext,
164
+ ): Promise<{
165
+ summary: MailEngagement;
166
+ events: Array<{ event_type: string; at: string; device: string | null; ip_hash: string | null; link_url: string | null }>;
167
+ }> {
168
+ readSupabaseEnv();
169
+ ctx.log("debug", "mAIL_events invoking mp0st-stats", { message_id: input.message_id });
170
+ return await invokeFunction("mp0st-stats", { message_id: input.message_id, events: true });
171
+ }
172
+
173
+ async function mAIL_metrics(
174
+ _input: z.infer<typeof mAIL_metrics_input>,
175
+ ctx: MosaddToolContext,
176
+ ): Promise<{
177
+ mailbox: {
178
+ total_sent: number;
179
+ opened_emails: number;
180
+ open_rate_pct: number;
181
+ total_opens: number;
182
+ total_clicks: number;
183
+ forwarded_emails: number;
184
+ };
185
+ }> {
186
+ readSupabaseEnv();
187
+ ctx.log("debug", "mAIL_metrics invoking mp0st-stats");
188
+ return await invokeFunction("mp0st-stats", {});
189
+ }
190
+
123
191
  // ---- Registration ----
124
192
 
125
193
  export const mailTools: MosaddTool[] = [
@@ -154,4 +222,28 @@ export const mailTools: MosaddTool[] = [
154
222
  inputSchema: mAIL_delete_input,
155
223
  handler: mAIL_delete as MosaddTool["handler"],
156
224
  },
225
+ {
226
+ name: "mAIL_stats",
227
+ requires: "network",
228
+ description:
229
+ "Engagement summary for one sent email (by message_id): open_count, unique_opens, click_count, whether it was likely forwarded, first/last opened time, and a breakdown of tracked event types. Opens/clicks are real (tracking pixel + link-wrap); forward detection is best-effort (IP-subnet diversity). Owner-scoped.",
230
+ inputSchema: mAIL_stats_input,
231
+ handler: mAIL_stats as MosaddTool["handler"],
232
+ },
233
+ {
234
+ name: "mAIL_events",
235
+ requires: "network",
236
+ description:
237
+ "Raw engagement timeline for one email (by message_id): every tracked event (pixel_open, link_click, forwarded, page_view, copy/print/focus signals) with timestamp, device type and link URL. Use mAIL_stats for the rollup; use this for the per-event detail. Owner-scoped.",
238
+ inputSchema: mAIL_events_input,
239
+ handler: mAIL_events as MosaddTool["handler"],
240
+ },
241
+ {
242
+ name: "mAIL_metrics",
243
+ requires: "network",
244
+ description:
245
+ "Mailbox-wide engagement aggregate across the user's sent mail: total_sent, opened_emails, open_rate_pct, total_opens, total_clicks, forwarded_emails. Owner-scoped.",
246
+ inputSchema: mAIL_metrics_input,
247
+ handler: mAIL_metrics as MosaddTool["handler"],
248
+ },
157
249
  ];