@spritz-finance/mcp-server 0.2.0 → 0.3.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 CHANGED
@@ -33,9 +33,7 @@ npm install && npm run build
33
33
 
34
34
  ### 1. Get Your API Key
35
35
 
36
- 1. Log in to [app.spritz.finance](https://app.spritz.finance)
37
- 2. Go to **Settings > API Keys**
38
- 3. Create a new key
36
+ Create one at [app.spritz.finance/api-keys](https://app.spritz.finance/api-keys).
39
37
 
40
38
  ### 2. Configure Your MCP Client
41
39
 
@@ -95,24 +93,25 @@ Add to `~/.cursor/mcp.json`:
95
93
 
96
94
  | Tool | Description |
97
95
  |------|-------------|
98
- | `list_bank_accounts` | List all bank accounts saved as off-ramp payment destinations |
99
-
100
- More tools coming soon.
96
+ | `list_bank_accounts` | List saved bank accounts |
97
+ | `create_bank_account` | Add a bank account (US, CA, UK, or IBAN) |
98
+ | `delete_bank_account` | Remove a bank account |
99
+ | `list_off_ramps` | List off-ramp transactions with optional filters |
100
+ | `create_off_ramp_quote` | Create a quote to convert crypto to fiat |
101
+ | `get_off_ramp_quote` | Re-fetch a quote to check status |
102
+ | `get_off_ramp_transaction` | Get transaction params (EVM calldata or Solana serialized tx) to sign and submit |
101
103
 
102
104
  ## Architecture
103
105
 
104
106
  Tools are driven by the OpenAPI spec — not hand-written. To expose a new endpoint, add one entry to `src/config.ts`:
105
107
 
106
108
  ```ts
107
- export const EXPOSED_TOOLS: ToolConfig[] = [
108
- {
109
- name: "list_bank_accounts",
110
- operationId: "getV1Bank-accounts",
111
- description: "List all bank accounts saved as off-ramp payment destinations.",
112
- },
113
- // To add a new tool, just add another entry here.
114
- // The inputSchema, HTTP method, and path are all derived from the OpenAPI spec.
115
- ];
109
+ {
110
+ name: "list_bank_accounts",
111
+ operationId: "getV1Bank-accounts",
112
+ description: "List all bank accounts saved as off-ramp payment destinations.",
113
+ },
114
+ // Add more entries — inputSchema, HTTP method, and path are derived from the spec.
116
115
  ```
117
116
 
118
117
  The server reads `openapi.json`, finds each `operationId`, extracts the JSON Schema for parameters and request bodies, and registers them as MCP tools. A generic handler dispatches tool calls to the Spritz API.
@@ -122,7 +121,9 @@ openapi.json → source of truth for request/response schemas
122
121
  src/config.ts → which operations to expose (cherry-pick)
123
122
  src/spec.ts → reads spec, builds MCP tool definitions
124
123
  src/handlers.ts → generic dispatcher (path params, query, body)
125
- src/index.ts MCP server + API client
124
+ src/formatters.ts CSV/JSON response formatting
125
+ src/client.ts → Spritz API HTTP client
126
+ src/index.ts → MCP server entrypoint
126
127
  ```
127
128
 
128
129
  ## Development
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,aAAa,EAAE,UAAU,EA4BrC,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,aAAa,EAAE,UAAU,EA8CrC,CAAC"}
@@ -26,10 +26,28 @@ export const EXPOSED_TOOLS = [
26
26
  operationId: "getV1Off-ramps",
27
27
  description: "List off-ramp transactions. Filter by status, chain, or destination accountId. Supports cursor pagination.",
28
28
  },
29
+ {
30
+ name: "get_off_ramp_quote",
31
+ operationId: "getV1Off-ramp-quotesByQuoteId",
32
+ description: "Get an off-ramp quote by ID. Use this to check quote status or re-fetch quote details.",
33
+ format: "json",
34
+ },
35
+ {
36
+ name: "get_off_ramp_transaction",
37
+ operationId: "postV1Off-ramp-quotesByQuoteIdTransaction",
38
+ description: "Get transaction params for a quote. Returns EVM calldata (contractAddress, calldata, value) or a serialized Solana transaction (transactionSerialized) depending on the chain. The agent must sign and submit the transaction on-chain.",
39
+ format: "json",
40
+ },
29
41
  {
30
42
  name: "create_off_ramp_quote",
31
43
  operationId: "postV1Off-ramp-quotes",
32
- description: "Create an off-ramp quote to convert crypto to fiat. Specify the destination accountId, amount, and blockchain chain. Returns a quote with exchange rate and fees.",
44
+ description: `Create an off-ramp quote to convert crypto to fiat. Returns a quote with locked exchange rate, fees, and next steps.
45
+
46
+ After creating a quote, check the \`fulfillment\` field:
47
+ - \`send_to_address\`: Send the exact \`input.amount\` of \`input.token\` to the \`sendTo.address\` before \`sendTo.expiresAt\`.
48
+ - \`sign_transaction\`: Call \`get_off_ramp_transaction\` with the quote ID and sender address to get calldata or a serialized transaction, then sign and submit on-chain.
49
+
50
+ Amount modes: set \`amountType\` to \`output\` (default) for exact fiat delivery, or \`input\` for exact crypto spend.`,
33
51
  format: "json",
34
52
  },
35
53
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,oBAAoB;QACjC,WAAW,EAAE,gEAAgE;KAC9E;IACD;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,qBAAqB;QAClC,WAAW,EAAE,0PAA0P;QACvQ,MAAM,EAAE,MAAM;KACf;IACD;QACE,IAAI,EAAE,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