stables-mcp-server 2.0.0 → 2.2.0
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 +74 -16
- package/build/http/auth.d.ts +26 -0
- package/build/http/auth.d.ts.map +1 -0
- package/build/http/auth.js +47 -0
- package/build/http/auth.js.map +1 -0
- package/build/http/handler.d.ts +13 -0
- package/build/http/handler.d.ts.map +1 -0
- package/build/http/handler.js +102 -0
- package/build/http/handler.js.map +1 -0
- package/build/index.d.ts +5 -18
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -43
- package/build/index.js.map +1 -1
- package/build/lib/stables-client.d.ts +98 -9
- package/build/lib/stables-client.d.ts.map +1 -1
- package/build/lib/stables-client.js +53 -0
- package/build/lib/stables-client.js.map +1 -1
- package/build/serve.d.ts +11 -0
- package/build/serve.d.ts.map +1 -0
- package/build/serve.js +71 -0
- package/build/serve.js.map +1 -0
- package/build/server.d.ts +12 -0
- package/build/server.d.ts.map +1 -0
- package/build/server.js +32 -0
- package/build/server.js.map +1 -0
- package/build/tools/quotes.js +1 -1
- package/build/tools/quotes.js.map +1 -1
- package/build/tools/sandbox.d.ts +11 -0
- package/build/tools/sandbox.d.ts.map +1 -0
- package/build/tools/sandbox.js +78 -0
- package/build/tools/sandbox.js.map +1 -0
- package/build/tools/transfers.d.ts.map +1 -1
- package/build/tools/transfers.js +1 -2
- package/build/tools/transfers.js.map +1 -1
- package/build/tools/virtual-accounts.d.ts.map +1 -1
- package/build/tools/virtual-accounts.js +95 -38
- package/build/tools/virtual-accounts.js.map +1 -1
- package/build/tools/webhooks.d.ts.map +1 -1
- package/build/tools/webhooks.js +61 -5
- package/build/tools/webhooks.js.map +1 -1
- package/build/worker.d.ts +11 -0
- package/build/worker.d.ts.map +1 -0
- package/build/worker.js +13 -0
- package/build/worker.js.map +1 -0
- package/package.json +12 -5
- package/build/tools/payment-methods.d.ts +0 -12
- package/build/tools/payment-methods.d.ts.map +0 -1
- package/build/tools/payment-methods.js +0 -119
- package/build/tools/payment-methods.js.map +0 -1
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
export function registerVirtualAccountTools(server, client) {
|
|
7
7
|
// Create Virtual Account
|
|
8
|
-
server.tool("create_virtual_account", "Create a virtual bank account
|
|
9
|
-
|
|
8
|
+
server.tool("create_virtual_account", "Create a payment route (virtual bank account) so a customer can receive fiat deposits that convert to a stablecoin and pay out to a wallet. " +
|
|
9
|
+
"The payout destination is mandatory: the API refuses a fiat-to-crypto route without one. " +
|
|
10
|
+
"Deposit handling is set server-side and defaults to auto_payout; change it afterwards with update_virtual_account.", {
|
|
11
|
+
customerId: z.string().describe("The customer ID to create the payment route for"),
|
|
10
12
|
sourceCurrency: z
|
|
11
13
|
.string()
|
|
12
|
-
.describe("
|
|
13
|
-
|
|
14
|
-
.
|
|
15
|
-
.
|
|
16
|
-
.describe("How to handle deposits: 'auto_payout' converts and sends to wallet, 'hold' keeps as fiat, 'manual' requires approval"),
|
|
17
|
-
destinationAddress: z.string().optional().describe("Crypto wallet address for payouts"),
|
|
14
|
+
.describe("Fiat currency the route collects in (e.g. 'AUD', 'USD', 'EUR')"),
|
|
15
|
+
destinationAddress: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe("Wallet address deposits are paid out to. Validated against the chosen network"),
|
|
18
18
|
destinationPaymentRail: z
|
|
19
19
|
.enum([
|
|
20
20
|
"arbitrum",
|
|
@@ -28,26 +28,30 @@ export function registerVirtualAccountTools(server, client) {
|
|
|
28
28
|
"stellar",
|
|
29
29
|
"tron",
|
|
30
30
|
])
|
|
31
|
-
.
|
|
32
|
-
.describe("Blockchain network for the destination wallet"),
|
|
31
|
+
.describe("Blockchain network the payout address belongs to"),
|
|
33
32
|
destinationCurrency: z
|
|
34
33
|
.enum(["usdc", "usdt", "dai", "pyusd", "eurc"])
|
|
34
|
+
.default("usdt")
|
|
35
|
+
.describe("Stablecoin to receive"),
|
|
36
|
+
developerFeePercent: z
|
|
37
|
+
.string()
|
|
35
38
|
.optional()
|
|
36
|
-
.describe("
|
|
37
|
-
}, async ({ customerId, sourceCurrency,
|
|
39
|
+
.describe("Your fee on each deposit, as a numeric string (e.g. '0.5')"),
|
|
40
|
+
}, async ({ customerId, sourceCurrency, destinationAddress, destinationPaymentRail, destinationCurrency, developerFeePercent, }) => {
|
|
38
41
|
try {
|
|
42
|
+
// deposit_handling_mode is deliberately absent: it is not part of the
|
|
43
|
+
// create schema and was silently ignored here. The server sets it, and
|
|
44
|
+
// update_virtual_account changes it.
|
|
39
45
|
const request = {
|
|
40
46
|
source: { currency: sourceCurrency },
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (destinationAddress && destinationPaymentRail) {
|
|
45
|
-
request.destination = {
|
|
46
|
-
currency: destinationCurrency || "usdc",
|
|
47
|
+
workflow_type: "fiat_to_crypto",
|
|
48
|
+
destination: {
|
|
49
|
+
currency: destinationCurrency,
|
|
47
50
|
payment_rail: destinationPaymentRail,
|
|
48
51
|
address: destinationAddress,
|
|
49
|
-
}
|
|
50
|
-
|
|
52
|
+
},
|
|
53
|
+
...(developerFeePercent && { developer_fee_percent: developerFeePercent }),
|
|
54
|
+
};
|
|
51
55
|
const account = await client.createVirtualAccount(customerId, request);
|
|
52
56
|
const instructions = account.source_deposit_instructions;
|
|
53
57
|
let depositInfo = `Currency: ${instructions.currency}`;
|
|
@@ -200,22 +204,7 @@ Status: ${account.status}`,
|
|
|
200
204
|
customerId: z.string().describe("The customer ID"),
|
|
201
205
|
virtualAccountId: z.string().describe("The virtual account ID"),
|
|
202
206
|
limit: z.number().optional().describe("Maximum number of events to return (default: 10)"),
|
|
203
|
-
|
|
204
|
-
.enum([
|
|
205
|
-
"funds_scheduled",
|
|
206
|
-
"funds_received",
|
|
207
|
-
"payment_submitted",
|
|
208
|
-
"payment_processed",
|
|
209
|
-
"in_review",
|
|
210
|
-
"refund",
|
|
211
|
-
"microdeposit",
|
|
212
|
-
"account_update",
|
|
213
|
-
"deactivation",
|
|
214
|
-
"activation",
|
|
215
|
-
])
|
|
216
|
-
.optional()
|
|
217
|
-
.describe("Filter by event type"),
|
|
218
|
-
}, async ({ customerId, virtualAccountId, limit, eventType: _eventType }) => {
|
|
207
|
+
}, async ({ customerId, virtualAccountId, limit }) => {
|
|
219
208
|
try {
|
|
220
209
|
const response = await client.getVirtualAccountHistory(customerId, virtualAccountId, {
|
|
221
210
|
limit,
|
|
@@ -230,16 +219,27 @@ Status: ${account.status}`,
|
|
|
230
219
|
],
|
|
231
220
|
};
|
|
232
221
|
}
|
|
222
|
+
// Each row is a deposit and the payout it triggered. The old rendering
|
|
223
|
+
// read type/amount/currency, none of which exist on these records, so
|
|
224
|
+
// every line printed "undefined: undefined undefined".
|
|
233
225
|
const eventList = response.data
|
|
234
226
|
.map((e) => {
|
|
235
|
-
|
|
227
|
+
const when = e.deposited_at ?? e.created_at ?? "-";
|
|
228
|
+
const deposit = `${e.deposit_amount ?? "-"} ${e.deposit_currency ?? ""}`.trim();
|
|
229
|
+
const payout = e.payout_status || e.payout_amount
|
|
230
|
+
? ` → payout ${e.payout_status ?? "?"}${e.payout_amount
|
|
231
|
+
? ` ${e.payout_amount} ${e.payout_currency ?? ""}`.trimEnd()
|
|
232
|
+
: ""}`
|
|
233
|
+
: "";
|
|
234
|
+
const sender = e.sender_name ? ` from ${e.sender_name}` : "";
|
|
235
|
+
return `- ${when}: deposit ${deposit}${sender}${payout}`;
|
|
236
236
|
})
|
|
237
237
|
.join("\n");
|
|
238
238
|
return {
|
|
239
239
|
content: [
|
|
240
240
|
{
|
|
241
241
|
type: "text",
|
|
242
|
-
text: `
|
|
242
|
+
text: `Payment Route Activity (${response.data.length} record${response.data.length === 1 ? "" : "s"}${response.has_more ? ", more available" : ""}):
|
|
243
243
|
|
|
244
244
|
${eventList}`,
|
|
245
245
|
},
|
|
@@ -258,5 +258,62 @@ ${eventList}`,
|
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
260
|
});
|
|
261
|
+
// Update the payout destination
|
|
262
|
+
server.tool("update_route_destination", "Change the payout wallet on an existing payment route. Deposits after this point are paid out to the new address; use it when a customer rotates wallets rather than creating a second route.", {
|
|
263
|
+
customerId: z.string().describe("The customer ID"),
|
|
264
|
+
virtualAccountId: z.string().describe("The payment route (virtual account) ID"),
|
|
265
|
+
destinationAddress: z.string().describe("New payout wallet address"),
|
|
266
|
+
destinationPaymentRail: z
|
|
267
|
+
.enum([
|
|
268
|
+
"arbitrum",
|
|
269
|
+
"avalanche_c_chain",
|
|
270
|
+
"base",
|
|
271
|
+
"celo",
|
|
272
|
+
"ethereum",
|
|
273
|
+
"optimism",
|
|
274
|
+
"polygon",
|
|
275
|
+
"solana",
|
|
276
|
+
"stellar",
|
|
277
|
+
"tron",
|
|
278
|
+
])
|
|
279
|
+
.describe("Blockchain network the new address belongs to"),
|
|
280
|
+
destinationCurrency: z
|
|
281
|
+
.enum(["usdc", "usdt", "dai", "pyusd", "eurc"])
|
|
282
|
+
.default("usdt")
|
|
283
|
+
.describe("Stablecoin to receive"),
|
|
284
|
+
}, async ({ customerId, virtualAccountId, destinationAddress, destinationPaymentRail, destinationCurrency, }) => {
|
|
285
|
+
try {
|
|
286
|
+
const account = await client.updateVirtualAccountDestination(customerId, virtualAccountId, {
|
|
287
|
+
currency: destinationCurrency,
|
|
288
|
+
payment_rail: destinationPaymentRail,
|
|
289
|
+
address: destinationAddress,
|
|
290
|
+
});
|
|
291
|
+
return {
|
|
292
|
+
content: [
|
|
293
|
+
{
|
|
294
|
+
type: "text",
|
|
295
|
+
text: `Payout destination updated for route ${account.id}.
|
|
296
|
+
|
|
297
|
+
New destination: ${account.destination?.address ?? destinationAddress}
|
|
298
|
+
Network: ${account.destination?.payment_rail ?? destinationPaymentRail}
|
|
299
|
+
Currency: ${account.destination?.currency ?? destinationCurrency}
|
|
300
|
+
|
|
301
|
+
Future deposits pay out to this address.`,
|
|
302
|
+
},
|
|
303
|
+
],
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
catch (error) {
|
|
307
|
+
return {
|
|
308
|
+
content: [
|
|
309
|
+
{
|
|
310
|
+
type: "text",
|
|
311
|
+
text: `Failed to update the payout destination: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
312
|
+
},
|
|
313
|
+
],
|
|
314
|
+
isError: true,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
});
|
|
261
318
|
}
|
|
262
319
|
//# sourceMappingURL=virtual-accounts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-accounts.js","sourceRoot":"","sources":["../../src/tools/virtual-accounts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAwB;IACrF,yBAAyB;IACzB,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,
|
|
1
|
+
{"version":3,"file":"virtual-accounts.js","sourceRoot":"","sources":["../../src/tools/virtual-accounts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,MAAwB;IACrF,yBAAyB;IACzB,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,8IAA8I;QAC5I,2FAA2F;QAC3F,oHAAoH,EACtH;QACE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;QAClF,cAAc,EAAE,CAAC;aACd,MAAM,EAAE;aACR,QAAQ,CAAC,gEAAgE,CAAC;QAC7E,kBAAkB,EAAE,CAAC;aAClB,MAAM,EAAE;aACR,QAAQ,CAAC,+EAA+E,CAAC;QAC5F,sBAAsB,EAAE,CAAC;aACtB,IAAI,CAAC;YACJ,UAAU;YACV,mBAAmB;YACnB,MAAM;YACN,MAAM;YACN,UA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,
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/tools/webhooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAyB5D,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,QAuN/E"}
|
package/build/tools/webhooks.js
CHANGED
|
@@ -90,11 +90,12 @@ Tip: Return 200 quickly and process events asynchronously. Use eventId for idemp
|
|
|
90
90
|
type: "text",
|
|
91
91
|
text: `No webhooks configured. Use 'create_webhook' to subscribe to events.
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
93
|
+
Common event types:
|
|
94
|
+
- transfer.updated.status_transitioned
|
|
95
|
+
- kyc_link.updated.status_transitioned
|
|
96
|
+
- virtual_account.activity.created
|
|
97
|
+
- rfi.created
|
|
98
|
+
- all (subscribe to everything)`,
|
|
98
99
|
},
|
|
99
100
|
],
|
|
100
101
|
};
|
|
@@ -155,5 +156,60 @@ ${webhookList}`,
|
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
158
|
});
|
|
159
|
+
// List Webhook Deliveries
|
|
160
|
+
server.tool("list_webhook_deliveries", "List recent webhook delivery attempts with their HTTP status and retry state. This is the first place to look when an integration is not receiving events: it shows whether Stables sent them and what the endpoint answered.", {
|
|
161
|
+
pageSize: z.number().optional().describe("How many attempts to return (default 10, max 50)"),
|
|
162
|
+
status: z
|
|
163
|
+
.enum(["PENDING", "SUCCESS", "FAILED", "RETRYING"])
|
|
164
|
+
.optional()
|
|
165
|
+
.describe("Filter by delivery status"),
|
|
166
|
+
eventType: z.string().optional().describe("Filter by event type (e.g. 'transfer.created')"),
|
|
167
|
+
}, async ({ pageSize, status, eventType }) => {
|
|
168
|
+
try {
|
|
169
|
+
const { deliveries } = await client.listWebhookDeliveries({
|
|
170
|
+
pageSize: pageSize ?? 10,
|
|
171
|
+
status,
|
|
172
|
+
eventType,
|
|
173
|
+
});
|
|
174
|
+
if (!deliveries?.length) {
|
|
175
|
+
return {
|
|
176
|
+
content: [
|
|
177
|
+
{
|
|
178
|
+
type: "text",
|
|
179
|
+
text: "No webhook deliveries found. Attempts only exist where an active subscription matched an event, check 'list_webhooks' if you expected some.",
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
const list = deliveries
|
|
185
|
+
.map((d) => {
|
|
186
|
+
const code = d.responseCode ? ` HTTP ${d.responseCode}` : "";
|
|
187
|
+
const attempts = d.attemptCount > 1 ? `, ${d.attemptCount} attempts` : "";
|
|
188
|
+
const retry = d.nextRetryAt ? `, next retry ${d.nextRetryAt}` : "";
|
|
189
|
+
const target = d.subscriptionName ?? d.subscriptionUrl ?? "endpoint removed";
|
|
190
|
+
return `- ${d.eventType} → ${target}: ${d.status}${code}${attempts}${retry}`;
|
|
191
|
+
})
|
|
192
|
+
.join("\n");
|
|
193
|
+
return {
|
|
194
|
+
content: [
|
|
195
|
+
{
|
|
196
|
+
type: "text",
|
|
197
|
+
text: `Recent webhook deliveries (${deliveries.length}):\n\n${list}`,
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
return {
|
|
204
|
+
content: [
|
|
205
|
+
{
|
|
206
|
+
type: "text",
|
|
207
|
+
text: `Failed to list webhook deliveries: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
isError: true,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
});
|
|
158
214
|
}
|
|
159
215
|
//# sourceMappingURL=webhooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../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AS,MAAM,MAAM,KAAK,CAAC,CAAC,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,KAAK,EAAE,CAAC;YAC/E,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC,CAAC;YAEd,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,8BAA8B,UAAU,CAAC,MAAM,SAAS,IAAI,EAAE;qBACrE;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,sCAAsC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;qBACvG;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloudflare Worker entry point for the hosted Stables MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Deployed with `npm run deploy:worker` (see wrangler.toml). The Worker owns
|
|
5
|
+
* no secrets: every request authenticates with the caller's own API key.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: {
|
|
8
|
+
fetch(request: Request): Promise<Response>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;mBAKc,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;;AAD5C,wBAIE"}
|
package/build/worker.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloudflare Worker entry point for the hosted Stables MCP server.
|
|
3
|
+
*
|
|
4
|
+
* Deployed with `npm run deploy:worker` (see wrangler.toml). The Worker owns
|
|
5
|
+
* no secrets: every request authenticates with the caller's own API key.
|
|
6
|
+
*/
|
|
7
|
+
import { handleRequest } from "./http/handler.js";
|
|
8
|
+
export default {
|
|
9
|
+
fetch(request) {
|
|
10
|
+
return handleRequest(request);
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAe;IACb,KAAK,CAAC,OAAgB;QACpB,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stables-mcp-server",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "MCP server for Stables fiat-to-crypto API - enables AI agents to manage customers, quotes, and
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "MCP server for the Stables fiat-to-crypto API, hosted at mcp.stables.money or run locally - enables AI agents to manage customers, quotes, transfers and payment routes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"stables-mcp-server": "build/index.js"
|
|
8
|
+
"stables-mcp-server": "build/index.js",
|
|
9
|
+
"stables-mcp-serve": "build/serve.js"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
12
|
"build",
|
|
@@ -15,6 +16,9 @@
|
|
|
15
16
|
"scripts": {
|
|
16
17
|
"build": "tsc",
|
|
17
18
|
"start": "node build/index.js",
|
|
19
|
+
"serve": "node build/serve.js",
|
|
20
|
+
"dev:worker": "wrangler dev",
|
|
21
|
+
"deploy:worker": "wrangler deploy",
|
|
18
22
|
"dev": "tsc --watch",
|
|
19
23
|
"inspect": "npx @modelcontextprotocol/inspector node build/index.js",
|
|
20
24
|
"test": "vitest run",
|
|
@@ -24,7 +28,9 @@
|
|
|
24
28
|
"lint:fix": "eslint src/ --fix",
|
|
25
29
|
"format": "prettier --write 'src/**/*.ts'",
|
|
26
30
|
"format:check": "prettier --check 'src/**/*.ts'",
|
|
27
|
-
"prepublishOnly": "npm run build"
|
|
31
|
+
"prepublishOnly": "npm run build",
|
|
32
|
+
"check:spec": "node scripts/check-spec-drift.mjs",
|
|
33
|
+
"docs:reference": "node scripts/generate-tool-reference.mjs > docs/tool-reference.md"
|
|
28
34
|
},
|
|
29
35
|
"keywords": [
|
|
30
36
|
"mcp",
|
|
@@ -71,7 +77,8 @@
|
|
|
71
77
|
"prettier": "^3.8.1",
|
|
72
78
|
"typescript": "^5.0.0",
|
|
73
79
|
"typescript-eslint": "^8.56.1",
|
|
74
|
-
"vitest": "^4.0.18"
|
|
80
|
+
"vitest": "^4.0.18",
|
|
81
|
+
"wrangler": "^4.145.0"
|
|
75
82
|
},
|
|
76
83
|
"engines": {
|
|
77
84
|
"node": ">=18.0.0"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Payment method validation for the Stables MCP Server.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors POST /api/v1/payment-methods/validate. The endpoint always answers
|
|
5
|
-
* 200 and reports the outcome in the body, so this is the cheap way to discover
|
|
6
|
-
* what a corridor requires — particularly the enhanced beneficiary fields on
|
|
7
|
-
* AED, CAD, EUR, GBP, MXN and USD — before committing a short-lived quote.
|
|
8
|
-
*/
|
|
9
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
10
|
-
import { StablesApiClient } from "../lib/stables-client.js";
|
|
11
|
-
export declare function registerPaymentMethodTools(server: McpServer, client: StablesApiClient): void;
|
|
12
|
-
//# sourceMappingURL=payment-methods.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payment-methods.d.ts","sourceRoot":"","sources":["../../src/tools/payment-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAA2B,MAAM,0BAA0B,CAAC;AAErF,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,gBAAgB,QAuHrF"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Payment method validation for the Stables MCP Server.
|
|
3
|
-
*
|
|
4
|
-
* Mirrors POST /api/v1/payment-methods/validate. The endpoint always answers
|
|
5
|
-
* 200 and reports the outcome in the body, so this is the cheap way to discover
|
|
6
|
-
* what a corridor requires — particularly the enhanced beneficiary fields on
|
|
7
|
-
* AED, CAD, EUR, GBP, MXN and USD — before committing a short-lived quote.
|
|
8
|
-
*/
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
export function registerPaymentMethodTools(server, client) {
|
|
11
|
-
server.tool("validate_payment_method", "Check bank payout details against the destination currency's rules without creating a quote or transfer. " +
|
|
12
|
-
"Use this before create_transfer: it reports exactly which fields are missing or wrong, including the " +
|
|
13
|
-
"recipient type, date of birth and beneficiary address required for AED, CAD, EUR, GBP, MXN and USD.", {
|
|
14
|
-
network: z
|
|
15
|
-
.enum(["bank", "swift", "payid"])
|
|
16
|
-
.describe("Payout network to validate against: local rails ('bank'), 'swift', or 'payid'"),
|
|
17
|
-
accountHolderName: z
|
|
18
|
-
.string()
|
|
19
|
-
.describe("Account holder's full name, or the company name for a business beneficiary"),
|
|
20
|
-
bankName: z.string().describe("Name of the destination bank"),
|
|
21
|
-
bankCountry: z.string().describe("Bank country, ISO 2-letter"),
|
|
22
|
-
currency: z.string().describe("Payout currency, ISO 3-letter"),
|
|
23
|
-
recipientType: z.enum(["individual", "business"]).optional().describe("Beneficiary type"),
|
|
24
|
-
dateOfBirth: z.string().optional().describe("Beneficiary date of birth, YYYY-MM-DD"),
|
|
25
|
-
addressStreet: z.string().optional().describe("Beneficiary street address"),
|
|
26
|
-
addressCity: z.string().optional().describe("Beneficiary city"),
|
|
27
|
-
addressState: z.string().optional().describe("Beneficiary state or region"),
|
|
28
|
-
addressPostalCode: z.string().optional().describe("Beneficiary postal code"),
|
|
29
|
-
addressCountry: z.string().optional().describe("Beneficiary country, ISO 2-letter"),
|
|
30
|
-
iban: z.string().optional().describe("IBAN"),
|
|
31
|
-
accountNumber: z.string().optional().describe("Bank account number"),
|
|
32
|
-
accountType: z.enum(["savings", "checking", "payment"]).optional().describe("Account type"),
|
|
33
|
-
swiftCode: z.string().optional().describe("SWIFT code"),
|
|
34
|
-
bicCode: z.string().optional().describe("BIC"),
|
|
35
|
-
routingNumber: z.string().optional().describe("ABA routing number (US)"),
|
|
36
|
-
sortCode: z.string().optional().describe("Sort code (UK)"),
|
|
37
|
-
ifscCode: z.string().optional().describe("IFSC code (India)"),
|
|
38
|
-
bsbCode: z.string().optional().describe("BSB code (Australia)"),
|
|
39
|
-
bankCode: z.string().optional().describe("Bank code / institution number (CAD)"),
|
|
40
|
-
branchCode: z.string().optional().describe("Branch code / transit number (CAD)"),
|
|
41
|
-
cnaps: z.string().optional().describe("CNAPS (China)"),
|
|
42
|
-
}, async (input) => {
|
|
43
|
-
try {
|
|
44
|
-
const hasAddress = Boolean(input.addressStreet &&
|
|
45
|
-
input.addressCity &&
|
|
46
|
-
input.addressState &&
|
|
47
|
-
input.addressPostalCode &&
|
|
48
|
-
input.addressCountry);
|
|
49
|
-
const destination = {
|
|
50
|
-
type: "bank",
|
|
51
|
-
account_holder_name: input.accountHolderName,
|
|
52
|
-
bank_name: input.bankName,
|
|
53
|
-
bank_country: input.bankCountry,
|
|
54
|
-
currency: input.currency,
|
|
55
|
-
...(input.recipientType && { recipient_type: input.recipientType }),
|
|
56
|
-
...(input.dateOfBirth && { date_of_birth: input.dateOfBirth }),
|
|
57
|
-
...(hasAddress && {
|
|
58
|
-
address: {
|
|
59
|
-
street: input.addressStreet,
|
|
60
|
-
city: input.addressCity,
|
|
61
|
-
state: input.addressState,
|
|
62
|
-
postal_code: input.addressPostalCode,
|
|
63
|
-
country: input.addressCountry,
|
|
64
|
-
},
|
|
65
|
-
}),
|
|
66
|
-
...(input.iban && { iban: input.iban }),
|
|
67
|
-
...(input.accountNumber && { account_number: input.accountNumber }),
|
|
68
|
-
...(input.accountType && { account_type: input.accountType }),
|
|
69
|
-
...(input.swiftCode && { swift_code: input.swiftCode }),
|
|
70
|
-
...(input.bicCode && { bic_code: input.bicCode }),
|
|
71
|
-
...(input.routingNumber && { aba_code: input.routingNumber }),
|
|
72
|
-
...(input.sortCode && { sort_code: input.sortCode }),
|
|
73
|
-
...(input.ifscCode && { ifsc_code: input.ifscCode }),
|
|
74
|
-
...(input.bsbCode && { bsb_code: input.bsbCode }),
|
|
75
|
-
...(input.bankCode && { bank_code: input.bankCode }),
|
|
76
|
-
...(input.branchCode && { branch_code: input.branchCode }),
|
|
77
|
-
...(input.cnaps && { cnaps: input.cnaps }),
|
|
78
|
-
};
|
|
79
|
-
const result = await client.validatePaymentMethod(input.network, destination);
|
|
80
|
-
if (result.valid) {
|
|
81
|
-
return {
|
|
82
|
-
content: [
|
|
83
|
-
{
|
|
84
|
-
type: "text",
|
|
85
|
-
text: `These payout details are valid for ${input.currency} over ${input.network}. Safe to use with create_transfer.`,
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
const problems = (result.errors ?? [])
|
|
91
|
-
.map((e) => `- ${e.field ? `${e.field}: ` : ""}${e.message} (${e.code})`)
|
|
92
|
-
.join("\n");
|
|
93
|
-
return {
|
|
94
|
-
content: [
|
|
95
|
-
{
|
|
96
|
-
type: "text",
|
|
97
|
-
text: `These payout details are NOT valid for ${input.currency} over ${input.network}:
|
|
98
|
-
|
|
99
|
-
${problems || "- No detail returned."}
|
|
100
|
-
|
|
101
|
-
Collect the missing information before calling create_transfer.`,
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
return {
|
|
108
|
-
content: [
|
|
109
|
-
{
|
|
110
|
-
type: "text",
|
|
111
|
-
text: `Failed to validate payment method: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
isError: true,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
//# sourceMappingURL=payment-methods.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"payment-methods.js","sourceRoot":"","sources":["../../src/tools/payment-methods.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAwB;IACpF,MAAM,CAAC,IAAI,CACT,yBAAyB,EACzB,2GAA2G;QACzG,uGAAuG;QACvG,qGAAqG,EACvG;QACE,OAAO,EAAE,CAAC;aACP,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;aAChC,QAAQ,CAAC,+EAA+E,CAAC;QAC5F,iBAAiB,EAAE,CAAC;aACjB,MAAM,EAAE;aACR,QAAQ,CAAC,4EAA4E,CAAC;QACzF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QAC7D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,4BAA4B,CAAC;QAC9D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,+BAA+B,CAAC;QAC9D,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ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