@notifkit/mcp 0.1.4 → 0.1.6

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 (45) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +4 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/tools/operations.d.ts +4 -0
  6. package/dist/tools/operations.d.ts.map +1 -0
  7. package/dist/tools/operations.js +54 -0
  8. package/dist/tools/operations.js.map +1 -0
  9. package/dist/tools/projects.d.ts +4 -0
  10. package/dist/tools/projects.d.ts.map +1 -0
  11. package/dist/tools/projects.js +88 -0
  12. package/dist/tools/projects.js.map +1 -0
  13. package/dist/tools/sending.d.ts +4 -0
  14. package/dist/tools/sending.d.ts.map +1 -0
  15. package/dist/tools/sending.js +375 -0
  16. package/dist/tools/sending.js.map +1 -0
  17. package/dist/tools/shared.d.ts +17 -0
  18. package/dist/tools/shared.d.ts.map +1 -0
  19. package/dist/tools/shared.js +110 -0
  20. package/dist/tools/shared.js.map +1 -0
  21. package/dist/tools/templates.d.ts +4 -0
  22. package/dist/tools/templates.d.ts.map +1 -0
  23. package/dist/tools/templates.js +149 -0
  24. package/dist/tools/templates.js.map +1 -0
  25. package/dist/tools/users.d.ts +4 -0
  26. package/dist/tools/users.d.ts.map +1 -0
  27. package/dist/tools/users.js +251 -0
  28. package/dist/tools/users.js.map +1 -0
  29. package/dist/tools/workflows.d.ts +4 -0
  30. package/dist/tools/workflows.d.ts.map +1 -0
  31. package/dist/tools/workflows.js +115 -0
  32. package/dist/tools/workflows.js.map +1 -0
  33. package/dist/tools.d.ts.map +1 -1
  34. package/dist/tools.js +12 -1124
  35. package/dist/tools.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/index.ts +7 -1
  38. package/src/tools/operations.ts +84 -0
  39. package/src/tools/projects.ts +131 -0
  40. package/src/tools/sending.ts +484 -0
  41. package/src/tools/shared.ts +129 -0
  42. package/src/tools/templates.ts +206 -0
  43. package/src/tools/users.ts +330 -0
  44. package/src/tools/workflows.ts +158 -0
  45. package/src/tools.ts +12 -1502
package/README.md CHANGED
@@ -102,7 +102,7 @@ Because triple braces `{{{body}}}` preserve unescaped HTML, your agent in Claude
102
102
  | `get_notification` | Status and delivery attempts for a specific task |
103
103
  | `cancel_notification` | Cancel a pending scheduled or quiet-hours deferred notification |
104
104
 
105
- **Templates** — `list_templates`, `get_template`, `upsert_template`, `delete_template`, `preview_template`, `render_template`
105
+ **Templates** — `list_templates`, `get_template`, `upsert_template`, `delete_template`, `preview_template`, `render_template` (deprecated: same as `preview_template`)
106
106
 
107
107
  **Users** — `list_users` (with `search`, `segment`, `language`, `timezone`, `channel` filters), `get_user`, `upsert_user`, `update_user`, `delete_user`, `get_user_contacts`, `add_user_contact`, `delete_user_contact`, `get_user_preferences`, `update_user_preferences`
108
108
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AASpE,wBAAgB,YAAY,CAAC,OAAO,EAAE;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,SAAS,CAwBZ;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB/C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAepE,wBAAgB,YAAY,CAAC,OAAO,EAAE;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,SAAS,CAwBZ;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB/C"}
package/dist/index.js CHANGED
@@ -11,10 +11,13 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
11
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
12
12
  import { NotifkitApi } from "./client.js";
13
13
  import { registerTools } from "./tools.js";
14
+ import { readFileSync } from "node:fs";
14
15
  import { fileURLToPath } from "node:url";
15
16
  const DEFAULT_URL = "http://localhost:3000";
17
+ // Read rather than hard-coded, so releases can't leave the reported version behind.
18
+ const VERSION = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
16
19
  export function createServer(options) {
17
- const server = new McpServer({ name: "notifkit", version: "0.1.1" }, {
20
+ const server = new McpServer({ name: "notifkit", version: VERSION }, {
18
21
  instructions: "Tools for notifkit, a self-hosted notification service.\n\n" +
19
22
  "Sending: send_campaign takes a list of email addresses directly and is the right tool when the " +
20
23
  "user supplies recipients themselves. send_notification targets existing users, a segment, or a " +
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,MAAM,UAAU,YAAY,CAAC,OAI5B;IACC,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,EACtC;QACE,YAAY,EACV,6DAA6D;YAC7D,iGAAiG;YACjG,iGAAiG;YACjG,iGAAiG;YAC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S,EAAE,QAAQ,CAAC,eAAe,CAAC;QACpC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;AAEzC,IAAI,WAAW,EAAE,CAAC;IAChB,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACnC,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\n/**\n * notifkit MCP server (stdio).\n *\n * Exposes the notifkit HTTP API as MCP tools so a terminal agent can send\n * notifications, manage templates and users, and drive workflows.\n *\n * stdout is the JSON-RPC transport — never write to it. Diagnostics go to stderr.\n */\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { NotifkitApi } from \"./client.js\";\nimport { registerTools } from \"./tools.js\";\n\nimport { fileURLToPath } from \"node:url\";\n\nconst DEFAULT_URL = \"http://localhost:3000\";\n\nexport function createServer(options: {\n baseUrl: string;\n apiKey: string;\n projectId?: string;\n}): McpServer {\n const server = new McpServer(\n { name: \"notifkit\", version: \"0.1.1\" },\n {\n instructions:\n \"Tools for notifkit, a self-hosted notification service.\\n\\n\" +\n \"Sending: send_campaign takes a list of email addresses directly and is the right tool when the \" +\n \"user supplies recipients themselves. send_notification targets existing users, a segment, or a \" +\n \"topic. Both accept a `campaign` label — set one on any send whose results might be asked about \" +\n \"later, and tell the user the label, because without it the send cannot be reported on \" +\n \"afterwards. Multi-step sequences (drips, onboarding, reminders) are workflows: create_workflow \" +\n \"defines one, trigger_workflow runs it per user.\\n\\n\" +\n \"Reporting: get_campaign_stats answers 'how did that send do?'. Pass on its `warnings` verbatim — \" +\n \"an untracked open rate is not a zero open rate.\\n\\n\" +\n \"Discover ids with list_campaigns, list_segments, list_templates, and list_workflows rather than \" +\n \"guessing them.\\n\\n\" +\n \"Every send reaches real people and cannot be recalled, so confirm the audience before \" +\n \"broadcasting. Never remove a suppression to improve a delivery figure: suppressions record that \" +\n \"somebody asked not to be contacted.\",\n },\n );\n\n registerTools(server, new NotifkitApi(options));\n return server;\n}\n\nexport async function runServer(): Promise<void> {\n const baseUrl = process.env[\"NOTIFKIT_URL\"] ?? DEFAULT_URL;\n const apiKey = process.env[\"NOTIFKIT_API_KEY\"];\n const projectId = process.env[\"NOTIFKIT_PROJECT_ID\"];\n\n if (!apiKey) {\n console.error(\n \"notifkit-mcp: NOTIFKIT_API_KEY is not set.\\n\" +\n \" Set it to a project API key, or to your ADMIN_API_KEY together with NOTIFKIT_PROJECT_ID.\\n\" +\n ` NOTIFKIT_URL defaults to ${DEFAULT_URL}.`,\n );\n process.exit(1);\n }\n\n const server = createServer({ baseUrl, apiKey, projectId });\n await server.connect(new StdioServerTransport());\n\n console.error(`notifkit-mcp: connected, talking to ${baseUrl}`);\n}\n\nconst entryFile = process.argv[1];\nconst isDirectRun =\n Boolean(entryFile) &&\n !process.env[\"VITEST\"] &&\n (fileURLToPath(import.meta.url) === entryFile ||\n entryFile?.endsWith(\"notifkit-mcp\") ||\n entryFile?.endsWith(\"dist/index.js\") ||\n entryFile?.endsWith(\"src/index.ts\"));\n\nif (isDirectRun) {\n runServer().catch((error: unknown) => {\n console.error(\"notifkit-mcp: fatal:\", error instanceof Error ? error.message : error);\n process.exit(1);\n });\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OA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AO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IAC5D,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,oBAAoB,EAAE,CAAC,CAAC;IAEjD,OAAO,CAAC,KAAK,CAAC,uCAAuC,OAAO,EAAE,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClC,MAAM,WAAW,GACf,OAAO,CAAC,SAAS,CAAC;IAClB,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IACtB,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS;QAC3C,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC;QACnC,SAAS,EAAE,QAAQ,CAAC,eAAe,CAAC;QACpC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;AAEzC,IAAI,WAAW,EAAE,CAAC;IAChB,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QACnC,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACtF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["#!/usr/bin/env node\n/**\n * notifkit MCP server (stdio).\n *\n * Exposes the notifkit HTTP API as MCP tools so a terminal agent can send\n * notifications, manage templates and users, and drive workflows.\n *\n * stdout is the JSON-RPC transport — never write to it. Diagnostics go to stderr.\n */\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { NotifkitApi } from \"./client.js\";\nimport { registerTools } from \"./tools.js\";\n\nimport { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n\nconst DEFAULT_URL = \"http://localhost:3000\";\n\n// Read rather than hard-coded, so releases can't leave the reported version behind.\nconst VERSION: string = JSON.parse(\n readFileSync(new URL(\"../package.json\", import.meta.url), \"utf8\"),\n).version;\n\nexport function createServer(options: {\n baseUrl: string;\n apiKey: string;\n projectId?: string;\n}): McpServer {\n const server = new McpServer(\n { name: \"notifkit\", version: VERSION },\n {\n instructions:\n \"Tools for notifkit, a self-hosted notification service.\\n\\n\" +\n \"Sending: send_campaign takes a list of email addresses directly and is the right tool when the \" +\n \"user supplies recipients themselves. send_notification targets existing users, a segment, or a \" +\n \"topic. Both accept a `campaign` label — set one on any send whose results might be asked about \" +\n \"later, and tell the user the label, because without it the send cannot be reported on \" +\n \"afterwards. Multi-step sequences (drips, onboarding, reminders) are workflows: create_workflow \" +\n \"defines one, trigger_workflow runs it per user.\\n\\n\" +\n \"Reporting: get_campaign_stats answers 'how did that send do?'. Pass on its `warnings` verbatim — \" +\n \"an untracked open rate is not a zero open rate.\\n\\n\" +\n \"Discover ids with list_campaigns, list_segments, list_templates, and list_workflows rather than \" +\n \"guessing them.\\n\\n\" +\n \"Every send reaches real people and cannot be recalled, so confirm the audience before \" +\n \"broadcasting. Never remove a suppression to improve a delivery figure: suppressions record that \" +\n \"somebody asked not to be contacted.\",\n },\n );\n\n registerTools(server, new NotifkitApi(options));\n return server;\n}\n\nexport async function runServer(): Promise<void> {\n const baseUrl = process.env[\"NOTIFKIT_URL\"] ?? DEFAULT_URL;\n const apiKey = process.env[\"NOTIFKIT_API_KEY\"];\n const projectId = process.env[\"NOTIFKIT_PROJECT_ID\"];\n\n if (!apiKey) {\n console.error(\n \"notifkit-mcp: NOTIFKIT_API_KEY is not set.\\n\" +\n \" Set it to a project API key, or to your ADMIN_API_KEY together with NOTIFKIT_PROJECT_ID.\\n\" +\n ` NOTIFKIT_URL defaults to ${DEFAULT_URL}.`,\n );\n process.exit(1);\n }\n\n const server = createServer({ baseUrl, apiKey, projectId });\n await server.connect(new StdioServerTransport());\n\n console.error(`notifkit-mcp: connected, talking to ${baseUrl}`);\n}\n\nconst entryFile = process.argv[1];\nconst isDirectRun =\n Boolean(entryFile) &&\n !process.env[\"VITEST\"] &&\n (fileURLToPath(import.meta.url) === entryFile ||\n entryFile?.endsWith(\"notifkit-mcp\") ||\n entryFile?.endsWith(\"dist/index.js\") ||\n entryFile?.endsWith(\"src/index.ts\"));\n\nif (isDirectRun) {\n runServer().catch((error: unknown) => {\n console.error(\"notifkit-mcp: fatal:\", error instanceof Error ? error.message : error);\n process.exit(1);\n });\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { NotifkitApi } from "../client.js";
3
+ export declare function registerOperationsTools(server: McpServer, api: NotifkitApi): void;
4
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/tools/operations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CA8EjF"}
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+ import { handler } from "./shared.js";
3
+ export function registerOperationsTools(server, api) {
4
+ server.registerTool("get_system_health", {
5
+ title: "Get system health",
6
+ description: "Report the health of the notifkit deployment: queue depth, worker state, and dependency status. " +
7
+ "Call this first when sends appear queued but never delivered, to tell an outage apart from a " +
8
+ "preference or quiet-hours filter.",
9
+ annotations: { title: "Get system health", readOnlyHint: true },
10
+ }, handler(async () => api.get("/v1/system/health")));
11
+ server.registerTool("get_dead_letters", {
12
+ title: "Get dead-lettered messages",
13
+ description: "List messages that exhausted their retries and landed in the dead-letter queue, with the error " +
14
+ "that put them there. Use this to investigate deliveries that failed permanently; " +
15
+ "replay_dead_letter puts one back on the queue.",
16
+ annotations: { title: "Get dead-lettered messages", readOnlyHint: true },
17
+ }, handler(async () => api.get("/v1/dlq")));
18
+ server.registerTool("replay_dead_letter", {
19
+ title: "Replay a dead-lettered message",
20
+ description: "Re-queue one dead-lettered message for delivery. Only replay after the cause of the original " +
21
+ "failure is fixed, or it will simply fail again — check get_dead_letters for the recorded error " +
22
+ "first. Replaying sends a real notification to a real person.",
23
+ inputSchema: {
24
+ id: z.string().min(1).describe("Dead-letter entry id from get_dead_letters."),
25
+ },
26
+ annotations: {
27
+ title: "Replay a dead-lettered message",
28
+ readOnlyHint: false,
29
+ idempotentHint: false,
30
+ },
31
+ }, handler(async (args) => api.post("/v1/dlq/replay", { id: args.id })));
32
+ server.registerTool("delete_dead_letter", {
33
+ title: "Delete a dead-lettered message",
34
+ description: "Permanently delete/dismiss a dead-letter message from the DLQ by its entry ID.",
35
+ inputSchema: {
36
+ id: z.string().min(1).describe("Dead-letter entry id from get_dead_letters."),
37
+ },
38
+ annotations: {
39
+ title: "Delete a dead-letter message",
40
+ readOnlyHint: false,
41
+ destructiveHint: true,
42
+ idempotentHint: true,
43
+ },
44
+ }, handler(async (args) => {
45
+ await api.delete(`/v1/dlq/${encodeURIComponent(args.id)}`);
46
+ return `Deleted dead letter message ${args.id}.`;
47
+ }));
48
+ server.registerTool("get_system_metrics", {
49
+ title: "Get system stream metrics",
50
+ description: "Report queue depths across all Redis streams and delivery stats for the project.",
51
+ annotations: { title: "Get system stream metrics", readOnlyHint: true },
52
+ }, handler(async () => api.get("/v1/system/metrics")));
53
+ }
54
+ //# sourceMappingURL=operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/tools/operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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,CAAC,CACrE,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,gCAAgC;QACvC,WAAW,EAAE,gFAAgF;QAC7F,WAAW,EAAE;YACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,6CAA6C,CAAC;SAC9E;QACD,WAAW,EAAE;YACX,KAAK,EAAE,8BAA8B;YACrC,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,GAAG,CAAC,MAAM,CAAC,WAAW,kBAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC3D,OAAO,+BAA+B,IAAI,CAAC,EAAE,GAAG,CAAC;IACnD,CAAC,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,2BAA2B;QAClC,WAAW,EACT,kFAAkF;QACpF,WAAW,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,YAAY,EAAE,IAAI,EAAE;KACxE,EACD,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CACnD,CAAC;AACJ,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { NotifkitApi } from \"../client.js\";\nimport { handler } from \"./shared.js\";\n\nexport function registerOperationsTools(server: McpServer, api: NotifkitApi): void {\n server.registerTool(\n \"get_system_health\",\n {\n title: \"Get system health\",\n description:\n \"Report the health of the notifkit deployment: queue depth, worker state, and dependency status. \" +\n \"Call this first when sends appear queued but never delivered, to tell an outage apart from a \" +\n \"preference or quiet-hours filter.\",\n annotations: { title: \"Get system health\", readOnlyHint: true },\n },\n handler(async () => api.get(\"/v1/system/health\")),\n );\n\n server.registerTool(\n \"get_dead_letters\",\n {\n title: \"Get dead-lettered messages\",\n description:\n \"List messages that exhausted their retries and landed in the dead-letter queue, with the error \" +\n \"that put them there. Use this to investigate deliveries that failed permanently; \" +\n \"replay_dead_letter puts one back on the queue.\",\n annotations: { title: \"Get dead-lettered messages\", readOnlyHint: true },\n },\n handler(async () => api.get(\"/v1/dlq\")),\n );\n\n server.registerTool(\n \"replay_dead_letter\",\n {\n title: \"Replay a dead-lettered message\",\n description:\n \"Re-queue one dead-lettered message for delivery. Only replay after the cause of the original \" +\n \"failure is fixed, or it will simply fail again — check get_dead_letters for the recorded error \" +\n \"first. Replaying sends a real notification to a real person.\",\n inputSchema: {\n id: z.string().min(1).describe(\"Dead-letter entry id from get_dead_letters.\"),\n },\n annotations: {\n title: \"Replay a dead-lettered message\",\n readOnlyHint: false,\n idempotentHint: false,\n },\n },\n handler(async (args) => api.post(\"/v1/dlq/replay\", { id: args.id })),\n );\n\n server.registerTool(\n \"delete_dead_letter\",\n {\n title: \"Delete a dead-lettered message\",\n description: \"Permanently delete/dismiss a dead-letter message from the DLQ by its entry ID.\",\n inputSchema: {\n id: z.string().min(1).describe(\"Dead-letter entry id from get_dead_letters.\"),\n },\n annotations: {\n title: \"Delete a dead-letter message\",\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n },\n },\n handler(async (args) => {\n await api.delete(`/v1/dlq/${encodeURIComponent(args.id)}`);\n return `Deleted dead letter message ${args.id}.`;\n }),\n );\n\n server.registerTool(\n \"get_system_metrics\",\n {\n title: \"Get system stream metrics\",\n description:\n \"Report queue depths across all Redis streams and delivery stats for the project.\",\n annotations: { title: \"Get system stream metrics\", readOnlyHint: true },\n },\n handler(async () => api.get(\"/v1/system/metrics\")),\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { NotifkitApi } from "../client.js";
3
+ export declare function registerProjectsTools(server: McpServer, api: NotifkitApi): void;
4
+ //# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CA6H/E"}
@@ -0,0 +1,88 @@
1
+ import { z } from "zod";
2
+ import { handler } from "./shared.js";
3
+ export function registerProjectsTools(server, api) {
4
+ server.registerTool("list_projects", {
5
+ title: "List projects",
6
+ description: "List all projects configured in this Notifkit deployment.",
7
+ annotations: { title: "List projects", readOnlyHint: true },
8
+ }, handler(async () => api.get("/v1/projects")));
9
+ server.registerTool("create_project", {
10
+ title: "Create a project",
11
+ description: "Create a new tenant project with a name and generate its initial admin API key.",
12
+ inputSchema: {
13
+ name: z.string().min(1).describe("Project name."),
14
+ },
15
+ annotations: { title: "Create a project", readOnlyHint: false },
16
+ }, handler(async (args) => api.post("/v1/projects", { name: args.name })));
17
+ server.registerTool("update_project", {
18
+ title: "Update a project",
19
+ description: "Update project settings including rate limits and throttle limits.",
20
+ inputSchema: {
21
+ id: z.string().min(1).describe("Project id."),
22
+ rateLimitRpm: z.number().nullable().optional().describe("Requests per minute limit."),
23
+ throttleLimit: z
24
+ .number()
25
+ .nullable()
26
+ .optional()
27
+ .describe("Max notifications per throttle window."),
28
+ throttleWindowHours: z.number().nullable().optional().describe("Throttle window in hours."),
29
+ },
30
+ annotations: { title: "Update a project", readOnlyHint: false, idempotentHint: true },
31
+ }, handler(async ({ id, ...settings }) => api.patch(`/v1/projects/${encodeURIComponent(id)}`, settings)));
32
+ server.registerTool("delete_project", {
33
+ title: "Delete a project",
34
+ description: "Permanently delete a project and its associated resources.",
35
+ inputSchema: {
36
+ id: z.string().min(1).describe("Project id to delete."),
37
+ },
38
+ annotations: {
39
+ title: "Delete a project",
40
+ readOnlyHint: false,
41
+ destructiveHint: true,
42
+ idempotentHint: true,
43
+ },
44
+ }, handler(async (args) => {
45
+ await api.delete(`/v1/projects/${encodeURIComponent(args.id)}`);
46
+ return `Deleted project ${args.id}.`;
47
+ }));
48
+ server.registerTool("list_project_keys", {
49
+ title: "List project API keys",
50
+ description: "List all API keys created for a specific project.",
51
+ inputSchema: {
52
+ projectId: z.string().min(1).describe("Project id."),
53
+ },
54
+ annotations: { title: "List project API keys", readOnlyHint: true },
55
+ }, handler(async (args) => api.get(`/v1/projects/${encodeURIComponent(args.projectId)}/keys`)));
56
+ server.registerTool("create_project_key", {
57
+ title: "Create a project API key",
58
+ description: "Generate a new API key with 'admin' or 'read_only' role for a project.",
59
+ inputSchema: {
60
+ projectId: z.string().min(1).describe("Project id."),
61
+ role: z
62
+ .enum(["admin", "read_only"])
63
+ .optional()
64
+ .describe("Role for this API key. Defaults to 'admin'."),
65
+ },
66
+ annotations: { title: "Create a project API key", readOnlyHint: false },
67
+ }, handler(async (args) => api.post(`/v1/projects/${encodeURIComponent(args.projectId)}/keys`, {
68
+ role: args.role ?? "admin",
69
+ })));
70
+ server.registerTool("delete_project_key", {
71
+ title: "Delete a project API key",
72
+ description: "Revoke and delete an API key for a project.",
73
+ inputSchema: {
74
+ projectId: z.string().min(1).describe("Project id."),
75
+ keyId: z.string().min(1).describe("Key id to revoke."),
76
+ },
77
+ annotations: {
78
+ title: "Delete a project API key",
79
+ readOnlyHint: false,
80
+ destructiveHint: true,
81
+ idempotentHint: true,
82
+ },
83
+ }, handler(async (args) => {
84
+ await api.delete(`/v1/projects/${encodeURIComponent(args.projectId)}/keys/${encodeURIComponent(args.keyId)}`);
85
+ return `Deleted API key ${args.keyId} for project ${args.projectId}.`;
86
+ }));
87
+ }
88
+ //# sourceMappingURL=projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3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YACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;SACvD;QACD,WAAW,EAAE;YACX,KAAK,EAAE,0BAA0B;YACjC,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,IAAI;SACrB;KACF,EACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,GAAG,CAAC,MAAM,CACd,gBAAgB,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAC5F,CAAC;QACF,OAAO,mBAAmB,IAAI,CAAC,KAAK,gBAAgB,IAAI,CAAC,SAAS,GAAG,CAAC;IACxE,CAAC,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import { z } from \"zod\";\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { NotifkitApi } from \"../client.js\";\nimport { handler } from \"./shared.js\";\n\nexport function registerProjectsTools(server: McpServer, api: NotifkitApi): void {\n server.registerTool(\n \"list_projects\",\n {\n title: \"List projects\",\n description: \"List all projects configured in this Notifkit deployment.\",\n annotations: { title: \"List projects\", readOnlyHint: true },\n },\n handler(async () => api.get(\"/v1/projects\")),\n );\n\n server.registerTool(\n \"create_project\",\n {\n title: \"Create a project\",\n description:\n \"Create a new tenant project with a name and generate its initial admin API key.\",\n inputSchema: {\n name: z.string().min(1).describe(\"Project name.\"),\n },\n annotations: { title: \"Create a project\", readOnlyHint: false },\n },\n handler(async (args) => api.post(\"/v1/projects\", { name: args.name })),\n );\n\n server.registerTool(\n \"update_project\",\n {\n title: \"Update a project\",\n description: \"Update project settings including rate limits and throttle limits.\",\n inputSchema: {\n id: z.string().min(1).describe(\"Project id.\"),\n rateLimitRpm: z.number().nullable().optional().describe(\"Requests per minute limit.\"),\n throttleLimit: z\n .number()\n .nullable()\n .optional()\n .describe(\"Max notifications per throttle window.\"),\n throttleWindowHours: z.number().nullable().optional().describe(\"Throttle window in hours.\"),\n },\n annotations: { title: \"Update a project\", readOnlyHint: false, idempotentHint: true },\n },\n handler(async ({ id, ...settings }) =>\n api.patch(`/v1/projects/${encodeURIComponent(id)}`, settings),\n ),\n );\n\n server.registerTool(\n \"delete_project\",\n {\n title: \"Delete a project\",\n description: \"Permanently delete a project and its associated resources.\",\n inputSchema: {\n id: z.string().min(1).describe(\"Project id to delete.\"),\n },\n annotations: {\n title: \"Delete a project\",\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n },\n },\n handler(async (args) => {\n await api.delete(`/v1/projects/${encodeURIComponent(args.id)}`);\n return `Deleted project ${args.id}.`;\n }),\n );\n\n server.registerTool(\n \"list_project_keys\",\n {\n title: \"List project API keys\",\n description: \"List all API keys created for a specific project.\",\n inputSchema: {\n projectId: z.string().min(1).describe(\"Project id.\"),\n },\n annotations: { title: \"List project API keys\", readOnlyHint: true },\n },\n handler(async (args) => api.get(`/v1/projects/${encodeURIComponent(args.projectId)}/keys`)),\n );\n\n server.registerTool(\n \"create_project_key\",\n {\n title: \"Create a project API key\",\n description: \"Generate a new API key with 'admin' or 'read_only' role for a project.\",\n inputSchema: {\n projectId: z.string().min(1).describe(\"Project id.\"),\n role: z\n .enum([\"admin\", \"read_only\"])\n .optional()\n .describe(\"Role for this API key. Defaults to 'admin'.\"),\n },\n annotations: { title: \"Create a project API key\", readOnlyHint: false },\n },\n handler(async (args) =>\n api.post(`/v1/projects/${encodeURIComponent(args.projectId)}/keys`, {\n role: args.role ?? \"admin\",\n }),\n ),\n );\n\n server.registerTool(\n \"delete_project_key\",\n {\n title: \"Delete a project API key\",\n description: \"Revoke and delete an API key for a project.\",\n inputSchema: {\n projectId: z.string().min(1).describe(\"Project id.\"),\n keyId: z.string().min(1).describe(\"Key id to revoke.\"),\n },\n annotations: {\n title: \"Delete a project API key\",\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: true,\n },\n },\n handler(async (args) => {\n await api.delete(\n `/v1/projects/${encodeURIComponent(args.projectId)}/keys/${encodeURIComponent(args.keyId)}`,\n );\n return `Deleted API key ${args.keyId} for project ${args.projectId}.`;\n }),\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import type { NotifkitApi } from "../client.js";
3
+ export declare function registerSendingTools(server: McpServer, api: NotifkitApi): void;
4
+ //# sourceMappingURL=sending.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sending.d.ts","sourceRoot":"","sources":["../../src/tools/sending.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CA8d9E"}