@moneygraph/mcp-server 1.0.2 → 1.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.
Files changed (44) hide show
  1. package/dist/config.d.ts.map +1 -1
  2. package/dist/config.js +4 -2
  3. package/dist/config.js.map +1 -1
  4. package/dist/http.js +3 -3
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +4 -4
  7. package/dist/resources/status.js +2 -2
  8. package/dist/tools/currencies.d.ts.map +1 -1
  9. package/dist/tools/currencies.js +56 -3
  10. package/dist/tools/currencies.js.map +1 -1
  11. package/dist/tools/customers.d.ts.map +1 -1
  12. package/dist/tools/customers.js +9 -8
  13. package/dist/tools/customers.js.map +1 -1
  14. package/package.json +11 -3
  15. package/scripts/patch-sdk.mjs +32 -0
  16. package/.claude/settings.local.json +0 -13
  17. package/src/config.ts +0 -73
  18. package/src/http.ts +0 -118
  19. package/src/index.ts +0 -184
  20. package/src/prompts/check-rates.ts +0 -36
  21. package/src/prompts/crypto-deposit.ts +0 -43
  22. package/src/prompts/issue-card.ts +0 -40
  23. package/src/prompts/onboard-customer.ts +0 -39
  24. package/src/prompts/payout-status.ts +0 -36
  25. package/src/prompts/send-money.ts +0 -41
  26. package/src/resources/corridors.ts +0 -190
  27. package/src/resources/status.ts +0 -44
  28. package/src/resources/wallets.ts +0 -48
  29. package/src/tools/cards.ts +0 -302
  30. package/src/tools/crypto.ts +0 -382
  31. package/src/tools/currencies.ts +0 -122
  32. package/src/tools/customers.ts +0 -458
  33. package/src/tools/directors.ts +0 -209
  34. package/src/tools/fx.ts +0 -253
  35. package/src/tools/ledger.ts +0 -133
  36. package/src/tools/payments.ts +0 -118
  37. package/src/tools/payouts.ts +0 -452
  38. package/src/tools/recipients.ts +0 -204
  39. package/src/tools/recurring.ts +0 -130
  40. package/src/tools/reference.ts +0 -122
  41. package/src/tools/transactions.ts +0 -140
  42. package/src/tools/wallets.ts +0 -183
  43. package/test/smoke.test.mjs +0 -196
  44. package/tsconfig.json +0 -21
package/src/index.ts DELETED
@@ -1,184 +0,0 @@
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
- }
@@ -1,36 +0,0 @@
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
- }
@@ -1,43 +0,0 @@
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
- }
@@ -1,40 +0,0 @@
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
- }
@@ -1,39 +0,0 @@
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
- }
@@ -1,36 +0,0 @@
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
- }
@@ -1,41 +0,0 @@
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
- }
@@ -1,190 +0,0 @@
1
- /**
2
- * Corridors Resource — FX rates, delivery windows, corridor data
3
- * Supports browsable URIs: rates/{base}, rates/{from}/{to}, corridors/{base}, delivery-windows/{currency}
4
- */
5
-
6
- import { McpServer, ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
7
- import type { ServerConfig } from '../config.js';
8
- import { safeCall } from '../config.js';
9
-
10
- export function registerCorridorsResource(server: McpServer, config: ServerConfig) {
11
- const { client } = config;
12
-
13
- // ── FX Rates by base currency ───────────────────────────────────
14
- server.resource(
15
- 'FX Rates',
16
- new ResourceTemplate('moneygraph://rates/{base}', { list: undefined }),
17
- {
18
- description: 'All payout rates from a base currency (e.g. rates/USD shows all corridor rates from USD)',
19
- mimeType: 'application/json',
20
- },
21
- async (uri, params) => {
22
- const base = (params.base as string || 'USD').toUpperCase();
23
-
24
- const ratesResult = await safeCall(() => client.fx.rates(), 'resource_rates');
25
-
26
- let rates: Record<string, number> = {};
27
- if (ratesResult.success) {
28
- for (const [pair, rate] of Object.entries(ratesResult.data as Record<string, number>)) {
29
- if (pair.startsWith(`${base}_`)) {
30
- rates[pair] = rate;
31
- }
32
- }
33
- }
34
-
35
- return {
36
- contents: [
37
- {
38
- uri: uri.href,
39
- mimeType: 'application/json',
40
- text: JSON.stringify(
41
- {
42
- base_currency: base,
43
- pair_count: Object.keys(rates).length,
44
- rates,
45
- },
46
- null,
47
- 2
48
- ),
49
- },
50
- ],
51
- };
52
- }
53
- );
54
-
55
- // ── Specific corridor rate ──────────────────────────────────────
56
- server.resource(
57
- 'Corridor Rate',
58
- new ResourceTemplate('moneygraph://rates/{from}/{to}', { list: undefined }),
59
- {
60
- description: 'Get the exchange rate, fees, and delivery options for a specific corridor (e.g. rates/USD/NGN)',
61
- mimeType: 'application/json',
62
- },
63
- async (uri, params) => {
64
- const from = (params.from as string || 'USD').toUpperCase();
65
- const to = (params.to as string || 'NGN').toUpperCase();
66
- const pair = `${from}_${to}`;
67
-
68
- const ratesResult = await safeCall(() => client.fx.rates(), 'resource_corridor_rate');
69
-
70
- const rate = ratesResult.success ? ratesResult.data[pair] || null : null;
71
-
72
- return {
73
- contents: [
74
- {
75
- uri: uri.href,
76
- mimeType: 'application/json',
77
- text: JSON.stringify(
78
- {
79
- from: from,
80
- to: to,
81
- pair,
82
- rate: rate || 'N/A',
83
- note: rate ? `1 ${from} = ${rate} ${to}` : `Rate not found for ${pair}`,
84
- },
85
- null,
86
- 2
87
- ),
88
- },
89
- ],
90
- };
91
- }
92
- );
93
-
94
- // ── Corridors by base currency ──────────────────────────────────
95
- server.resource(
96
- 'Remittance Corridors',
97
- new ResourceTemplate('moneygraph://corridors/{base}', { list: undefined }),
98
- {
99
- description: 'All international remittance corridors from a base currency with rates, fees, and limits',
100
- mimeType: 'application/json',
101
- },
102
- async (uri, params) => {
103
- const base = (params.base as string || 'USD').toUpperCase();
104
-
105
- const ratesResult = await safeCall(() => client.fx.rates(), 'resource_corridors');
106
-
107
- const corridors: Array<{ pair: string; destination: string; rate: number }> = [];
108
- if (ratesResult.success) {
109
- for (const [pair, rate] of Object.entries(ratesResult.data as Record<string, number>)) {
110
- if (pair.startsWith(`${base}_`)) {
111
- corridors.push({
112
- pair,
113
- destination: pair.split('_')[1],
114
- rate,
115
- });
116
- }
117
- }
118
- }
119
-
120
- return {
121
- contents: [
122
- {
123
- uri: uri.href,
124
- mimeType: 'application/json',
125
- text: JSON.stringify(
126
- {
127
- base_currency: base,
128
- corridor_count: corridors.length,
129
- corridors,
130
- },
131
- null,
132
- 2
133
- ),
134
- },
135
- ],
136
- };
137
- }
138
- );
139
-
140
- // ── Delivery Windows ────────────────────────────────────────────
141
- server.resource(
142
- 'Delivery Windows',
143
- new ResourceTemplate('moneygraph://delivery-windows/{currency}', { list: undefined }),
144
- {
145
- description: 'Available delivery windows (ACH, Wire, SWIFT, SEPA, Faster Payments) for a base currency',
146
- mimeType: 'application/json',
147
- },
148
- async (uri, params) => {
149
- const currency = (params.currency as string || 'USD').toUpperCase();
150
-
151
- const windows: Record<string, Array<{ method: string; speed: string; fee_note: string }>> = {
152
- USD: [
153
- { method: 'ACH', speed: '1-3 business days', fee_note: 'Low fee' },
154
- { method: 'Wire', speed: 'Same day', fee_note: 'Higher fee' },
155
- { method: 'SWIFT', speed: '1-5 business days', fee_note: 'Standard international' },
156
- ],
157
- GBP: [
158
- { method: 'Faster Payments', speed: 'Instant to 2 hours', fee_note: 'Low fee' },
159
- { method: 'SWIFT', speed: '1-5 business days', fee_note: 'Standard international' },
160
- ],
161
- EUR: [
162
- { method: 'SEPA', speed: '1 business day', fee_note: 'Low fee' },
163
- { method: 'BACS', speed: '2-3 business days', fee_note: 'Low fee' },
164
- { method: 'SWIFT', speed: '1-5 business days', fee_note: 'Standard international' },
165
- ],
166
- CAD: [
167
- { method: 'SWIFT', speed: '1-5 business days', fee_note: 'Standard international' },
168
- ],
169
- };
170
-
171
- return {
172
- contents: [
173
- {
174
- uri: uri.href,
175
- mimeType: 'application/json',
176
- text: JSON.stringify(
177
- {
178
- currency,
179
- delivery_windows: windows[currency] || windows['USD'],
180
- note: 'Use delivery window IDs from get_currencies for actual payout creation.',
181
- },
182
- null,
183
- 2
184
- ),
185
- },
186
- ],
187
- };
188
- }
189
- );
190
- }
@@ -1,44 +0,0 @@
1
- /**
2
- * Status Resource — server mode, API health, rate limits
3
- */
4
-
5
- import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
- import type { ServerConfig } from '../config.js';
7
-
8
- export function registerStatusResource(server: McpServer, config: ServerConfig) {
9
- server.resource(
10
- 'Server Status',
11
- 'moneygraph://status',
12
- {
13
- description: 'Current server mode (sandbox/production), API health, and rate limit info',
14
- mimeType: 'application/json',
15
- },
16
- async () => ({
17
- contents: [
18
- {
19
- uri: 'moneygraph://status',
20
- mimeType: 'application/json',
21
- text: JSON.stringify(
22
- {
23
- server: '@moneygraph/mcp-server',
24
- version: '1.0.0',
25
- mode: config.mode,
26
- api_health: 'ok',
27
- tools_count: 76,
28
- resources_count: 6,
29
- prompts_count: 6,
30
- base_currencies: ['USD', 'GBP', 'EUR', 'CAD'],
31
- delivery_methods: ['bank', 'mobile_money', 'cash_pickup', 'crypto'],
32
- card_types: ['virtual', 'physical'],
33
- crypto_currencies: ['USDC', 'USDT', 'BTC', 'ETH'],
34
- crypto_networks: ['ethereum', 'tron', 'polygon', 'base', 'solana', 'bitcoin'],
35
- corridors: '82+ countries, 328 FX pairs',
36
- },
37
- null,
38
- 2
39
- ),
40
- },
41
- ],
42
- })
43
- );
44
- }