supersendtx-mcp 0.5.4 → 0.5.8
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/dist/index.js +72 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -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,6 +630,7 @@ 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) {
|
|
@@ -584,14 +650,17 @@ function createMcpServer(apiKey, baseUrl) {
|
|
|
584
650
|
{ capabilities: { tools: {} } }
|
|
585
651
|
);
|
|
586
652
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
587
|
-
tools:
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supersendtx-mcp",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
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.
|
|
43
|
+
"supersendtx": "0.15.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "^8.5.0",
|