stables-mcp-server 1.3.0 → 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.
Files changed (40) hide show
  1. package/README.md +52 -41
  2. package/build/index.d.ts +1 -1
  3. package/build/index.js +4 -4
  4. package/build/index.js.map +1 -1
  5. package/build/lib/stables-client.d.ts +215 -127
  6. package/build/lib/stables-client.d.ts.map +1 -1
  7. package/build/lib/stables-client.js +66 -54
  8. package/build/lib/stables-client.js.map +1 -1
  9. package/build/tools/api-keys.d.ts.map +1 -1
  10. package/build/tools/api-keys.js +7 -3
  11. package/build/tools/api-keys.js.map +1 -1
  12. package/build/tools/customers.d.ts +1 -1
  13. package/build/tools/customers.d.ts.map +1 -1
  14. package/build/tools/customers.js +240 -107
  15. package/build/tools/customers.js.map +1 -1
  16. package/build/tools/payment-methods.d.ts +12 -0
  17. package/build/tools/payment-methods.d.ts.map +1 -0
  18. package/build/tools/payment-methods.js +119 -0
  19. package/build/tools/payment-methods.js.map +1 -0
  20. package/build/tools/quotes.d.ts +5 -1
  21. package/build/tools/quotes.d.ts.map +1 -1
  22. package/build/tools/quotes.js +103 -59
  23. package/build/tools/quotes.js.map +1 -1
  24. package/build/tools/transfers.d.ts +4 -1
  25. package/build/tools/transfers.d.ts.map +1 -1
  26. package/build/tools/transfers.js +212 -100
  27. package/build/tools/transfers.js.map +1 -1
  28. package/build/tools/virtual-accounts.d.ts +1 -1
  29. package/build/tools/virtual-accounts.d.ts.map +1 -1
  30. package/build/tools/virtual-accounts.js +56 -70
  31. package/build/tools/virtual-accounts.js.map +1 -1
  32. package/build/tools/webhooks.d.ts +1 -1
  33. package/build/tools/webhooks.d.ts.map +1 -1
  34. package/build/tools/webhooks.js +38 -18
  35. package/build/tools/webhooks.js.map +1 -1
  36. package/package.json +10 -3
  37. package/build/tools/notifications.d.ts +0 -8
  38. package/build/tools/notifications.d.ts.map +0 -1
  39. package/build/tools/notifications.js +0 -125
  40. package/build/tools/notifications.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Stables MCP Server
2
2
 
3
- An MCP (Model Context Protocol) server that exposes the Stables fiat-to-crypto API to AI agents. This allows AI assistants like Claude, ChatGPT, and others to manage customers, create quotes, execute transfers, and handle virtual accounts programmatically.
3
+ An MCP (Model Context Protocol) server that exposes the Stables fiat-to-crypto API to AI agents. This allows AI assistants like Claude, ChatGPT, Cursor, Codex, and other MCP-compatible clients to manage customers, create USDC and USDT quotes, execute approved transfers, and handle virtual accounts programmatically.
4
+
5
+ Use it to build stablecoin payment workflows for AI agents and agentic commerce: payouts, virtual account deposits, treasury movement, fiat off-ramping, and webhook reconciliation.
4
6
 
5
7
  ## What is MCP?
6
8
 
@@ -8,7 +10,7 @@ MCP (Model Context Protocol) is an open standard that provides a standardized wa
8
10
 
9
11
  ## Features
10
12
 
11
- This MCP server provides 25 tools across 7 categories:
13
+ This MCP server provides 23 tools across 7 categories:
12
14
 
13
15
  ### Customer Management
14
16
  - `create_customer` - Create individual or business customers
@@ -31,10 +33,11 @@ This MCP server provides 25 tools across 7 categories:
31
33
  - `create_virtual_account` - Create virtual bank accounts for fiat deposits
32
34
  - `list_virtual_accounts` - List virtual accounts for a customer
33
35
  - `update_virtual_account` - Update virtual account settings
34
- - `deactivate_virtual_account` - Deactivate a virtual account
35
- - `reactivate_virtual_account` - Reactivate a deactivated virtual account
36
36
  - `get_virtual_account_history` - Get activity history for a virtual account
37
37
 
38
+ ### Payment Methods
39
+ - `validate_payment_method` - Check payout details against a currency's rules before creating a quote or transfer
40
+
38
41
  ### API Keys
39
42
  - `create_api_key` - Create a new API key
40
43
  - `list_api_keys` - List all API keys
@@ -46,9 +49,6 @@ This MCP server provides 25 tools across 7 categories:
46
49
  - `list_webhooks` - List all webhook subscriptions
47
50
  - `delete_webhook` - Delete a webhook subscription
48
51
 
49
- ### Notifications
50
- - `send_verification_sms` - Send a KYC verification link to a customer via SMS (requires Twilio)
51
-
52
52
  ## Installation
53
53
 
54
54
  ```bash
@@ -69,10 +69,26 @@ The server requires the following environment variables:
69
69
  | Variable | Required | Description |
70
70
  |----------|----------|-------------|
71
71
  | `STABLES_API_KEY` | Yes | Your Stables API key |
72
- | `STABLES_API_URL` | No | API base URL (default: `https://api.sandbox.stables.money`). Must use HTTPS. |
73
- | `TWILIO_ACCOUNT_SID` | No | Twilio Account SID (required for `send_verification_sms`) |
74
- | `TWILIO_AUTH_TOKEN` | No | Twilio Auth Token (required for `send_verification_sms`) |
75
- | `TWILIO_PHONE_NUMBER` | No | Twilio phone number to send from (required for `send_verification_sms`) |
72
+ | `STABLES_API_URL` | No | API base URL. Defaults to the environment your key belongs to (see below). Must use HTTPS. |
73
+
74
+ ### Which environment you're talking to
75
+
76
+ Stables keys carry their environment: `sti_test_…` is a sandbox key, `sti_live_…`
77
+ is a production key, and the API refuses a key that arrives at the wrong
78
+ environment. So you don't have to set a URL — leave `STABLES_API_URL` unset and
79
+ the key decides:
80
+
81
+ | Your key | Where requests go |
82
+ |----------|-------------------|
83
+ | `sti_test_…` | `https://api.sandbox.stables.money` |
84
+ | `sti_live_…` | `https://api.stables.money` — **real money** |
85
+ | `sti_local_…` or anything else | production, unless you set `STABLES_API_URL` |
86
+
87
+ Setting `STABLES_API_URL` always wins, which is how you reach staging, dev or a
88
+ local deployment.
89
+
90
+ **Start with a sandbox key.** An agent holding a live key can move real money on
91
+ your behalf; see [agent safety](https://docs.stables.money/get-started/getting-started/quickstart/building-with-ai/agent-safety).
76
92
 
77
93
  ## Usage
78
94
 
@@ -97,6 +113,29 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
97
113
 
98
114
  Then restart Claude Desktop.
99
115
 
116
+ ### With Cursor, Codex, ChatGPT, or another MCP client
117
+
118
+ Use the same command and environment variables in any MCP-compatible client:
119
+
120
+ ```json
121
+ {
122
+ "mcpServers": {
123
+ "stables": {
124
+ "command": "npx",
125
+ "args": ["stables-mcp-server"],
126
+ "env": {
127
+ "STABLES_API_KEY": "your-api-key",
128
+ "STABLES_API_URL": "https://api.sandbox.stables.money"
129
+ }
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ ## Agent safety
136
+
137
+ Stables is financial infrastructure. Agents should create quotes, prepare payment objects, and reconcile webhooks, but should require explicit human approval before creating transfers or other money movement. Check customer KYC/KYB status and entitlements before transactional actions, and treat sanctions, unsupported jurisdiction, verification, or compliance failures as hard stops.
138
+
100
139
  ### With MCP Inspector (for testing)
101
140
 
102
141
  ```bash
@@ -118,7 +157,7 @@ STABLES_API_KEY=your-api-key node build/index.js
118
157
 
119
158
  ### Creating a customer and getting a quote
120
159
 
121
- **User:** "Create a customer for john@example.com and get a quote to convert 1000 USDC to EUR"
160
+ **User:** "Create a customer for john@example.com and get a quote to convert 1000 USDT to EUR"
122
161
 
123
162
  **AI (using MCP tools):**
124
163
  1. Calls `create_customer` with email and type
@@ -179,7 +218,7 @@ stables-mcp-server/
179
218
  │ ├── virtual-accounts.ts # Virtual account tools (6)
180
219
  │ ├── api-keys.ts # API key tools (4)
181
220
  │ ├── webhooks.ts # Webhook tools (3)
182
- │ └── notifications.ts # Notification tools (1)
221
+ │ └── payment-methods.ts # Payment method validation (1)
183
222
  ├── package.json
184
223
  ├── tsconfig.json
185
224
  ├── vitest.config.ts
@@ -336,22 +375,6 @@ Update virtual account settings.
336
375
  | virtualAccountId | string | Yes | Virtual account ID |
337
376
  | depositHandlingMode | string | Yes | New deposit handling mode |
338
377
 
339
- #### deactivate_virtual_account
340
- Deactivate a virtual account to prevent new deposits.
341
-
342
- | Parameter | Type | Required | Description |
343
- |-----------|------|----------|-------------|
344
- | customerId | string | Yes | Customer ID |
345
- | virtualAccountId | string | Yes | Virtual account ID |
346
-
347
- #### reactivate_virtual_account
348
- Reactivate a previously deactivated virtual account.
349
-
350
- | Parameter | Type | Required | Description |
351
- |-----------|------|----------|-------------|
352
- | customerId | string | Yes | Customer ID |
353
- | virtualAccountId | string | Yes | Virtual account ID |
354
-
355
378
  #### get_virtual_account_history
356
379
  Get activity history for a virtual account.
357
380
 
@@ -429,18 +452,6 @@ Delete a webhook subscription.
429
452
  |-----------|------|----------|-------------|
430
453
  | webhookId | string | Yes | Webhook subscription ID |
431
454
 
432
- ### Notification Tools
433
-
434
- #### send_verification_sms
435
- Send a KYC verification link to a customer via SMS. Requires Twilio environment variables.
436
-
437
- | Parameter | Type | Required | Description |
438
- |-----------|------|----------|-------------|
439
- | customerId | string | Yes | Customer ID to send verification to |
440
- | phone | string | No | Override phone number (uses customer's phone if not provided) |
441
- | botName | string | No | Name of the assistant sending the message |
442
- | verificationLinkTtlSecs | number | No | Verification link expiry in seconds (default: 1800) |
443
-
444
455
  ## Security
445
456
 
446
457
  - API keys are only read from environment variables
package/build/index.d.ts CHANGED
@@ -17,7 +17,7 @@
17
17
  * "args": ["/path/to/stables-mcp-server/build/index.js"],
18
18
  * "env": {
19
19
  * "STABLES_API_KEY": "your-api-key",
20
- * "STABLES_API_URL": "https://api.sandbox.stables.money"
20
+ * "STABLES_API_URL": "https://api.stables.money"
21
21
  * }
22
22
  * }
23
23
  * }
package/build/index.js CHANGED
@@ -17,7 +17,7 @@
17
17
  * "args": ["/path/to/stables-mcp-server/build/index.js"],
18
18
  * "env": {
19
19
  * "STABLES_API_KEY": "your-api-key",
20
- * "STABLES_API_URL": "https://api.sandbox.stables.money"
20
+ * "STABLES_API_URL": "https://api.stables.money"
21
21
  * }
22
22
  * }
23
23
  * }
@@ -32,7 +32,7 @@ import { registerTransferTools } from "./tools/transfers.js";
32
32
  import { registerVirtualAccountTools } from "./tools/virtual-accounts.js";
33
33
  import { registerApiKeyTools } from "./tools/api-keys.js";
34
34
  import { registerWebhookTools } from "./tools/webhooks.js";
35
- import { registerNotificationTools } from "./tools/notifications.js";
35
+ import { registerPaymentMethodTools } from "./tools/payment-methods.js";
36
36
  // Validate environment
37
37
  const apiKey = process.env.STABLES_API_KEY;
38
38
  if (!apiKey) {
@@ -43,7 +43,7 @@ if (!apiKey) {
43
43
  // Create the MCP server
44
44
  const server = new McpServer({
45
45
  name: "stables-mcp-server",
46
- version: "1.2.0",
46
+ version: "2.0.0",
47
47
  description: "Stables fiat-to-crypto API for AI agents - manage customers, quotes, transfers, and virtual accounts",
48
48
  });
49
49
  // Create the Stables API client
@@ -55,7 +55,7 @@ registerTransferTools(server, stablesClient);
55
55
  registerVirtualAccountTools(server, stablesClient);
56
56
  registerApiKeyTools(server, stablesClient);
57
57
  registerWebhookTools(server, stablesClient);
58
- registerNotificationTools(server, stablesClient);
58
+ registerPaymentMethodTools(server, stablesClient);
59
59
  // Start the server with STDIO transport
60
60
  async function main() {
61
61
  const transport = new StdioServerTransport();
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,uBAAuB;AACvB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;IACZ,sCAAsC;IACtC,OAAO,CAAC,KAAK,CAAC,yDAAyD,CAAC,CAA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