@moneygraph/mcp-server 1.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.
Files changed (138) hide show
  1. package/.claude/settings.local.json +13 -0
  2. package/README.md +224 -0
  3. package/bin/mcp-http.js +10 -0
  4. package/bin/mcp-server.js +8 -0
  5. package/dist/config.d.ts +28 -0
  6. package/dist/config.d.ts.map +1 -0
  7. package/dist/config.js +53 -0
  8. package/dist/config.js.map +1 -0
  9. package/dist/http.d.ts +15 -0
  10. package/dist/http.d.ts.map +1 -0
  11. package/dist/http.js +104 -0
  12. package/dist/http.js.map +1 -0
  13. package/dist/index.d.ts +18 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +164 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/prompts/check-rates.d.ts +6 -0
  18. package/dist/prompts/check-rates.d.ts.map +1 -0
  19. package/dist/prompts/check-rates.js +29 -0
  20. package/dist/prompts/check-rates.js.map +1 -0
  21. package/dist/prompts/crypto-deposit.d.ts +6 -0
  22. package/dist/prompts/crypto-deposit.d.ts.map +1 -0
  23. package/dist/prompts/crypto-deposit.js +36 -0
  24. package/dist/prompts/crypto-deposit.js.map +1 -0
  25. package/dist/prompts/issue-card.d.ts +6 -0
  26. package/dist/prompts/issue-card.d.ts.map +1 -0
  27. package/dist/prompts/issue-card.js +33 -0
  28. package/dist/prompts/issue-card.js.map +1 -0
  29. package/dist/prompts/onboard-customer.d.ts +6 -0
  30. package/dist/prompts/onboard-customer.d.ts.map +1 -0
  31. package/dist/prompts/onboard-customer.js +31 -0
  32. package/dist/prompts/onboard-customer.js.map +1 -0
  33. package/dist/prompts/payout-status.d.ts +6 -0
  34. package/dist/prompts/payout-status.d.ts.map +1 -0
  35. package/dist/prompts/payout-status.js +29 -0
  36. package/dist/prompts/payout-status.js.map +1 -0
  37. package/dist/prompts/send-money.d.ts +6 -0
  38. package/dist/prompts/send-money.d.ts.map +1 -0
  39. package/dist/prompts/send-money.js +34 -0
  40. package/dist/prompts/send-money.js.map +1 -0
  41. package/dist/resources/corridors.d.ts +8 -0
  42. package/dist/resources/corridors.d.ts.map +1 -0
  43. package/dist/resources/corridors.js +137 -0
  44. package/dist/resources/corridors.js.map +1 -0
  45. package/dist/resources/status.d.ts +7 -0
  46. package/dist/resources/status.d.ts.map +1 -0
  47. package/dist/resources/status.js +32 -0
  48. package/dist/resources/status.js.map +1 -0
  49. package/dist/resources/wallets.d.ts +7 -0
  50. package/dist/resources/wallets.d.ts.map +1 -0
  51. package/dist/resources/wallets.js +37 -0
  52. package/dist/resources/wallets.js.map +1 -0
  53. package/dist/tools/cards.d.ts +10 -0
  54. package/dist/tools/cards.d.ts.map +1 -0
  55. package/dist/tools/cards.js +229 -0
  56. package/dist/tools/cards.js.map +1 -0
  57. package/dist/tools/crypto.d.ts +10 -0
  58. package/dist/tools/crypto.d.ts.map +1 -0
  59. package/dist/tools/crypto.js +265 -0
  60. package/dist/tools/crypto.js.map +1 -0
  61. package/dist/tools/currencies.d.ts +10 -0
  62. package/dist/tools/currencies.d.ts.map +1 -0
  63. package/dist/tools/currencies.js +84 -0
  64. package/dist/tools/currencies.js.map +1 -0
  65. package/dist/tools/customers.d.ts +7 -0
  66. package/dist/tools/customers.d.ts.map +1 -0
  67. package/dist/tools/customers.js +310 -0
  68. package/dist/tools/customers.js.map +1 -0
  69. package/dist/tools/directors.d.ts +7 -0
  70. package/dist/tools/directors.d.ts.map +1 -0
  71. package/dist/tools/directors.js +148 -0
  72. package/dist/tools/directors.js.map +1 -0
  73. package/dist/tools/fx.d.ts +10 -0
  74. package/dist/tools/fx.d.ts.map +1 -0
  75. package/dist/tools/fx.js +193 -0
  76. package/dist/tools/fx.js.map +1 -0
  77. package/dist/tools/ledger.d.ts +7 -0
  78. package/dist/tools/ledger.d.ts.map +1 -0
  79. package/dist/tools/ledger.js +101 -0
  80. package/dist/tools/ledger.js.map +1 -0
  81. package/dist/tools/payments.d.ts +7 -0
  82. package/dist/tools/payments.d.ts.map +1 -0
  83. package/dist/tools/payments.js +93 -0
  84. package/dist/tools/payments.js.map +1 -0
  85. package/dist/tools/payouts.d.ts +10 -0
  86. package/dist/tools/payouts.d.ts.map +1 -0
  87. package/dist/tools/payouts.js +352 -0
  88. package/dist/tools/payouts.js.map +1 -0
  89. package/dist/tools/recipients.d.ts +7 -0
  90. package/dist/tools/recipients.d.ts.map +1 -0
  91. package/dist/tools/recipients.js +150 -0
  92. package/dist/tools/recipients.js.map +1 -0
  93. package/dist/tools/recurring.d.ts +7 -0
  94. package/dist/tools/recurring.d.ts.map +1 -0
  95. package/dist/tools/recurring.js +94 -0
  96. package/dist/tools/recurring.js.map +1 -0
  97. package/dist/tools/reference.d.ts +7 -0
  98. package/dist/tools/reference.d.ts.map +1 -0
  99. package/dist/tools/reference.js +83 -0
  100. package/dist/tools/reference.js.map +1 -0
  101. package/dist/tools/transactions.d.ts +7 -0
  102. package/dist/tools/transactions.d.ts.map +1 -0
  103. package/dist/tools/transactions.js +88 -0
  104. package/dist/tools/transactions.js.map +1 -0
  105. package/dist/tools/wallets.d.ts +7 -0
  106. package/dist/tools/wallets.d.ts.map +1 -0
  107. package/dist/tools/wallets.js +129 -0
  108. package/dist/tools/wallets.js.map +1 -0
  109. package/package.json +67 -0
  110. package/railway.json +14 -0
  111. package/src/config.ts +73 -0
  112. package/src/http.ts +118 -0
  113. package/src/index.ts +184 -0
  114. package/src/prompts/check-rates.ts +36 -0
  115. package/src/prompts/crypto-deposit.ts +43 -0
  116. package/src/prompts/issue-card.ts +40 -0
  117. package/src/prompts/onboard-customer.ts +39 -0
  118. package/src/prompts/payout-status.ts +36 -0
  119. package/src/prompts/send-money.ts +41 -0
  120. package/src/resources/corridors.ts +190 -0
  121. package/src/resources/status.ts +44 -0
  122. package/src/resources/wallets.ts +48 -0
  123. package/src/tools/cards.ts +302 -0
  124. package/src/tools/crypto.ts +382 -0
  125. package/src/tools/currencies.ts +122 -0
  126. package/src/tools/customers.ts +458 -0
  127. package/src/tools/directors.ts +209 -0
  128. package/src/tools/fx.ts +253 -0
  129. package/src/tools/ledger.ts +133 -0
  130. package/src/tools/payments.ts +118 -0
  131. package/src/tools/payouts.ts +452 -0
  132. package/src/tools/recipients.ts +204 -0
  133. package/src/tools/recurring.ts +130 -0
  134. package/src/tools/reference.ts +122 -0
  135. package/src/tools/transactions.ts +140 -0
  136. package/src/tools/wallets.ts +183 -0
  137. package/test/smoke.test.mjs +196 -0
  138. package/tsconfig.json +21 -0
package/src/http.ts ADDED
@@ -0,0 +1,118 @@
1
+ /**
2
+ * MoneyGraph MCP Server — HTTP Transport
3
+ *
4
+ * Runs the MCP server over HTTP using StreamableHTTPServerTransport.
5
+ * Supports SSE streaming for server-to-client messages.
6
+ *
7
+ * Routes:
8
+ * POST /mcp — Handle MCP JSON-RPC messages
9
+ * GET /mcp — SSE stream for server-to-client notifications
10
+ * DELETE /mcp — Close session
11
+ * GET /health — Health check (for Railway, load balancers)
12
+ */
13
+
14
+ import { createServer as createHTTPServer, type IncomingMessage, type ServerResponse } from 'node:http';
15
+ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
16
+ import { createServer } from './index.js';
17
+ import type { ServerConfig } from './config.js';
18
+
19
+ const ALLOWED_ORIGINS = [
20
+ 'http://localhost:5173', // Vite dev server
21
+ 'http://localhost:8888', // Netlify dev
22
+ 'https://moneygraph.netlify.app',
23
+ ];
24
+
25
+ function setCORSHeaders(req: IncomingMessage, res: ServerResponse) {
26
+ const origin = req.headers.origin || '';
27
+ // Allow configured origins, or any origin in development
28
+ if (ALLOWED_ORIGINS.includes(origin) || process.env.CORS_ALLOW_ALL === 'true') {
29
+ res.setHeader('Access-Control-Allow-Origin', origin);
30
+ }
31
+ res.setHeader('Access-Control-Allow-Methods', 'GET, POST, DELETE, OPTIONS');
32
+ res.setHeader('Access-Control-Allow-Headers', 'Content-Type, mcp-session-id');
33
+ res.setHeader('Access-Control-Expose-Headers', 'mcp-session-id');
34
+ }
35
+
36
+ function readBody(req: IncomingMessage): Promise<string> {
37
+ return new Promise((resolve, reject) => {
38
+ const chunks: Buffer[] = [];
39
+ req.on('data', (chunk) => chunks.push(chunk));
40
+ req.on('end', () => resolve(Buffer.concat(chunks).toString()));
41
+ req.on('error', reject);
42
+ });
43
+ }
44
+
45
+ export async function startHTTPServer(config: ServerConfig) {
46
+ const port = parseInt(process.env.PORT || '3001', 10);
47
+
48
+ const httpServer = createHTTPServer(async (req, res) => {
49
+ setCORSHeaders(req, res);
50
+
51
+ // Handle CORS preflight
52
+ if (req.method === 'OPTIONS') {
53
+ res.writeHead(204);
54
+ res.end();
55
+ return;
56
+ }
57
+
58
+ const url = new URL(req.url || '/', `http://${req.headers.host || 'localhost'}`);
59
+
60
+ // ── Health check ────────────────────────────────────────
61
+ if (url.pathname === '/health') {
62
+ res.writeHead(200, { 'Content-Type': 'application/json' });
63
+ res.end(JSON.stringify({
64
+ status: 'ok',
65
+ server: '@moneygraph/mcp-server',
66
+ version: '1.0.0',
67
+ mode: config.mode,
68
+ transport: 'http',
69
+ tools: 76,
70
+ resources: 6,
71
+ prompts: 6,
72
+ }));
73
+ return;
74
+ }
75
+
76
+ // ── MCP endpoint ────────────────────────────────────────
77
+ if (url.pathname === '/mcp') {
78
+ // Create a new server + transport per request (stateless mode)
79
+ const server = createServer(config);
80
+ const transport = new StreamableHTTPServerTransport({
81
+ sessionIdGenerator: undefined, // Stateless
82
+ });
83
+
84
+ // Connect MCP server to transport
85
+ await server.connect(transport);
86
+
87
+ // Parse body for POST requests
88
+ if (req.method === 'POST') {
89
+ const body = await readBody(req);
90
+ let parsed: unknown;
91
+ try {
92
+ parsed = JSON.parse(body);
93
+ } catch {
94
+ res.writeHead(400, { 'Content-Type': 'application/json' });
95
+ res.end(JSON.stringify({ error: 'Invalid JSON' }));
96
+ return;
97
+ }
98
+ await transport.handleRequest(req, res, parsed);
99
+ } else {
100
+ // GET (SSE) or DELETE
101
+ await transport.handleRequest(req, res);
102
+ }
103
+ return;
104
+ }
105
+
106
+ // ── 404 for everything else ─────────────────────────────
107
+ res.writeHead(404, { 'Content-Type': 'application/json' });
108
+ res.end(JSON.stringify({ error: 'Not found', endpoints: ['/mcp', '/health'] }));
109
+ });
110
+
111
+ httpServer.listen(port, () => {
112
+ console.error(
113
+ `MoneyGraph MCP Server v1.0.0 — ${config.mode} mode — HTTP transport on port ${port} — 76 tools, 6 resources, 6 prompts`
114
+ );
115
+ console.error(` MCP endpoint: http://localhost:${port}/mcp`);
116
+ console.error(` Health check: http://localhost:${port}/health`);
117
+ });
118
+ }
package/src/index.ts ADDED
@@ -0,0 +1,184 @@
1
+ /**
2
+ * MoneyGraph MCP Server — Main Entry Point
3
+ *
4
+ * The first MCP server for real cross-border money movement.
5
+ * 76 tools, 6 resources, 6 prompts.
6
+ * 82+ countries, 328 FX pairs, bank transfers, mobile money, SWIFT,
7
+ * virtual/physical cards, crypto on-ramp/off-ramp.
8
+ *
9
+ * Supports two transport modes:
10
+ * - stdio (default): For Claude Desktop, Cursor, VS Code
11
+ * - http: For web clients (moneygraph-chat, Claude connector)
12
+ * Set MONEYGRAPH_TRANSPORT=http to enable
13
+ */
14
+
15
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
16
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
17
+
18
+ import { loadConfig, type ServerConfig } from './config.js';
19
+
20
+ // Tools
21
+ import { registerCustomerTools } from './tools/customers.js';
22
+ import { registerDirectorTools } from './tools/directors.js';
23
+ import { registerCurrencyTools } from './tools/currencies.js';
24
+ import { registerRecipientTools } from './tools/recipients.js';
25
+ import { registerPayoutTools } from './tools/payouts.js';
26
+ import { registerWalletTools } from './tools/wallets.js';
27
+ import { registerPaymentTools } from './tools/payments.js';
28
+ import { registerRecurringTools } from './tools/recurring.js';
29
+ import { registerTransactionTools } from './tools/transactions.js';
30
+ import { registerReferenceTools } from './tools/reference.js';
31
+ import { registerLedgerTools } from './tools/ledger.js';
32
+ import { registerCardTools } from './tools/cards.js';
33
+ import { registerCryptoTools } from './tools/crypto.js';
34
+ import { registerFXTools } from './tools/fx.js';
35
+
36
+ // Resources
37
+ import { registerStatusResource } from './resources/status.js';
38
+ import { registerWalletsResource } from './resources/wallets.js';
39
+ import { registerCorridorsResource } from './resources/corridors.js';
40
+
41
+ // Prompts
42
+ import { registerSendMoneyPrompt } from './prompts/send-money.js';
43
+ import { registerOnboardCustomerPrompt } from './prompts/onboard-customer.js';
44
+ import { registerCheckRatesPrompt } from './prompts/check-rates.js';
45
+ import { registerTrackPayoutPrompt } from './prompts/payout-status.js';
46
+ import { registerIssueCardPrompt } from './prompts/issue-card.js';
47
+ import { registerCryptoDepositPrompt } from './prompts/crypto-deposit.js';
48
+
49
+ // ── Server Instructions ───────────────────────────────────────────
50
+ function getServerInstructions(mode: string): string {
51
+ return `MoneyGraph MCP Server — Cross-Border Payment Infrastructure
52
+
53
+ IMPORTANT CONCEPTS:
54
+ - DATE FORMAT: DD-MM-YYYY (e.g., "15-06-1990") — required for all dates
55
+ - FX EXPIRY: Quotes expire in 2 minutes — call confirm_fx_quote promptly
56
+ - IDEMPOTENCY: Always include unique idempotency_key for payouts to prevent duplicates
57
+ - TWO-STEP PAYOUT FLOW: (1) create recipient → (2) create payout. Or use convenience tools: send_bank_payout, send_mobile_money_payout, smart_payout.
58
+ - AMOUNTS IN MINOR UNITS: All monetary amounts are in minor units. $500.00 = 50000. Always multiply by 100.
59
+ - GET_CURRENCIES IS KEY: Before any payout, call get_currencies with the destination country code. Returns corridor UUIDs, delivery window UUIDs, rates, fees, and limits.
60
+ - CUSTOMER IDS: Numeric strings like "0605399" (not UUIDs)
61
+ - ALL OTHER IDS: UUIDs (wallet_id, recipient_id, corridor_id, delivery_window_id)
62
+ - KYC REQUIRED: Only APPROVED customers can send payouts or get cards. In sandbox, submit_kyc auto-approves.
63
+
64
+ RECOMMENDED FLOW FOR SENDING MONEY:
65
+ 1. get_currencies (destination country) → corridor ID, delivery window ID, rate, fees
66
+ 2. list_wallets → find source wallet (USD, GBP, EUR, or CAD)
67
+ 3. Create or find customer → create_customer + submit_kyc (if new)
68
+ 4. get_fx_quote → get live rate and fee → confirm_fx_quote → lock the rate
69
+ 5. send_bank_payout / send_mobile_money_payout / smart_payout → execute transfer
70
+ 6. Report confirmation with transaction ID, rate, fees, and estimated delivery
71
+
72
+ FX QUOTE FLOW (CRITICAL — 2 MIN EXPIRY):
73
+ 1. get_fx_quote with source/destination currencies + amount
74
+ 2. confirm_fx_quote with quote_id (MUST call within 2 minutes)
75
+ 3. Use confirmed quote_id when creating payouts
76
+
77
+ CARD ISSUANCE FLOW:
78
+ 1. Ensure customer has APPROVED KYC (check_kyc_status)
79
+ 2. create_card with customer_id, type (virtual/physical), currency
80
+ 3. fund_card to load balance from a wallet
81
+ 4. Virtual cards are instant; physical cards are shipped
82
+
83
+ CRYPTO FLOW:
84
+ 1. create_crypto_address → get deposit address + QR code
85
+ 2. Track deposits with list_crypto_deposits
86
+ 3. Convert crypto to fiat with crypto_convert_quote → crypto_convert_execute
87
+ 4. Send crypto payouts with send_crypto_payout
88
+
89
+ PAYOUT RAILS:
90
+ - Bank: ACH (US), SEPA (EU), Faster Payments (UK), SWIFT (global)
91
+ - Mobile Money: M-Pesa, MTN, Airtel, Vodafone, Orange
92
+ - Crypto: USDC, USDT, BTC, ETH on Ethereum, Tron, Polygon, Base, Solana
93
+ - Cards: Virtual + Physical debit cards in USD, GBP, EUR
94
+
95
+ BASE CURRENCIES: USD, GBP, EUR, CAD
96
+ DELIVERY METHODS: bank, mobile_money, cash_pickup, crypto
97
+ CORRIDORS: 82+ countries per base currency, 328 total FX pairs
98
+
99
+ CURRENT MODE: ${mode}
100
+ ${mode === 'sandbox' ? 'SANDBOX: All data is in-memory. KYC auto-approves. Use simulate_payout_success/decline to test. Use create_mock_customer for instant test personas.' : 'PRODUCTION: Real money movement. Real KYC. Real compliance. Rate limit: 30 req/min.'}`;
101
+ }
102
+
103
+ // ── Create Server (shared setup) ──────────────────────────────────
104
+ export function createServer(config: ServerConfig): McpServer {
105
+ const server = new McpServer(
106
+ {
107
+ name: 'moneygraph',
108
+ version: '1.0.0',
109
+ },
110
+ {
111
+ capabilities: {
112
+ tools: {},
113
+ resources: {},
114
+ prompts: {},
115
+ },
116
+ instructions: getServerInstructions(config.mode),
117
+ }
118
+ );
119
+
120
+ // Register all tools (14 domains, 76 total)
121
+ registerCustomerTools(server, config);
122
+ registerDirectorTools(server, config);
123
+ registerCurrencyTools(server, config);
124
+ registerRecipientTools(server, config);
125
+ registerPayoutTools(server, config);
126
+ registerWalletTools(server, config);
127
+ registerPaymentTools(server, config);
128
+ registerRecurringTools(server, config);
129
+ registerTransactionTools(server, config);
130
+ registerReferenceTools(server, config);
131
+ registerLedgerTools(server, config);
132
+ registerCardTools(server, config);
133
+ registerCryptoTools(server, config);
134
+ registerFXTools(server, config);
135
+
136
+ // Register all 6 resources
137
+ registerStatusResource(server, config);
138
+ registerWalletsResource(server, config);
139
+ registerCorridorsResource(server, config);
140
+
141
+ // Register all 6 prompts
142
+ registerSendMoneyPrompt(server);
143
+ registerOnboardCustomerPrompt(server);
144
+ registerCheckRatesPrompt(server);
145
+ registerTrackPayoutPrompt(server);
146
+ registerIssueCardPrompt(server);
147
+ registerCryptoDepositPrompt(server);
148
+
149
+ return server;
150
+ }
151
+
152
+ // ── Start Server ──────────────────────────────────────────────────
153
+ export async function startServer() {
154
+ const config = loadConfig();
155
+ const transportMode = process.env.MONEYGRAPH_TRANSPORT || 'stdio';
156
+
157
+ if (transportMode === 'http') {
158
+ // Dynamic import to avoid loading http module when using stdio
159
+ const { startHTTPServer } = await import('./http.js');
160
+ await startHTTPServer(config);
161
+ } else {
162
+ // Default: stdio transport for CLI / IDE integrations
163
+ const server = createServer(config);
164
+ const transport = new StdioServerTransport();
165
+ await server.connect(transport);
166
+
167
+ console.error(
168
+ `MoneyGraph MCP Server v1.0.0 — ${config.mode} mode — stdio transport — 76 tools, 6 resources, 6 prompts`
169
+ );
170
+ }
171
+ }
172
+
173
+ // Auto-start when run directly
174
+ const isDirectRun =
175
+ process.argv[1]?.endsWith('index.js') ||
176
+ process.argv[1]?.endsWith('mcp-server.js') ||
177
+ process.argv[1]?.endsWith('mcp-http.js');
178
+
179
+ if (isDirectRun) {
180
+ startServer().catch((err) => {
181
+ console.error('Fatal:', err);
182
+ process.exit(1);
183
+ });
184
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Check Rates Prompt — FX rate comparison
3
+ */
4
+
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import { z } from 'zod';
7
+
8
+ export function registerCheckRatesPrompt(server: McpServer) {
9
+ server.prompt(
10
+ 'check-rates',
11
+ 'Compare FX rates and fees across corridors',
12
+ {
13
+ from_currency: z.string().describe('Source currency (e.g. "USD", "GBP", "EUR")'),
14
+ to_country: z.string().optional().describe('Specific destination country, or leave empty to show all'),
15
+ },
16
+ async (args) => ({
17
+ messages: [
18
+ {
19
+ role: 'user' as const,
20
+ content: {
21
+ type: 'text' as const,
22
+ text: `Show me the exchange rates from ${args.from_currency}${args.to_country ? ` to ${args.to_country}` : ' to all available countries'}.
23
+
24
+ Please call get_currencies and present the rates clearly showing:
25
+ - Destination country and currency
26
+ - Exchange rate
27
+ - Fee percentage
28
+ - Min/max transfer limits
29
+ - Available delivery methods and their speeds
30
+ ${args.to_country ? '\nAlso show delivery window options with fees for this specific corridor.' : ''}`,
31
+ },
32
+ },
33
+ ],
34
+ })
35
+ );
36
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Crypto Deposit Prompt — guided crypto address creation and deposit tracking
3
+ */
4
+
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import { z } from 'zod';
7
+
8
+ export function registerCryptoDepositPrompt(server: McpServer) {
9
+ server.prompt(
10
+ 'crypto-deposit',
11
+ 'Set up a crypto deposit address and track incoming deposits — guided step-by-step',
12
+ {
13
+ customer_id: z.string().optional().describe('Customer ID (if known)'),
14
+ currency: z
15
+ .string()
16
+ .optional()
17
+ .describe('Crypto currency: "USDC", "USDT", "BTC", "ETH"'),
18
+ network: z
19
+ .string()
20
+ .optional()
21
+ .describe('Blockchain network: "ethereum", "tron", "polygon", "base", "solana", "bitcoin"'),
22
+ },
23
+ async (args) => ({
24
+ messages: [
25
+ {
26
+ role: 'user' as const,
27
+ content: {
28
+ type: 'text' as const,
29
+ text: `I want to receive ${args.currency || 'USDC'} deposits${args.network ? ` on ${args.network}` : ''}${args.customer_id ? ` for customer ${args.customer_id}` : ''}.
30
+
31
+ Please follow these steps:
32
+ 1. ${args.customer_id ? `Verify customer "${args.customer_id}" has APPROVED KYC` : 'Create a customer and submit KYC'}
33
+ 2. Call create_crypto_address with currency="${args.currency || 'USDC'}" and network="${args.network || 'ethereum'}"
34
+ 3. Show me the deposit address and QR code URL
35
+ 4. Ask about auto-convert settings (convert crypto to fiat on receipt)
36
+ 5. If auto-convert desired, call update_crypto_settings
37
+ 6. Explain how to track incoming deposits with list_crypto_deposits`,
38
+ },
39
+ },
40
+ ],
41
+ })
42
+ );
43
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Issue Card Prompt — guided virtual/physical card issuance flow
3
+ */
4
+
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import { z } from 'zod';
7
+
8
+ export function registerIssueCardPrompt(server: McpServer) {
9
+ server.prompt(
10
+ 'issue-card',
11
+ 'Issue a virtual or physical debit card for a customer — guided step-by-step',
12
+ {
13
+ customer_id: z.string().optional().describe('Customer ID (if known)'),
14
+ card_type: z
15
+ .string()
16
+ .optional()
17
+ .describe('Card type: "virtual" (instant) or "physical" (shipped)'),
18
+ currency: z.string().optional().describe('Card currency (e.g. "USD", "GBP", "EUR")'),
19
+ },
20
+ async (args) => ({
21
+ messages: [
22
+ {
23
+ role: 'user' as const,
24
+ content: {
25
+ type: 'text' as const,
26
+ text: `I want to issue a ${args.card_type || 'virtual'} card${args.customer_id ? ` for customer ${args.customer_id}` : ''} in ${args.currency || 'USD'}.
27
+
28
+ Please follow these steps:
29
+ 1. ${args.customer_id ? `Check KYC status with check_kyc_status for customer "${args.customer_id}"` : 'Create a customer with create_customer and submit KYC'}
30
+ 2. If KYC is not APPROVED, submit KYC first
31
+ 3. Call create_card with the customer_id, type="${args.card_type || 'virtual'}", and currency="${args.currency || 'USD'}"
32
+ 4. If virtual, show the card details (number, expiry, CVV)
33
+ 5. Ask if I want to fund the card, and if so, call fund_card
34
+ 6. Report the card ID, masked PAN, balance, and status`,
35
+ },
36
+ },
37
+ ],
38
+ })
39
+ );
40
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Onboard Customer Prompt — guided customer creation + KYC
3
+ */
4
+
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import { z } from 'zod';
7
+
8
+ export function registerOnboardCustomerPrompt(server: McpServer) {
9
+ server.prompt(
10
+ 'onboard-customer',
11
+ 'Create and verify a new customer — guided step-by-step',
12
+ {
13
+ customer_type: z.string().describe('"personal" or "business"'),
14
+ country: z.string().describe('Customer country (e.g. "US", "United Kingdom")'),
15
+ },
16
+ async (args) => ({
17
+ messages: [
18
+ {
19
+ role: 'user' as const,
20
+ content: {
21
+ type: 'text' as const,
22
+ text: `I need to onboard a new ${args.customer_type} customer based in ${args.country}.
23
+
24
+ Please guide me through:
25
+ ${args.customer_type === 'business'
26
+ ? `1. Create a business customer (need: contact name, email, phone, business name, business address)
27
+ 2. Add directors with create_director (need: name, email, ownership %, position)
28
+ 3. Submit KYC with submit_kyc`
29
+ : `1. Create a personal customer (need: first name, last name, email, phone, country)
30
+ 2. Submit KYC with submit_kyc`
31
+ }
32
+
33
+ Ask me for any missing information. In sandbox mode, KYC auto-approves.`,
34
+ },
35
+ },
36
+ ],
37
+ })
38
+ );
39
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Track Payout Prompt — check payout status
3
+ */
4
+
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import { z } from 'zod';
7
+
8
+ export function registerTrackPayoutPrompt(server: McpServer) {
9
+ server.prompt(
10
+ 'track-payout',
11
+ 'Check the status of a payout transaction',
12
+ {
13
+ transaction_id: z.string().describe('The transaction/payout ID to track'),
14
+ },
15
+ async (args) => ({
16
+ messages: [
17
+ {
18
+ role: 'user' as const,
19
+ content: {
20
+ type: 'text' as const,
21
+ text: `What's the status of transaction ${args.transaction_id}?
22
+
23
+ Please call get_transaction and report:
24
+ - Current status
25
+ - Amount and currency
26
+ - Recipient details
27
+ - Creation date
28
+ - Any decline reason if applicable
29
+
30
+ If we're in sandbox and the payout is still processing, mention that simulate_payout_success or simulate_payout_decline can be used to test outcomes.`,
31
+ },
32
+ },
33
+ ],
34
+ })
35
+ );
36
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Send Money Prompt — guided cross-border payment flow
3
+ */
4
+
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import { z } from 'zod';
7
+
8
+ export function registerSendMoneyPrompt(server: McpServer) {
9
+ server.prompt(
10
+ 'send-money',
11
+ 'Send money to someone in another country — guided step-by-step',
12
+ {
13
+ amount: z.string().describe('How much to send (e.g. "500")'),
14
+ currency: z.string().describe('Source currency (e.g. "USD", "GBP", "EUR")'),
15
+ destination_country: z.string().describe('Where to send (e.g. "Nigeria", "Kenya", "Ghana")'),
16
+ delivery_method: z
17
+ .string()
18
+ .optional()
19
+ .describe('Delivery method: "bank", "mobile_money", or "cash_pickup" (default: bank)'),
20
+ },
21
+ async (args) => ({
22
+ messages: [
23
+ {
24
+ role: 'user' as const,
25
+ content: {
26
+ type: 'text' as const,
27
+ text: `I want to send ${args.amount} ${args.currency} to ${args.destination_country} via ${args.delivery_method || 'bank'}.
28
+
29
+ Please follow these steps:
30
+ 1. Call get_currencies with the destination country ISO2 code to get corridor rates and delivery windows
31
+ 2. Call list_wallets to find the ${args.currency} wallet
32
+ 3. Show me the exchange rate, fees, and estimated delivery time and ask me to confirm
33
+ 4. If I don't have a customer yet, create one and submit KYC
34
+ 5. Call send_bank_payout or send_mobile_money_payout with all required IDs
35
+ 6. Report the transaction ID, FX rate applied, fees, and estimated delivery`,
36
+ },
37
+ },
38
+ ],
39
+ })
40
+ );
41
+ }