supersendtx-mcp 0.5.5 → 0.5.9

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 (3) hide show
  1. package/README.md +4 -4
  2. package/dist/index.js +79 -10
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -8,16 +8,16 @@ MCP server for [SuperSend TX](https://supersendtx.com) — send email and manage
8
8
 
9
9
  | Mode | Command / URL | Auth |
10
10
  |------|---------------|------|
11
- | **stdio** (default) | `npx -y supersendtx-mcp` | `SUPERSENDTX_API_KEY=stx_…` |
12
- | **HTTP** (local) | `npx -y supersendtx-mcp --http --port 3000` | `Authorization: Bearer stx_…` on each request |
13
- | **HTTP** (hosted) | `https://mcp.supersendtx.com/mcp` | **OAuth** (recommended) or `Authorization: Bearer stx_…` |
11
+ | **stdio** (default) | `npx -y supersendtx-mcp` | `SUPERSENDTX_API_KEY=stx_…` or `rnl_…` |
12
+ | **HTTP** (local) | `npx -y supersendtx-mcp --http --port 3000` | `Authorization: Bearer stx_…` or `rnl_…` on each request |
13
+ | **HTTP** (hosted) | `https://mcp.supersendtx.com/mcp` | **OAuth** (recommended) or `Authorization: Bearer stx_…` or `rnl_…` |
14
14
 
15
15
  Optional: `SUPERSENDTX_API_URL` (e.g. `http://localhost:3003/api` for local API).
16
16
 
17
17
  Local HTTP endpoint: `http://127.0.0.1:3000/mcp` · health: `GET /health`
18
18
  Hosted health: `GET https://mcp.supersendtx.com/health`
19
19
 
20
- Hosted OAuth: add only `"url": "https://mcp.supersendtx.com/mcp"` — the client runs the browser consent flow. Bearer `stx_…` still works for advanced setups.
20
+ Hosted OAuth: add only `"url": "https://mcp.supersendtx.com/mcp"` — the client runs the browser consent flow. Bearer `stx_…` or `rnl_…` still works for advanced setups.
21
21
 
22
22
  ---
23
23
 
package/dist/index.js CHANGED
@@ -56,15 +56,15 @@ function printHelp() {
56
56
  supersendtx-mcp --http [--port 3000] [--host 127.0.0.1]
57
57
 
58
58
  Environment:
59
- SUPERSENDTX_API_KEY Required for stdio (Bearer stx_\u2026 for HTTP)
59
+ SUPERSENDTX_API_KEY Required for stdio (Bearer stx_\u2026 or rnl_\u2026 for HTTP)
60
60
  SUPERSENDTX_API_URL Optional API base (default https://api.supersendtx.com)
61
61
 
62
62
  HTTP auth:
63
- Authorization: Bearer stx_\u2026 (API key) or MCP OAuth access token
63
+ Authorization: Bearer stx_\u2026 or rnl_\u2026 (API key) or MCP OAuth access token
64
64
  `);
65
65
  }
66
66
  function isSuperSendTxApiKey(token) {
67
- return /^stx_[a-f0-9]{48}$/i.test(token.trim());
67
+ return /^(?:stx_|rnl_)[a-f0-9]{48}$/i.test(token.trim());
68
68
  }
69
69
  function parseBearerToken(authorization) {
70
70
  if (!authorization) return null;
@@ -82,6 +82,65 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
82
82
  import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
83
83
  import { SuperSendTX } from "supersendtx";
84
84
 
85
+ // src/arc-mcp.ts
86
+ var ARC_MCP_TOOLS = [
87
+ {
88
+ name: "arc_get_business_brief",
89
+ description: "Read the business brief and lifecycle map.",
90
+ inputSchema: { type: "object", properties: {} },
91
+ growthTool: "get_business_brief"
92
+ },
93
+ {
94
+ name: "arc_get_setup_status",
95
+ description: "Connection inventory and compounding blockers.",
96
+ inputSchema: { type: "object", properties: {} },
97
+ growthTool: "get_setup_status"
98
+ },
99
+ {
100
+ name: "arc_get_growth_health",
101
+ description: "Signup \u2192 activation \u2192 pay health over a window.",
102
+ inputSchema: {
103
+ type: "object",
104
+ properties: { days: { type: "number" } }
105
+ },
106
+ growthTool: "get_growth_health"
107
+ },
108
+ {
109
+ name: "arc_request_connection",
110
+ description: "Surface a Connect card for a missing integration slot.",
111
+ inputSchema: {
112
+ type: "object",
113
+ properties: {
114
+ slot: { type: "string" },
115
+ reason: { type: "string" }
116
+ },
117
+ required: ["slot"]
118
+ },
119
+ growthTool: "request_connection"
120
+ }
121
+ ];
122
+ async function callArcMcpTool(apiKey, name, args, baseUrl) {
123
+ const def = ARC_MCP_TOOLS.find((tool) => tool.name === name);
124
+ if (!def) return null;
125
+ const origin = (baseUrl ?? process.env.SUPERSENDTX_API_URL ?? "https://app.supersendtx.com").replace(
126
+ /\/$/,
127
+ ""
128
+ );
129
+ const response = await fetch(`${origin}/api/growth/tools/${encodeURIComponent(def.growthTool)}`, {
130
+ method: "POST",
131
+ headers: {
132
+ Authorization: `Bearer ${apiKey}`,
133
+ "Content-Type": "application/json"
134
+ },
135
+ body: JSON.stringify({ input: args })
136
+ });
137
+ const body = await response.json().catch(() => ({}));
138
+ if (!response.ok) {
139
+ throw new Error(body.error ?? `Arc tool failed (${response.status})`);
140
+ }
141
+ return body.result;
142
+ }
143
+
85
144
  // src/tools.ts
86
145
  function textResult(value, isError = false) {
87
146
  return {
@@ -126,8 +185,14 @@ var EMAIL_WEBHOOK_EVENTS = /* @__PURE__ */ new Set([
126
185
  "email.suppressed",
127
186
  "email.scheduled"
128
187
  ]);
129
- async function callMcpTool(client, name, args) {
188
+ async function callMcpTool(client, name, args, options = {}) {
130
189
  try {
190
+ const arc = ARC_MCP_TOOLS.find((tool) => tool.name === name);
191
+ if (arc) {
192
+ const apiKey = options.apiKey ?? resolveApiKey();
193
+ const result = await callArcMcpTool(apiKey, name, args, options.baseUrl);
194
+ return textResult(result);
195
+ }
131
196
  switch (name) {
132
197
  case "send_email": {
133
198
  const from = optString(args, "from");
@@ -565,13 +630,14 @@ var MCP_TOOLS = [
565
630
  }
566
631
  }
567
632
  ];
633
+ var MCP_TOOLS_WITH_ARC = [...MCP_TOOLS, ...ARC_MCP_TOOLS];
568
634
  function resolveApiKey() {
569
635
  const key = process.env.SUPERSENDTX_API_KEY?.trim();
570
636
  if (!key) {
571
637
  throw new Error("SUPERSENDTX_API_KEY is required");
572
638
  }
573
- if (!key.startsWith("stx_")) {
574
- throw new Error("SUPERSENDTX_API_KEY must start with stx_");
639
+ if (!key.startsWith("stx_") && !key.startsWith("rnl_")) {
640
+ throw new Error("SUPERSENDTX_API_KEY must start with stx_ or rnl_");
575
641
  }
576
642
  return key;
577
643
  }
@@ -584,14 +650,17 @@ function createMcpServer(apiKey, baseUrl) {
584
650
  { capabilities: { tools: {} } }
585
651
  );
586
652
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
587
- tools: MCP_TOOLS.map((tool) => ({
653
+ tools: MCP_TOOLS_WITH_ARC.map((tool) => ({
588
654
  name: tool.name,
589
655
  description: tool.description,
590
656
  inputSchema: tool.inputSchema
591
657
  }))
592
658
  }));
593
659
  server.setRequestHandler(CallToolRequestSchema, async (request) => {
594
- const result = await callMcpTool(client, request.params.name, request.params.arguments ?? {});
660
+ const result = await callMcpTool(client, request.params.name, request.params.arguments ?? {}, {
661
+ apiKey,
662
+ baseUrl
663
+ });
595
664
  return result;
596
665
  });
597
666
  return server;
@@ -704,7 +773,7 @@ async function handleHttpRequest(req, res, options = {}) {
704
773
  sendJson(
705
774
  res,
706
775
  401,
707
- { error: "Missing or invalid Authorization. Use Bearer stx_\u2026 or complete MCP OAuth." },
776
+ { error: "Missing or invalid Authorization. Use Bearer stx_\u2026 / rnl_\u2026 or complete MCP OAuth." },
708
777
  { "www-authenticate": buildWwwAuthenticateChallenge(origin) }
709
778
  );
710
779
  return;
@@ -741,7 +810,7 @@ async function runHttpServer(options) {
741
810
  httpServer.listen(port, host, () => resolve());
742
811
  });
743
812
  console.error(`SuperSend TX MCP HTTP listening on http://${host}:${port}/mcp`);
744
- console.error("Authenticate with Bearer stx_\u2026 or MCP OAuth access token");
813
+ console.error("Authenticate with Bearer stx_\u2026 / rnl_\u2026 or MCP OAuth access token");
745
814
  }
746
815
 
747
816
  // src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "supersendtx-mcp",
3
- "version": "0.5.5",
3
+ "version": "0.5.9",
4
4
  "description": "SuperSend TX MCP server — stdio or local HTTP (--http) for Cursor and Claude",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@modelcontextprotocol/sdk": "^1.30.0",
43
- "supersendtx": "0.14.1"
43
+ "supersendtx": "0.15.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsup": "^8.5.0",