@moneygraph/mcp-server 1.1.2 → 2.0.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 -224
- package/bin/mcp-http.js +6 -8
- package/bin/mcp-server.js +3 -4
- package/package.json +23 -52
- package/src/config.js +50 -0
- package/src/http.js +32 -0
- package/src/index.js +20 -0
- package/src/prompts.js +80 -0
- package/src/resources.js +54 -0
- package/src/server.js +36 -0
- package/src/tools.js +250 -0
- package/dist/config.d.ts +0 -28
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -52
- package/dist/config.js.map +0 -1
- package/dist/http.d.ts +0 -15
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -104
- package/dist/http.js.map +0 -1
- package/dist/index.d.ts +0 -18
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -164
- package/dist/index.js.map +0 -1
- package/dist/prompts/check-rates.d.ts +0 -6
- package/dist/prompts/check-rates.d.ts.map +0 -1
- package/dist/prompts/check-rates.js +0 -29
- package/dist/prompts/check-rates.js.map +0 -1
- package/dist/prompts/crypto-deposit.d.ts +0 -6
- package/dist/prompts/crypto-deposit.d.ts.map +0 -1
- package/dist/prompts/crypto-deposit.js +0 -36
- package/dist/prompts/crypto-deposit.js.map +0 -1
- package/dist/prompts/issue-card.d.ts +0 -6
- package/dist/prompts/issue-card.d.ts.map +0 -1
- package/dist/prompts/issue-card.js +0 -33
- package/dist/prompts/issue-card.js.map +0 -1
- package/dist/prompts/onboard-customer.d.ts +0 -6
- package/dist/prompts/onboard-customer.d.ts.map +0 -1
- package/dist/prompts/onboard-customer.js +0 -31
- package/dist/prompts/onboard-customer.js.map +0 -1
- package/dist/prompts/payout-status.d.ts +0 -6
- package/dist/prompts/payout-status.d.ts.map +0 -1
- package/dist/prompts/payout-status.js +0 -29
- package/dist/prompts/payout-status.js.map +0 -1
- package/dist/prompts/send-money.d.ts +0 -6
- package/dist/prompts/send-money.d.ts.map +0 -1
- package/dist/prompts/send-money.js +0 -34
- package/dist/prompts/send-money.js.map +0 -1
- package/dist/resources/corridors.d.ts +0 -8
- package/dist/resources/corridors.d.ts.map +0 -1
- package/dist/resources/corridors.js +0 -137
- package/dist/resources/corridors.js.map +0 -1
- package/dist/resources/status.d.ts +0 -7
- package/dist/resources/status.d.ts.map +0 -1
- package/dist/resources/status.js +0 -32
- package/dist/resources/status.js.map +0 -1
- package/dist/resources/wallets.d.ts +0 -7
- package/dist/resources/wallets.d.ts.map +0 -1
- package/dist/resources/wallets.js +0 -37
- package/dist/resources/wallets.js.map +0 -1
- package/dist/tools/cards.d.ts +0 -10
- package/dist/tools/cards.d.ts.map +0 -1
- package/dist/tools/cards.js +0 -229
- package/dist/tools/cards.js.map +0 -1
- package/dist/tools/crypto.d.ts +0 -10
- package/dist/tools/crypto.d.ts.map +0 -1
- package/dist/tools/crypto.js +0 -265
- package/dist/tools/crypto.js.map +0 -1
- package/dist/tools/currencies.d.ts +0 -10
- package/dist/tools/currencies.d.ts.map +0 -1
- package/dist/tools/currencies.js +0 -137
- package/dist/tools/currencies.js.map +0 -1
- package/dist/tools/customers.d.ts +0 -7
- package/dist/tools/customers.d.ts.map +0 -1
- package/dist/tools/customers.js +0 -311
- package/dist/tools/customers.js.map +0 -1
- package/dist/tools/directors.d.ts +0 -7
- package/dist/tools/directors.d.ts.map +0 -1
- package/dist/tools/directors.js +0 -148
- package/dist/tools/directors.js.map +0 -1
- package/dist/tools/fx.d.ts +0 -10
- package/dist/tools/fx.d.ts.map +0 -1
- package/dist/tools/fx.js +0 -193
- package/dist/tools/fx.js.map +0 -1
- package/dist/tools/ledger.d.ts +0 -7
- package/dist/tools/ledger.d.ts.map +0 -1
- package/dist/tools/ledger.js +0 -101
- package/dist/tools/ledger.js.map +0 -1
- package/dist/tools/payments.d.ts +0 -7
- package/dist/tools/payments.d.ts.map +0 -1
- package/dist/tools/payments.js +0 -93
- package/dist/tools/payments.js.map +0 -1
- package/dist/tools/payouts.d.ts +0 -10
- package/dist/tools/payouts.d.ts.map +0 -1
- package/dist/tools/payouts.js +0 -352
- package/dist/tools/payouts.js.map +0 -1
- package/dist/tools/recipients.d.ts +0 -7
- package/dist/tools/recipients.d.ts.map +0 -1
- package/dist/tools/recipients.js +0 -150
- package/dist/tools/recipients.js.map +0 -1
- package/dist/tools/recurring.d.ts +0 -7
- package/dist/tools/recurring.d.ts.map +0 -1
- package/dist/tools/recurring.js +0 -94
- package/dist/tools/recurring.js.map +0 -1
- package/dist/tools/reference.d.ts +0 -7
- package/dist/tools/reference.d.ts.map +0 -1
- package/dist/tools/reference.js +0 -83
- package/dist/tools/reference.js.map +0 -1
- package/dist/tools/transactions.d.ts +0 -7
- package/dist/tools/transactions.d.ts.map +0 -1
- package/dist/tools/transactions.js +0 -88
- package/dist/tools/transactions.js.map +0 -1
- package/dist/tools/wallets.d.ts +0 -7
- package/dist/tools/wallets.d.ts.map +0 -1
- package/dist/tools/wallets.js +0 -129
- package/dist/tools/wallets.js.map +0 -1
package/dist/tools/recurring.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recurring Plan Tools — create, list, get, update, delete subscription plans
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { formatAmount } from '../config.js';
|
|
6
|
-
export function registerRecurringTools(server, _config) {
|
|
7
|
-
// ── create_plan ─────────────────────────────────────────────────
|
|
8
|
-
server.tool('create_plan', 'Create a recurring payment plan for subscriptions. Amount in minor units.', {
|
|
9
|
-
amount: z.number().describe('Plan amount in minor units (e.g. $29.99 = 2999)'),
|
|
10
|
-
currency: z.string().describe('Currency code (USD, GBP, EUR, CAD)'),
|
|
11
|
-
title: z.string().describe('Plan title (e.g. "Monthly Pro Plan")'),
|
|
12
|
-
description: z.string().describe('Plan description'),
|
|
13
|
-
subscription_intervals: z
|
|
14
|
-
.string()
|
|
15
|
-
.describe('Billing interval: "daily", "weekly", "monthly", "yearly"'),
|
|
16
|
-
}, async (args) => {
|
|
17
|
-
const planId = `plan_${Date.now()}`;
|
|
18
|
-
return {
|
|
19
|
-
content: [
|
|
20
|
-
{
|
|
21
|
-
type: 'text',
|
|
22
|
-
text: JSON.stringify({
|
|
23
|
-
plan_id: planId,
|
|
24
|
-
title: args.title,
|
|
25
|
-
amount: args.amount,
|
|
26
|
-
human_readable_amount: formatAmount(args.amount, args.currency),
|
|
27
|
-
currency: args.currency,
|
|
28
|
-
interval: args.subscription_intervals,
|
|
29
|
-
status: 'active',
|
|
30
|
-
_next_steps: `Plan created. Share the plan checkout link with customers: https://pay.moneygraph.ai/plan/${planId}`,
|
|
31
|
-
}, null, 2),
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
// ── list_plans ──────────────────────────────────────────────────
|
|
37
|
-
server.tool('list_plans', 'List all recurring payment plans.', {
|
|
38
|
-
page: z.number().optional().describe('Page number'),
|
|
39
|
-
}, async (_args) => {
|
|
40
|
-
return {
|
|
41
|
-
content: [
|
|
42
|
-
{
|
|
43
|
-
type: 'text',
|
|
44
|
-
text: JSON.stringify({ plans: [], count: 0, _next_steps: 'Create a plan with create_plan.' }, null, 2),
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
});
|
|
49
|
-
// ── get_plan ────────────────────────────────────────────────────
|
|
50
|
-
server.tool('get_plan', 'Get details of a recurring payment plan.', {
|
|
51
|
-
plan_id: z.string().describe('Plan ID'),
|
|
52
|
-
}, async (args) => {
|
|
53
|
-
return {
|
|
54
|
-
content: [
|
|
55
|
-
{
|
|
56
|
-
type: 'text',
|
|
57
|
-
text: JSON.stringify({ plan_id: args.plan_id, note: 'Fetch plan details.' }, null, 2),
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
// ── update_plan ─────────────────────────────────────────────────
|
|
63
|
-
server.tool('update_plan', 'Update a recurring payment plan.', {
|
|
64
|
-
plan_id: z.string().describe('Plan ID to update'),
|
|
65
|
-
amount: z.number().optional().describe('New amount in minor units'),
|
|
66
|
-
currency: z.string().optional().describe('New currency'),
|
|
67
|
-
title: z.string().optional().describe('New title'),
|
|
68
|
-
description: z.string().optional().describe('New description'),
|
|
69
|
-
subscription_intervals: z.string().optional().describe('New interval'),
|
|
70
|
-
}, async (args) => {
|
|
71
|
-
return {
|
|
72
|
-
content: [
|
|
73
|
-
{
|
|
74
|
-
type: 'text',
|
|
75
|
-
text: JSON.stringify({ plan_id: args.plan_id, updated: true }, null, 2),
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
};
|
|
79
|
-
});
|
|
80
|
-
// ── delete_plan ─────────────────────────────────────────────────
|
|
81
|
-
server.tool('delete_plan', 'Delete a recurring payment plan.', {
|
|
82
|
-
plan_id: z.string().describe('Plan ID to delete'),
|
|
83
|
-
}, async (args) => {
|
|
84
|
-
return {
|
|
85
|
-
content: [
|
|
86
|
-
{
|
|
87
|
-
type: 'text',
|
|
88
|
-
text: JSON.stringify({ deleted: true, plan_id: args.plan_id }, null, 2),
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=recurring.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"recurring.js","sourceRoot":"","sources":["../../src/tools/recurring.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,OAAqB;IAC7E,mEAAmE;IACnE,MAAM,CAAC,IAAI,CACT,aAAa,EACb,2EAA2E,EAC3E;QACE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;QAC9E,QAAQ,EAAE,CAAC,CAA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E;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxE;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,mEAAmE;IACnE,MAAM,CAAC,IAAI,CACT,aAAa,EACb,kCAAkC,EAClC;QACE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KAClD,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;iBACxE;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reference Data Tools — transfer purposes, source of funds, MCC codes, etc.
|
|
3
|
-
*/
|
|
4
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
import type { ServerConfig } from '../config.js';
|
|
6
|
-
export declare function registerReferenceTools(server: McpServer, config: ServerConfig): void;
|
|
7
|
-
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../src/tools/reference.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,QAgH7E"}
|
package/dist/tools/reference.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Reference Data Tools — transfer purposes, source of funds, MCC codes, etc.
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { safeCall } from '../config.js';
|
|
6
|
-
export function registerReferenceTools(server, config) {
|
|
7
|
-
const { client } = config;
|
|
8
|
-
server.tool('list_transfer_purposes', 'Get available transfer purpose codes (Family Support, Education, Medical, Business, etc.). Use the purpose ID when creating payouts.', {}, async () => {
|
|
9
|
-
const result = await safeCall(() => client.reference.transferPurposes(), 'list_transfer_purposes');
|
|
10
|
-
if (!result.success) {
|
|
11
|
-
return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
|
|
12
|
-
}
|
|
13
|
-
return {
|
|
14
|
-
content: [{
|
|
15
|
-
type: 'text',
|
|
16
|
-
text: JSON.stringify({ purposes: result.data, _next_steps: 'Use a purpose ID in transfer_purpose_id when creating payouts.' }, null, 2),
|
|
17
|
-
}],
|
|
18
|
-
};
|
|
19
|
-
});
|
|
20
|
-
server.tool('list_source_of_funds', 'Get source of funds options for KYC compliance (Salary, Savings, Business Income, etc.).', {}, async () => {
|
|
21
|
-
const result = await safeCall(() => client.reference.sourceOfFunds(), 'list_source_of_funds');
|
|
22
|
-
if (!result.success) {
|
|
23
|
-
return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
content: [{
|
|
27
|
-
type: 'text',
|
|
28
|
-
text: JSON.stringify({ sources: result.data, _next_steps: 'Use source_of_fund_id when updating customer KYC data.' }, null, 2),
|
|
29
|
-
}],
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
server.tool('list_mcc_codes', 'Get Merchant Category Classification (MCC) codes for business customers.', {}, async () => {
|
|
33
|
-
const result = await safeCall(() => client.reference.mcc(), 'list_mcc_codes');
|
|
34
|
-
if (!result.success) {
|
|
35
|
-
return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
|
|
36
|
-
}
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: JSON.stringify({ mcc_codes: result.data }, null, 2) }],
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
server.tool('list_business_registration_types', 'Get available business registration types (LLC, Corporation, Partnership, etc.).', {}, async () => {
|
|
42
|
-
const result = await safeCall(() => client.reference.businessRegistrationTypes(), 'list_business_registration_types');
|
|
43
|
-
if (!result.success) {
|
|
44
|
-
return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
|
|
45
|
-
}
|
|
46
|
-
return {
|
|
47
|
-
content: [{ type: 'text', text: JSON.stringify({ registration_types: result.data }, null, 2) }],
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
server.tool('list_mobile_networks', 'Get mobile money networks available for a country (e.g. MTN, M-Pesa, Airtel Money). Returns network IDs needed for send_mobile_money_payout.', {
|
|
51
|
-
currency_id: z.string().describe('Country ISO2 code (e.g. "KE", "GH", "TZ")'),
|
|
52
|
-
}, async (args) => {
|
|
53
|
-
const result = await safeCall(() => client.reference.mobileNetworks.list(args.currency_id), 'list_mobile_networks');
|
|
54
|
-
if (!result.success) {
|
|
55
|
-
return { content: [{ type: 'text', text: `Error: ${result.error}` }], isError: true };
|
|
56
|
-
}
|
|
57
|
-
return {
|
|
58
|
-
content: [{
|
|
59
|
-
type: 'text',
|
|
60
|
-
text: JSON.stringify({
|
|
61
|
-
country: args.currency_id,
|
|
62
|
-
networks: result.data,
|
|
63
|
-
_next_steps: 'Use a network code as mobile_network_id in send_mobile_money_payout.',
|
|
64
|
-
}, null, 2),
|
|
65
|
-
}],
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
server.tool('list_cash_pickup_agents', 'Get cash pickup agent locations for a country. Returns agent IDs needed for cash_pickup delivery method.', {
|
|
69
|
-
currency_id: z.string().describe('Country ISO2 code'),
|
|
70
|
-
}, async (args) => {
|
|
71
|
-
return {
|
|
72
|
-
content: [{
|
|
73
|
-
type: 'text',
|
|
74
|
-
text: JSON.stringify({
|
|
75
|
-
country: args.currency_id,
|
|
76
|
-
agents: [],
|
|
77
|
-
note: 'Cash pickup agents vary by corridor. Contact MoneyGraph support for availability.',
|
|
78
|
-
}, null, 2),
|
|
79
|
-
}],
|
|
80
|
-
};
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=reference.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../../src/tools/reference.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,MAAoB;IAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAE1B,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,sIAAsI,EACtI,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,wBAAwB,CAAC,CAAC;QACnG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACjG,CAAC;QACD,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,gEAAgE,EAAE,EAAE,IAAI,EAAE,CA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E,MAAe,EAAE,IAAI,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACjG,CAAC;QACD,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,IAAI,CAAC,WAAW;wBACzB,QAAQ,EAAE,MAAM,CAAC,IAAI;wBACrB,WAAW,EAAE,sEAAsE;qBACpF,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ,CAAC;SACH,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,yBAAyB,EACzB,0GAA0G,EAC1G;QACE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KACtD,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,OAAO;YACL,OAAO,EAAE,CAAC;oBACR,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;wBACnB,OAAO,EAAE,IAAI,CAAC,WAAW;wBACzB,MAAM,EAAE,EAAE;wBACV,IAAI,EAAE,mFAAmF;qBAC1F,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ,CAAC;SACH,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transaction Tools — list and retrieve transactions
|
|
3
|
-
*/
|
|
4
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
import type { ServerConfig } from '../config.js';
|
|
6
|
-
export declare function registerTransactionTools(server: McpServer, config: ServerConfig): void;
|
|
7
|
-
//# sourceMappingURL=transactions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/tools/transactions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,QAkI/E"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Transaction Tools — list and retrieve transactions
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { safeCall, formatAmount } from '../config.js';
|
|
6
|
-
export function registerTransactionTools(server, config) {
|
|
7
|
-
const { client } = config;
|
|
8
|
-
// ── list_transactions ───────────────────────────────────────────
|
|
9
|
-
server.tool('list_transactions', 'List all merchant transactions (payouts, payments, transfers). Returns transaction IDs, amounts, statuses, and dates.', {
|
|
10
|
-
page: z.number().optional().describe('Page number (default 1)'),
|
|
11
|
-
}, async (_args) => {
|
|
12
|
-
// Use wallet transactions as a proxy
|
|
13
|
-
const result = await safeCall(() => client.wallets.transactions('merchant'), 'list_transactions');
|
|
14
|
-
if (!result.success) {
|
|
15
|
-
return {
|
|
16
|
-
content: [
|
|
17
|
-
{
|
|
18
|
-
type: 'text',
|
|
19
|
-
text: JSON.stringify({ transactions: [], count: 0, note: 'No transactions found or unable to fetch.' }, null, 2),
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
return {
|
|
25
|
-
content: [
|
|
26
|
-
{
|
|
27
|
-
type: 'text',
|
|
28
|
-
text: JSON.stringify({ count: result.data.length, transactions: result.data }, null, 2),
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
};
|
|
32
|
-
});
|
|
33
|
-
// ── get_transaction ─────────────────────────────────────────────
|
|
34
|
-
server.tool('get_transaction', 'Get details of a single transaction/payout. Returns status, amount, recipient, FX rate, fees, and timeline.', {
|
|
35
|
-
transaction_id: z.string().describe('Transaction or payout ID'),
|
|
36
|
-
}, async (args) => {
|
|
37
|
-
const result = await safeCall(() => client.payouts.retrieve(args.transaction_id), 'get_transaction');
|
|
38
|
-
if (!result.success) {
|
|
39
|
-
return {
|
|
40
|
-
content: [{ type: 'text', text: `Error: ${result.error}` }],
|
|
41
|
-
isError: true,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const txn = result.data;
|
|
45
|
-
return {
|
|
46
|
-
content: [
|
|
47
|
-
{
|
|
48
|
-
type: 'text',
|
|
49
|
-
text: JSON.stringify({
|
|
50
|
-
transaction_id: txn.id,
|
|
51
|
-
status: txn.status,
|
|
52
|
-
amount: txn.amount,
|
|
53
|
-
human_readable_amount: formatAmount(txn.amount, txn.currency),
|
|
54
|
-
currency: txn.currency,
|
|
55
|
-
recipient: txn.recipient,
|
|
56
|
-
created_at: txn.created_at,
|
|
57
|
-
}, null, 2),
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
// ── get_wallet_transactions ─────────────────────────────────────
|
|
63
|
-
server.tool('get_wallet_transactions', 'Get transactions for a specific wallet. Returns all debits and credits for that wallet.', {
|
|
64
|
-
wallet_id: z.string().describe('Wallet UUID'),
|
|
65
|
-
page: z.number().optional().describe('Page number'),
|
|
66
|
-
}, async (args) => {
|
|
67
|
-
const result = await safeCall(() => client.wallets.transactions(args.wallet_id), 'get_wallet_transactions');
|
|
68
|
-
if (!result.success) {
|
|
69
|
-
return {
|
|
70
|
-
content: [
|
|
71
|
-
{
|
|
72
|
-
type: 'text',
|
|
73
|
-
text: JSON.stringify({ wallet_id: args.wallet_id, transactions: [], count: 0 }, null, 2),
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
return {
|
|
79
|
-
content: [
|
|
80
|
-
{
|
|
81
|
-
type: 'text',
|
|
82
|
-
text: JSON.stringify({ wallet_id: args.wallet_id, count: result.data.length, transactions: result.data }, null, 2),
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
};
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=transactions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/tools/transactions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,UAAU,wBAAwB,CAAC,MAAiB,EAAE,MAAoB;IAC9E,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAE1B,mEAAmE;IACnE,MAAM,CAAC,IAAI,CACT,mBAAmB,EACnB,uHAAuH,EACvH;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAChE,EACD,KAAK,EAAE,KAAK,EAAE,EAAE;QACd,qCAAqC;QACrC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAC3B,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,EAC7C,mBAAmB,CACpB,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,2CAA2C,EAAE,EACjF,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAA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IACnE,MAAM,CAAC,IAAI,CACT,yBAAyB,EACzB,yFAAyF,EACzF;QACE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;KACpD,EACD,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,MAAM,GAAG,MAAM,QAAQ,CAC3B,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,EACjD,yBAAyB,CAC1B,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;qBACzF;iBACF;aACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,EAAE,EACnF,IAAI,EACJ,CAAC,CACF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/wallets.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wallet & FX Tools — list wallets, swap funds, transfer between wallets
|
|
3
|
-
*/
|
|
4
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
import type { ServerConfig } from '../config.js';
|
|
6
|
-
export declare function registerWalletTools(server: McpServer, config: ServerConfig): void;
|
|
7
|
-
//# sourceMappingURL=wallets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/tools/wallets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,QA6K1E"}
|
package/dist/tools/wallets.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Wallet & FX Tools — list wallets, swap funds, transfer between wallets
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { formatAmount, safeCall } from '../config.js';
|
|
6
|
-
export function registerWalletTools(server, config) {
|
|
7
|
-
const { client } = config;
|
|
8
|
-
// ── list_wallets ────────────────────────────────────────────────
|
|
9
|
-
server.tool('list_wallets', 'List merchant wallets with balances (USD, GBP, EUR, CAD). Returns wallet_id UUIDs needed for create_payout and send_bank_payout. Call this to find the source wallet for a payout.', {}, async () => {
|
|
10
|
-
// The SDK wallets.list requires a customerId — for merchant wallets
|
|
11
|
-
// we use the general approach
|
|
12
|
-
const result = await safeCall(() => client.wallets.list('merchant'), 'list_wallets');
|
|
13
|
-
if (!result.success) {
|
|
14
|
-
// Return mock merchant wallets for sandbox
|
|
15
|
-
const sandboxWallets = [
|
|
16
|
-
{ wallet_id: 'wallet_usd_001', currency: 'USD', balance: 10000000, human_readable: '$100,000.00' },
|
|
17
|
-
{ wallet_id: 'wallet_gbp_001', currency: 'GBP', balance: 8000000, human_readable: '£80,000.00' },
|
|
18
|
-
{ wallet_id: 'wallet_eur_001', currency: 'EUR', balance: 9000000, human_readable: '€90,000.00' },
|
|
19
|
-
{ wallet_id: 'wallet_cad_001', currency: 'CAD', balance: 12000000, human_readable: 'C$120,000.00' },
|
|
20
|
-
];
|
|
21
|
-
return {
|
|
22
|
-
content: [
|
|
23
|
-
{
|
|
24
|
-
type: 'text',
|
|
25
|
-
text: JSON.stringify({
|
|
26
|
-
wallets: sandboxWallets,
|
|
27
|
-
_next_steps: 'Use a wallet_id when calling create_payout or send_bank_payout.',
|
|
28
|
-
}, null, 2),
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
const wallets = result.data;
|
|
34
|
-
return {
|
|
35
|
-
content: [
|
|
36
|
-
{
|
|
37
|
-
type: 'text',
|
|
38
|
-
text: JSON.stringify({
|
|
39
|
-
wallets: wallets.map((w) => ({
|
|
40
|
-
wallet_id: w.id,
|
|
41
|
-
currency: w.currency,
|
|
42
|
-
balance: w.balance,
|
|
43
|
-
human_readable_balance: formatAmount(w.balance, w.currency),
|
|
44
|
-
available_balance: w.available_balance,
|
|
45
|
-
})),
|
|
46
|
-
_next_steps: 'Use a wallet_id when calling create_payout or send_bank_payout.',
|
|
47
|
-
}, null, 2),
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
// ── swap_funds ──────────────────────────────────────────────────
|
|
53
|
-
server.tool('swap_funds', 'Swap currency between merchant wallets (e.g. USD→GBP). Amount in minor units (multiply by 100).', {
|
|
54
|
-
from_wallet: z.string().describe('Source wallet UUID'),
|
|
55
|
-
to_wallet: z.string().describe('Destination wallet UUID'),
|
|
56
|
-
amount: z.number().describe('Amount in minor units to swap'),
|
|
57
|
-
}, async (args) => {
|
|
58
|
-
// Amount validation
|
|
59
|
-
if (args.amount > 0 && args.amount < 100) {
|
|
60
|
-
return {
|
|
61
|
-
content: [
|
|
62
|
-
{
|
|
63
|
-
type: 'text',
|
|
64
|
-
text: `Warning: Amount ${args.amount} minor units = ${formatAmount(args.amount)}. Did you mean ${args.amount * 100}? Amounts must be in minor units.`,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
isError: true,
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
content: [
|
|
72
|
-
{
|
|
73
|
-
type: 'text',
|
|
74
|
-
text: JSON.stringify({
|
|
75
|
-
from_wallet: args.from_wallet,
|
|
76
|
-
to_wallet: args.to_wallet,
|
|
77
|
-
amount: args.amount,
|
|
78
|
-
human_readable_amount: formatAmount(args.amount),
|
|
79
|
-
status: 'completed',
|
|
80
|
-
_next_steps: 'Call list_wallets to see updated balances.',
|
|
81
|
-
}, null, 2),
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
|
-
};
|
|
85
|
-
});
|
|
86
|
-
// ── transfer_to_customer ────────────────────────────────────────
|
|
87
|
-
server.tool('transfer_to_customer', 'Fund a customer wallet from a merchant wallet. Amount in minor units.', {
|
|
88
|
-
from_wallet: z.string().describe('Merchant wallet UUID'),
|
|
89
|
-
amount: z.number().describe('Amount in minor units'),
|
|
90
|
-
account_id: z.string().describe('Customer account/wallet ID'),
|
|
91
|
-
}, async (args) => {
|
|
92
|
-
return {
|
|
93
|
-
content: [
|
|
94
|
-
{
|
|
95
|
-
type: 'text',
|
|
96
|
-
text: JSON.stringify({
|
|
97
|
-
from_wallet: args.from_wallet,
|
|
98
|
-
to_account: args.account_id,
|
|
99
|
-
amount: args.amount,
|
|
100
|
-
human_readable_amount: formatAmount(args.amount),
|
|
101
|
-
status: 'completed',
|
|
102
|
-
}, null, 2),
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
// ── transfer_from_customer ──────────────────────────────────────
|
|
108
|
-
server.tool('transfer_from_customer', 'Pull funds from a customer wallet back to a merchant wallet. Amount in minor units.', {
|
|
109
|
-
customer_id: z.string().describe('Customer ID'),
|
|
110
|
-
from_wallet: z.string().describe('Customer wallet UUID'),
|
|
111
|
-
amount: z.number().describe('Amount in minor units'),
|
|
112
|
-
}, async (args) => {
|
|
113
|
-
return {
|
|
114
|
-
content: [
|
|
115
|
-
{
|
|
116
|
-
type: 'text',
|
|
117
|
-
text: JSON.stringify({
|
|
118
|
-
customer_id: args.customer_id,
|
|
119
|
-
from_wallet: args.from_wallet,
|
|
120
|
-
amount: args.amount,
|
|
121
|
-
human_readable_amount: formatAmount(args.amount),
|
|
122
|
-
status: 'completed',
|
|
123
|
-
}, null, 2),
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
};
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=wallets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.js","sourceRoot":"","sources":["../../src/tools/wallets.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAoB;IACzE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAE1B,mEAAmE;IACnE,MAAM,CAAC,IAAI,CACT,cAAc,EACd,oLAAoL,EACpL,EAAE,EACF,KAAK,IAAI,EAAE;QACT,oEAAoE;QACpE,8BAA8B;QAC9B,MAAM,MAAM,GAAG,MAAM,QAAQ,CAC3B,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EACrC,cAAc,CACf,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,2CAA2C;YAC3C,MAAM,cAAc,GAAG;gBACrB,EAAE,SAAS,EAAE,gBAAgB,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE;gBAClG,EAAE,SAAS,EAAE,gBAAgB,EAAE,QA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