stables-mcp-server 1.4.0 → 2.1.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 +70 -48
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/build/lib/stables-client.d.ts +313 -136
- package/build/lib/stables-client.d.ts.map +1 -1
- package/build/lib/stables-client.js +107 -19
- package/build/lib/stables-client.js.map +1 -1
- package/build/tools/api-keys.d.ts.map +1 -1
- package/build/tools/api-keys.js +7 -3
- package/build/tools/api-keys.js.map +1 -1
- package/build/tools/customers.d.ts.map +1 -1
- package/build/tools/customers.js +239 -106
- package/build/tools/customers.js.map +1 -1
- package/build/tools/quotes.d.ts +5 -1
- package/build/tools/quotes.d.ts.map +1 -1
- package/build/tools/quotes.js +103 -59
- 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 +4 -1
- package/build/tools/transfers.d.ts.map +1 -1
- package/build/tools/transfers.js +212 -112
- package/build/tools/transfers.js.map +1 -1
- package/build/tools/virtual-accounts.d.ts.map +1 -1
- package/build/tools/virtual-accounts.js +127 -84
- package/build/tools/virtual-accounts.js.map +1 -1
- package/build/tools/webhooks.d.ts.map +1 -1
- package/build/tools/webhooks.js +98 -24
- package/build/tools/webhooks.js.map +1 -1
- package/package.json +12 -4
- package/build/tools/notifications.d.ts +0 -8
- package/build/tools/notifications.d.ts.map +0 -1
- package/build/tools/notifications.js +0 -125
- package/build/tools/notifications.js.map +0 -1
|
@@ -5,30 +5,53 @@
|
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
.describe("
|
|
18
|
-
|
|
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"),
|
|
12
|
+
sourceCurrency: z
|
|
13
|
+
.string()
|
|
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
|
+
destinationPaymentRail: z
|
|
19
|
+
.enum([
|
|
20
|
+
"arbitrum",
|
|
21
|
+
"avalanche_c_chain",
|
|
22
|
+
"base",
|
|
23
|
+
"celo",
|
|
24
|
+
"ethereum",
|
|
25
|
+
"optimism",
|
|
26
|
+
"polygon",
|
|
27
|
+
"solana",
|
|
28
|
+
"stellar",
|
|
29
|
+
"tron",
|
|
30
|
+
])
|
|
31
|
+
.describe("Blockchain network the payout address belongs to"),
|
|
32
|
+
destinationCurrency: z
|
|
33
|
+
.enum(["usdc", "usdt", "dai", "pyusd", "eurc"])
|
|
34
|
+
.default("usdt")
|
|
35
|
+
.describe("Stablecoin to receive"),
|
|
36
|
+
developerFeePercent: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("Your fee on each deposit, as a numeric string (e.g. '0.5')"),
|
|
40
|
+
}, async ({ customerId, sourceCurrency, destinationAddress, destinationPaymentRail, destinationCurrency, developerFeePercent, }) => {
|
|
19
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.
|
|
20
45
|
const request = {
|
|
21
46
|
source: { currency: sourceCurrency },
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (destinationAddress && destinationPaymentRail) {
|
|
26
|
-
request.destination = {
|
|
27
|
-
currency: destinationCurrency || "usdc",
|
|
47
|
+
workflow_type: "fiat_to_crypto",
|
|
48
|
+
destination: {
|
|
49
|
+
currency: destinationCurrency,
|
|
28
50
|
payment_rail: destinationPaymentRail,
|
|
29
51
|
address: destinationAddress,
|
|
30
|
-
}
|
|
31
|
-
|
|
52
|
+
},
|
|
53
|
+
...(developerFeePercent && { developer_fee_percent: developerFeePercent }),
|
|
54
|
+
};
|
|
32
55
|
const account = await client.createVirtualAccount(customerId, request);
|
|
33
56
|
const instructions = account.source_deposit_instructions;
|
|
34
57
|
let depositInfo = `Currency: ${instructions.currency}`;
|
|
@@ -89,7 +112,9 @@ Share the deposit instructions with the customer to receive funds.`,
|
|
|
89
112
|
// List Virtual Accounts (by customer)
|
|
90
113
|
server.tool("list_virtual_accounts", "List all virtual accounts for a customer", {
|
|
91
114
|
customerId: z.string().describe("The customer ID to list virtual accounts for"),
|
|
92
|
-
status: z
|
|
115
|
+
status: z
|
|
116
|
+
.enum(["activated", "deactivated", "pending", "closed"])
|
|
117
|
+
.optional()
|
|
93
118
|
.describe("Filter by account status"),
|
|
94
119
|
limit: z.number().optional().describe("Maximum number of accounts to return"),
|
|
95
120
|
}, async ({ customerId, status, limit }) => {
|
|
@@ -105,13 +130,17 @@ Share the deposit instructions with the customer to receive funds.`,
|
|
|
105
130
|
],
|
|
106
131
|
};
|
|
107
132
|
}
|
|
108
|
-
const accountList = response.data
|
|
133
|
+
const accountList = response.data
|
|
134
|
+
.map((a) => {
|
|
109
135
|
const dest = a.destination
|
|
110
136
|
? `Payout: ${a.destination.address.slice(0, 10)}... (${a.destination.payment_rail})`
|
|
111
137
|
: "No payout destination";
|
|
112
|
-
const balance = a.held_balance
|
|
138
|
+
const balance = a.held_balance
|
|
139
|
+
? ` | Balance: ${a.held_balance.amount} ${a.held_balance.currency}`
|
|
140
|
+
: "";
|
|
113
141
|
return `- ${a.id}: ${a.source_deposit_instructions.currency} (${a.status}) - ${dest}${balance}`;
|
|
114
|
-
})
|
|
142
|
+
})
|
|
143
|
+
.join("\n");
|
|
115
144
|
return {
|
|
116
145
|
content: [
|
|
117
146
|
{
|
|
@@ -139,7 +168,9 @@ ${accountList}`,
|
|
|
139
168
|
server.tool("update_virtual_account", "Update virtual account settings (e.g., deposit handling mode)", {
|
|
140
169
|
customerId: z.string().describe("The customer ID"),
|
|
141
170
|
virtualAccountId: z.string().describe("The virtual account ID to update"),
|
|
142
|
-
depositHandlingMode: z
|
|
171
|
+
depositHandlingMode: z
|
|
172
|
+
.enum(["auto_payout", "hold", "manual"])
|
|
173
|
+
.describe("New deposit handling mode"),
|
|
143
174
|
}, async ({ customerId, virtualAccountId, depositHandlingMode }) => {
|
|
144
175
|
try {
|
|
145
176
|
const account = await client.updateVirtualAccount(customerId, virtualAccountId, {
|
|
@@ -168,46 +199,49 @@ Status: ${account.status}`,
|
|
|
168
199
|
};
|
|
169
200
|
}
|
|
170
201
|
});
|
|
171
|
-
//
|
|
172
|
-
server.tool("
|
|
173
|
-
customerId: z.string().describe("The customer ID"),
|
|
174
|
-
virtualAccountId: z.string().describe("The virtual account ID to deactivate"),
|
|
175
|
-
}, async ({ customerId, virtualAccountId }) => {
|
|
176
|
-
try {
|
|
177
|
-
const account = await client.deactivateVirtualAccount(customerId, virtualAccountId);
|
|
178
|
-
return {
|
|
179
|
-
content: [
|
|
180
|
-
{
|
|
181
|
-
type: "text",
|
|
182
|
-
text: `Virtual account ${account.id} has been deactivated. No new deposits will be accepted.`,
|
|
183
|
-
},
|
|
184
|
-
],
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
catch (error) {
|
|
188
|
-
return {
|
|
189
|
-
content: [
|
|
190
|
-
{
|
|
191
|
-
type: "text",
|
|
192
|
-
text: `Failed to deactivate virtual account: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
isError: true,
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
// Reactivate Virtual Account
|
|
200
|
-
server.tool("reactivate_virtual_account", "Reactivate a previously deactivated virtual account", {
|
|
202
|
+
// Get Virtual Account History
|
|
203
|
+
server.tool("get_virtual_account_history", "Get the activity history for a virtual account (deposits, payouts, etc.)", {
|
|
201
204
|
customerId: z.string().describe("The customer ID"),
|
|
202
|
-
virtualAccountId: z.string().describe("The virtual account ID
|
|
203
|
-
|
|
205
|
+
virtualAccountId: z.string().describe("The virtual account ID"),
|
|
206
|
+
limit: z.number().optional().describe("Maximum number of events to return (default: 10)"),
|
|
207
|
+
}, async ({ customerId, virtualAccountId, limit }) => {
|
|
204
208
|
try {
|
|
205
|
-
const
|
|
209
|
+
const response = await client.getVirtualAccountHistory(customerId, virtualAccountId, {
|
|
210
|
+
limit,
|
|
211
|
+
});
|
|
212
|
+
if (response.data.length === 0) {
|
|
213
|
+
return {
|
|
214
|
+
content: [
|
|
215
|
+
{
|
|
216
|
+
type: "text",
|
|
217
|
+
text: `No activity found for virtual account ${virtualAccountId}.`,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
};
|
|
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".
|
|
225
|
+
const eventList = response.data
|
|
226
|
+
.map((e) => {
|
|
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
|
+
})
|
|
237
|
+
.join("\n");
|
|
206
238
|
return {
|
|
207
239
|
content: [
|
|
208
240
|
{
|
|
209
241
|
type: "text",
|
|
210
|
-
text: `
|
|
242
|
+
text: `Payment Route Activity (${response.data.length} record${response.data.length === 1 ? "" : "s"}${response.has_more ? ", more available" : ""}):
|
|
243
|
+
|
|
244
|
+
${eventList}`,
|
|
211
245
|
},
|
|
212
246
|
],
|
|
213
247
|
};
|
|
@@ -217,45 +251,54 @@ Status: ${account.status}`,
|
|
|
217
251
|
content: [
|
|
218
252
|
{
|
|
219
253
|
type: "text",
|
|
220
|
-
text: `Failed to
|
|
254
|
+
text: `Failed to get virtual account history: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
221
255
|
},
|
|
222
256
|
],
|
|
223
257
|
isError: true,
|
|
224
258
|
};
|
|
225
259
|
}
|
|
226
260
|
});
|
|
227
|
-
//
|
|
228
|
-
server.tool("
|
|
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.", {
|
|
229
263
|
customerId: z.string().describe("The customer ID"),
|
|
230
|
-
virtualAccountId: z.string().describe("The virtual account ID"),
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.
|
|
234
|
-
|
|
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, }) => {
|
|
235
285
|
try {
|
|
236
|
-
const
|
|
237
|
-
|
|
286
|
+
const account = await client.updateVirtualAccountDestination(customerId, virtualAccountId, {
|
|
287
|
+
currency: destinationCurrency,
|
|
288
|
+
payment_rail: destinationPaymentRail,
|
|
289
|
+
address: destinationAddress,
|
|
238
290
|
});
|
|
239
|
-
if (response.data.length === 0) {
|
|
240
|
-
return {
|
|
241
|
-
content: [
|
|
242
|
-
{
|
|
243
|
-
type: "text",
|
|
244
|
-
text: `No activity found for virtual account ${virtualAccountId}.`,
|
|
245
|
-
},
|
|
246
|
-
],
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
const eventList = response.data.map((e) => {
|
|
250
|
-
return `- ${e.created_at}: ${e.type} - ${e.amount} ${e.currency}${e.deposit_id ? ` (Deposit: ${e.deposit_id})` : ""}`;
|
|
251
|
-
}).join("\n");
|
|
252
291
|
return {
|
|
253
292
|
content: [
|
|
254
293
|
{
|
|
255
294
|
type: "text",
|
|
256
|
-
text: `
|
|
295
|
+
text: `Payout destination updated for route ${account.id}.
|
|
257
296
|
|
|
258
|
-
${
|
|
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.`,
|
|
259
302
|
},
|
|
260
303
|
],
|
|
261
304
|
};
|
|
@@ -265,7 +308,7 @@ ${eventList}`,
|
|
|
265
308
|
content: [
|
|
266
309
|
{
|
|
267
310
|
type: "text",
|
|
268
|
-
text: `Failed to
|
|
311
|
+
text: `Failed to update the payout destination: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
269
312
|
},
|
|
270
313
|
],
|
|
271
314
|
isError: true,
|
|
@@ -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,qHAAqH,EACvH;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,UAAU;YACV,UAAU;YACV,SAAS;YACT,QAAQ;YACR,SAAS;YACT,MAAM;SACP,CAAC;aACD,QAAQ,CAAC,kDAAkD,CAAC;QAC/D,mBAAmB,EAAE,CAAC;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,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC,UAAU,EAAE,gBAAgB,EAAE;gBACzF,QAAQ,EAAE,mBAAmB;gBAC7B,YAAY,EAAE,sBAAsB;gBACpC,OAAO,EAAE,kBAAkB;aAC5B,CAAC,CAAC;YACH,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,wCAAwC,OAAO,CAAC,EAAE;;mBAEnD,OAAO,CAAC,WAAW,EAAE,OAAO,IAAI,kBAAkB;WAC1D,OAAO,CAAC,WAAW,EAAE,YAAY,IAAI,sBAAsB;YAC1D,OAAO,CAAC,WAAW,EAAE,QAAQ,IAAI,mBAAmB;;yCAEvB;qBAC5B;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,4CAA4C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;qBAC7G;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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
|
@@ -3,30 +3,46 @@
|
|
|
3
3
|
* Synced with OpenAPI spec from https://api.stables.money/docs
|
|
4
4
|
*/
|
|
5
5
|
import { z } from "zod";
|
|
6
|
+
/**
|
|
7
|
+
* The tenant-facing subset the API accepts. Declared as an enum rather than
|
|
8
|
+
* free strings so a wrong value is caught before the request instead of coming
|
|
9
|
+
* back as a 400 the model has to guess its way out of.
|
|
10
|
+
*/
|
|
11
|
+
const WEBHOOK_EVENT_TYPES = [
|
|
12
|
+
"customer.created",
|
|
13
|
+
"customer.updated",
|
|
14
|
+
"kyc_link.updated.status_transitioned",
|
|
15
|
+
"transfer.created",
|
|
16
|
+
"transfer.updated.status_transitioned",
|
|
17
|
+
"quote.created",
|
|
18
|
+
"quote.updated.status_transitioned",
|
|
19
|
+
"virtual_account.created",
|
|
20
|
+
"virtual_account.activity.created",
|
|
21
|
+
"virtual_account.activity.updated.status_transitioned",
|
|
22
|
+
"travel_rule.wallet_verification_required",
|
|
23
|
+
"rfi.created",
|
|
24
|
+
"rfi.updated",
|
|
25
|
+
"rfi.resolved",
|
|
26
|
+
"all",
|
|
27
|
+
];
|
|
6
28
|
export function registerWebhookTools(server, client) {
|
|
7
29
|
// Create Webhook
|
|
8
30
|
server.tool("create_webhook", `Subscribe to Stables events via webhook. You'll receive POST requests to your URL when events occur.
|
|
9
31
|
|
|
10
|
-
|
|
11
|
-
- WEBHOOK_EVENT_TYPE_CUSTOMER_CREATED
|
|
12
|
-
- WEBHOOK_EVENT_TYPE_CUSTOMER_UPDATED
|
|
13
|
-
- WEBHOOK_EVENT_TYPE_KYC_STATUS_CHANGED
|
|
14
|
-
- WEBHOOK_EVENT_TYPE_PAYMENT_CREATED
|
|
15
|
-
- WEBHOOK_EVENT_TYPE_PAYMENT_STATUS_CHANGED
|
|
16
|
-
- WEBHOOK_EVENT_TYPE_QUOTE_CREATED
|
|
17
|
-
- WEBHOOK_EVENT_TYPE_QUOTE_EXPIRED
|
|
18
|
-
- WEBHOOK_EVENT_TYPE_VA_DEPOSIT_RECEIVED
|
|
19
|
-
- WEBHOOK_EVENT_TYPE_VA_PAYOUT_COMPLETED
|
|
20
|
-
- WEBHOOK_EVENT_TYPE_VA_PAYOUT_FAILED
|
|
21
|
-
- WEBHOOK_EVENT_TYPE_MONOOVA_NPP_RECEIVE_PAYMENT
|
|
22
|
-
- WEBHOOK_EVENT_TYPE_MONOOVA_INBOUND_DIRECT_CREDIT
|
|
23
|
-
- WEBHOOK_EVENT_TYPE_ALL
|
|
32
|
+
Event types are dotted and lowercase. Use 'all' to receive everything.
|
|
24
33
|
|
|
25
34
|
Security: Set a secret to enable HMAC-SHA256 signature verification via X-Webhook-Signature header.`, {
|
|
26
|
-
name: z
|
|
35
|
+
name: z
|
|
36
|
+
.string()
|
|
37
|
+
.describe("A descriptive name for this webhook (e.g., 'Transfer status notifications')"),
|
|
27
38
|
url: z.string().url().describe("The HTTPS URL to receive webhook POST requests"),
|
|
28
|
-
eventTypes: z
|
|
29
|
-
|
|
39
|
+
eventTypes: z
|
|
40
|
+
.array(z.enum(WEBHOOK_EVENT_TYPES))
|
|
41
|
+
.describe("Event types to subscribe to (e.g. ['transfer.updated.status_transitioned']), or ['all']"),
|
|
42
|
+
secret: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Optional signing secret for HMAC-SHA256 webhook signature verification"),
|
|
30
46
|
}, async ({ name, url, eventTypes, secret }) => {
|
|
31
47
|
try {
|
|
32
48
|
const response = await client.createWebhook({ name, url, eventTypes, secret });
|
|
@@ -74,19 +90,22 @@ Tip: Return 200 quickly and process events asynchronously. Use eventId for idemp
|
|
|
74
90
|
type: "text",
|
|
75
91
|
text: `No webhooks configured. Use 'create_webhook' to subscribe to events.
|
|
76
92
|
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
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)`,
|
|
82
99
|
},
|
|
83
100
|
],
|
|
84
101
|
};
|
|
85
102
|
}
|
|
86
|
-
const webhookList = response.subscriptions
|
|
103
|
+
const webhookList = response.subscriptions
|
|
104
|
+
.map((w) => {
|
|
87
105
|
const status = w.active ? "Active" : "Inactive";
|
|
88
106
|
return `- ${w.subscriptionId}: "${w.name}" -> ${w.url} (${status})\n Events: ${w.eventTypes.join(", ")}`;
|
|
89
|
-
})
|
|
107
|
+
})
|
|
108
|
+
.join("\n\n");
|
|
90
109
|
return {
|
|
91
110
|
content: [
|
|
92
111
|
{
|
|
@@ -137,5 +156,60 @@ ${webhookList}`,
|
|
|
137
156
|
};
|
|
138
157
|
}
|
|
139
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
|
+
});
|
|
140
214
|
}
|
|
141
215
|
//# sourceMappingURL=webhooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/tools/webhooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAwB;IAC9E,iBAAiB;IACjB,MAAM,CAAC,IAA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CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC1E,MAAM,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACnE,MAAM,MAAM,GAAG,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,eAAe,IAAI,kBAAkB,CAAC;gBAC7E,OAAO,KAAK,CAAC,CAAC,SAAS,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"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stables-mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "MCP server for Stables fiat-to-crypto API - enables AI agents to manage customers, quotes, and transfers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"stables-mcp-server": "
|
|
8
|
+
"stables-mcp-server": "build/index.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"build",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"lint:fix": "eslint src/ --fix",
|
|
25
25
|
"format": "prettier --write 'src/**/*.ts'",
|
|
26
26
|
"format:check": "prettier --check 'src/**/*.ts'",
|
|
27
|
-
"prepublishOnly": "npm run build"
|
|
27
|
+
"prepublishOnly": "npm run build",
|
|
28
|
+
"check:spec": "node scripts/check-spec-drift.mjs"
|
|
28
29
|
},
|
|
29
30
|
"keywords": [
|
|
30
31
|
"mcp",
|
|
@@ -32,11 +33,18 @@
|
|
|
32
33
|
"crypto",
|
|
33
34
|
"fiat",
|
|
34
35
|
"stablecoin",
|
|
36
|
+
"usdc",
|
|
37
|
+
"usdt",
|
|
35
38
|
"payments",
|
|
39
|
+
"payouts",
|
|
40
|
+
"virtual-accounts",
|
|
41
|
+
"agentic-commerce",
|
|
36
42
|
"ai-agents",
|
|
37
43
|
"model-context-protocol",
|
|
38
44
|
"claude",
|
|
39
|
-
"chatgpt"
|
|
45
|
+
"chatgpt",
|
|
46
|
+
"cursor",
|
|
47
|
+
"codex"
|
|
40
48
|
],
|
|
41
49
|
"author": "Stables (https://stables.money)",
|
|
42
50
|
"license": "MIT",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Notification Tools for Stables MCP Server
|
|
3
|
-
* Sends verification SMS to customers via Twilio
|
|
4
|
-
*/
|
|
5
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
|
-
import { StablesApiClient } from "../lib/stables-client.js";
|
|
7
|
-
export declare function registerNotificationTools(server: McpServer, client: StablesApiClient): void;
|
|
8
|
-
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../src/tools/notifications.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAmB,MAAM,0BAA0B,CAAC;AAS7E,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,gBAAgB,QAqJzB"}
|