@indigoprotocol/indigo-mcp 0.2.14 → 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.
Files changed (39) hide show
  1. package/README.md +249 -99
  2. package/dist/index.js +59106 -49961
  3. package/dist/payment.d.ts +4 -0
  4. package/dist/payment.d.ts.map +1 -0
  5. package/dist/server.d.ts.map +1 -1
  6. package/dist/tools/analytics-tools.d.ts.map +1 -1
  7. package/dist/tools/asset-tools.d.ts.map +1 -1
  8. package/dist/tools/cdp-liquidation-tools.d.ts.map +1 -1
  9. package/dist/tools/cdp-mint-burn-tools.d.ts.map +1 -1
  10. package/dist/tools/cdp-tools.d.ts.map +1 -1
  11. package/dist/tools/cdp-write-tools.d.ts.map +1 -1
  12. package/dist/tools/dex-tools.d.ts.map +1 -1
  13. package/dist/tools/governance-tools.d.ts.map +1 -1
  14. package/dist/tools/index.d.ts.map +1 -1
  15. package/dist/tools/interest-tools.d.ts +3 -0
  16. package/dist/tools/interest-tools.d.ts.map +1 -0
  17. package/dist/tools/leverage-cdp-tools.d.ts.map +1 -1
  18. package/dist/tools/oracle-tools.d.ts +3 -0
  19. package/dist/tools/oracle-tools.d.ts.map +1 -0
  20. package/dist/tools/redemption-tools.d.ts.map +1 -1
  21. package/dist/tools/rob-write-tools.d.ts.map +1 -1
  22. package/dist/tools/sp-request-tools.d.ts.map +1 -1
  23. package/dist/tools/stability-pool-tools.d.ts.map +1 -1
  24. package/dist/tools/stability-pool-write-tools.d.ts.map +1 -1
  25. package/dist/tools/stableswap-tools.d.ts +3 -0
  26. package/dist/tools/stableswap-tools.d.ts.map +1 -0
  27. package/dist/tools/staking-reward-tools.d.ts.map +1 -1
  28. package/dist/tools/staking-tools.d.ts.map +1 -1
  29. package/dist/tools/staking-write-tools.d.ts.map +1 -1
  30. package/dist/utils/indexer-client.d.ts.map +1 -1
  31. package/dist/utils/sdk-config.d.ts +7 -1
  32. package/dist/utils/sdk-config.d.ts.map +1 -1
  33. package/dist/utils/tx-builder.d.ts +2 -2
  34. package/dist/utils/tx-builder.d.ts.map +1 -1
  35. package/dist/utils/v3-finders.d.ts +66 -0
  36. package/dist/utils/v3-finders.d.ts.map +1 -0
  37. package/dist/utils/validators.d.ts +1 -1
  38. package/dist/utils/validators.d.ts.map +1 -1
  39. package/package.json +6 -2
package/README.md CHANGED
@@ -8,10 +8,10 @@ MCP server for [Indigo Protocol](https://indigoprotocol.io/) — exposes Indigo
8
8
 
9
9
  ## ⚡ Quick Start — Full Cardano DeFi Stack
10
10
 
11
- ### MCP Servers (63 tools)
11
+ ### MCP Servers (75 tools)
12
12
 
13
13
  ```bash
14
- # 1. Install & Setup Indigo MCP (57 tools)
14
+ # 1. Install & Setup Indigo MCP (69 tools)
15
15
  npm install -g @indigoprotocol/indigo-mcp
16
16
  npx @indigoprotocol/indigo-mcp setup
17
17
 
@@ -75,6 +75,10 @@ The setup commands auto-configure Claude Desktop, Claude Code, Cursor, or Windsu
75
75
  - Staking reward distribution
76
76
  - Collector UTXOs, IPFS storage and retrieval
77
77
 
78
+ ## Hosted deployment
79
+
80
+ A hosted deployment is available on [Fronteir AI](https://fronteir.ai/mcp/indigoprotocol-indigo-mcp).
81
+
78
82
  ## Quick Start
79
83
 
80
84
  ### Automatic Setup (Recommended)
@@ -86,6 +90,7 @@ npx @indigoprotocol/indigo-mcp setup
86
90
  ```
87
91
 
88
92
  This will:
93
+
89
94
  1. Ask which client you're using (Claude Desktop, Claude Code, Cursor, Windsurf)
90
95
  2. Prompt for your Blockfrost API key
91
96
  3. Automatically update your config file
@@ -120,6 +125,7 @@ MCP_TRANSPORT=http PORT=3000 npx @indigoprotocol/indigo-mcp
120
125
  ```
121
126
 
122
127
  This starts an HTTP server with:
128
+
123
129
  - `POST /mcp` — MCP endpoint (Streamable HTTP with SSE)
124
130
  - `GET /health` — Health check
125
131
 
@@ -140,6 +146,7 @@ notepad "$env:APPDATA\Claude\claude_desktop_config.json"
140
146
  ```
141
147
 
142
148
  **Standard config:**
149
+
143
150
  ```json
144
151
  {
145
152
  "mcpServers": {
@@ -147,7 +154,7 @@ notepad "$env:APPDATA\Claude\claude_desktop_config.json"
147
154
  "command": "npx",
148
155
  "args": ["-y", "@indigoprotocol/indigo-mcp"],
149
156
  "env": {
150
- "INDEXER_URL": "https://analytics.indigoprotocol.io/api/v1",
157
+ "INDEXER_URL": "https://analytics.indigoprotocol.io/api",
151
158
  "BLOCKFROST_API_KEY": "your-blockfrost-project-id"
152
159
  }
153
160
  }
@@ -167,7 +174,7 @@ If you use nvm and have multiple Node versions, you may need to specify the full
167
174
  "args": ["-y", "@indigoprotocol/indigo-mcp"],
168
175
  "env": {
169
176
  "PATH": "/Users/YOUR_USERNAME/.nvm/versions/node/v22.22.0/bin:/usr/local/bin:/usr/bin:/bin",
170
- "INDEXER_URL": "https://analytics.indigoprotocol.io/api/v1",
177
+ "INDEXER_URL": "https://analytics.indigoprotocol.io/api",
171
178
  "BLOCKFROST_API_KEY": "your-blockfrost-project-id"
172
179
  }
173
180
  }
@@ -192,7 +199,7 @@ nano ~/.claude/settings.json
192
199
  "command": "npx",
193
200
  "args": ["-y", "@indigoprotocol/indigo-mcp"],
194
201
  "env": {
195
- "INDEXER_URL": "https://analytics.indigoprotocol.io/api/v1",
202
+ "INDEXER_URL": "https://analytics.indigoprotocol.io/api",
196
203
  "BLOCKFROST_API_KEY": "your-blockfrost-project-id"
197
204
  }
198
205
  }
@@ -211,7 +218,7 @@ Add to `~/.cursor/mcp.json` (global) or `.cursor/mcp.json` (project-level):
211
218
  "command": "npx",
212
219
  "args": ["-y", "@indigoprotocol/indigo-mcp"],
213
220
  "env": {
214
- "INDEXER_URL": "https://analytics.indigoprotocol.io/api/v1",
221
+ "INDEXER_URL": "https://analytics.indigoprotocol.io/api",
215
222
  "BLOCKFROST_API_KEY": "your-blockfrost-project-id"
216
223
  }
217
224
  }
@@ -230,7 +237,7 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
230
237
  "command": "npx",
231
238
  "args": ["-y", "@indigoprotocol/indigo-mcp"],
232
239
  "env": {
233
- "INDEXER_URL": "https://analytics.indigoprotocol.io/api/v1",
240
+ "INDEXER_URL": "https://analytics.indigoprotocol.io/api",
234
241
  "BLOCKFROST_API_KEY": "your-blockfrost-project-id"
235
242
  }
236
243
  }
@@ -279,7 +286,7 @@ For full Cardano DeFi capabilities, use both Indigo MCP and [Cardano MCP](https:
279
286
  Run the server directly via stdio:
280
287
 
281
288
  ```bash
282
- INDEXER_URL=https://analytics.indigoprotocol.io/api/v1 \
289
+ INDEXER_URL=https://analytics.indigoprotocol.io/api \
283
290
  BLOCKFROST_API_KEY=your-blockfrost-project-id \
284
291
  npx @indigoprotocol/indigo-mcp
285
292
  ```
@@ -297,154 +304,183 @@ For any client that supports MCP over stdio, point it to the `npx @indigoprotoco
297
304
 
298
305
  ### Asset Tools
299
306
 
300
- | Tool | Description | Parameters |
301
- |------|-------------|------------|
302
- | `get_assets` | Get all Indigo iAssets with prices and interest data | None |
303
- | `get_asset` | Get details for a specific iAsset | `asset`: iUSD, iBTC, iETH, or iSOL |
304
- | `get_asset_price` | Get the current price for a specific iAsset | `asset`: iUSD, iBTC, iETH, or iSOL |
305
- | `get_ada_price` | Get the current ADA price in USD | None |
306
- | `get_indy_price` | Get the current INDY token price in ADA and USD | None |
307
+ | Tool | Description | Parameters |
308
+ | ----------------- | ---------------------------------------------------- | ---------------------------------- |
309
+ | `get_assets` | Get all Indigo iAssets with prices and interest data | None |
310
+ | `get_asset` | Get details for a specific iAsset | `asset`: iUSD, iBTC, iETH, or iSOL |
311
+ | `get_asset_price` | Get the current price for a specific iAsset | `asset`: iUSD, iBTC, iETH, or iSOL |
312
+ | `get_ada_price` | Get the current ADA price in USD | None |
313
+ | `get_indy_price` | Get the current INDY token price in ADA and USD | None |
307
314
 
308
315
  ### CDP / Loan Tools
309
316
 
310
- | Tool | Description | Parameters |
311
- |------|-------------|------------|
312
- | `get_all_cdps` | Get all CDPs/loans, optionally filtered by iAsset | `asset?`: iAsset filter; `limit?`: 1-500 (default 50); `offset?`: pagination offset |
313
- | `get_cdps_by_owner` | Get CDPs for a specific owner | `owner`: payment key hash (56-char hex) or bech32 address |
314
- | `get_cdps_by_address` | Get CDPs for a specific Cardano address | `address`: bech32 address (addr1... or addr_test1...) |
315
- | `analyze_cdp_health` | Analyze collateral ratios and liquidation risk | `owner`: payment key hash or bech32 address |
317
+ | Tool | Description | Parameters |
318
+ | --------------------- | ------------------------------------------------- | ----------------------------------------------------------------------------------- |
319
+ | `get_all_cdps` | Get all CDPs/loans, optionally filtered by iAsset | `asset?`: iAsset filter; `limit?`: 1-500 (default 50); `offset?`: pagination offset |
320
+ | `get_cdps_by_owner` | Get CDPs for a specific owner | `owner`: payment key hash (56-char hex) or bech32 address |
321
+ | `get_cdps_by_address` | Get CDPs for a specific Cardano address | `address`: bech32 address (addr1... or addr_test1...) |
322
+ | `analyze_cdp_health` | Analyze collateral ratios and liquidation risk | `owner`: payment key hash or bech32 address |
316
323
 
317
324
  ### CDP Write Tools
318
325
 
319
- | Tool | Description | Parameters |
320
- |------|-------------|------------|
321
- | `open_cdp` | Open a new CDP position (returns unsigned CBOR tx) | `address`: bech32 address; `asset`: iUSD, iBTC, iETH, or iSOL; `collateralAmount`: lovelace; `mintAmount`: iAsset smallest unit |
322
- | `deposit_cdp` | Deposit additional collateral into a CDP | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index; `amount`: lovelace |
323
- | `withdraw_cdp` | Withdraw collateral from a CDP | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index; `amount`: lovelace |
324
- | `close_cdp` | Close a CDP and reclaim collateral | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index |
326
+ | Tool | Description | Parameters |
327
+ | -------------- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
328
+ | `open_cdp` | Open a new CDP position (returns unsigned CBOR tx) | `address`: bech32 address; `asset`: iUSD, iBTC, iETH, or iSOL; `collateralAmount`: lovelace; `mintAmount`: iAsset smallest unit |
329
+ | `deposit_cdp` | Deposit additional collateral into a CDP | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index; `amount`: lovelace |
330
+ | `withdraw_cdp` | Withdraw collateral from a CDP | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index; `amount`: lovelace |
331
+ | `close_cdp` | Close a CDP and reclaim collateral | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index |
325
332
 
326
333
  ### CDP Mint/Burn Tools
327
334
 
328
- | Tool | Description | Parameters |
329
- |------|-------------|------------|
335
+ | Tool | Description | Parameters |
336
+ | ---------- | ------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
330
337
  | `mint_cdp` | Mint additional iAssets from an existing CDP (increases debt) | `address`: bech32 address; `asset`: iUSD, iBTC, iETH, or iSOL; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: CDP UTxO output index; `amount`: iAsset amount in smallest unit |
331
- | `burn_cdp` | Burn iAssets to reduce CDP debt | `address`: bech32 address; `asset`: iUSD, iBTC, iETH, or iSOL; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: CDP UTxO output index; `amount`: iAsset amount in smallest unit |
338
+ | `burn_cdp` | Burn iAssets to reduce CDP debt | `address`: bech32 address; `asset`: iUSD, iBTC, iETH, or iSOL; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: CDP UTxO output index; `amount`: iAsset amount in smallest unit |
332
339
 
333
340
  ### CDP Liquidation & Redemption Tools
334
341
 
335
- | Tool | Description | Parameters |
336
- |------|-------------|------------|
337
- | `liquidate_cdp` | Liquidate an undercollateralized CDP through the stability pool | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index |
338
- | `redeem_cdp` | Redeem iAssets from a CDP | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index; `amount`: iAsset amount in smallest unit |
339
- | `freeze_cdp` | Freeze a CDP to prevent further operations | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index |
340
- | `merge_cdps` | Merge multiple CDPs into one | `address`: bech32 address; `cdpOutRefs`: array of `{txHash, outputIndex}` (min 2) |
342
+ | Tool | Description | Parameters |
343
+ | --------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
344
+ | `liquidate_cdp` | Liquidate an undercollateralized CDP through the stability pool | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index |
345
+ | `redeem_cdp` | Redeem iAssets from a CDP | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index; `amount`: iAsset amount in smallest unit |
346
+ | `freeze_cdp` | Freeze a CDP to prevent further operations | `address`: bech32 address; `asset`: iAsset; `cdpTxHash`: CDP UTxO tx hash; `cdpOutputIndex`: output index |
347
+ | `merge_cdps` | Merge multiple CDPs into one | `address`: bech32 address; `cdpOutRefs`: array of `{txHash, outputIndex}` (min 2) |
341
348
 
342
349
  ### Leverage CDP Tools
343
350
 
344
- | Tool | Description | Parameters |
345
- |------|-------------|------------|
351
+ | Tool | Description | Parameters |
352
+ | -------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
346
353
  | `leverage_cdp` | Open a leveraged CDP by redeeming against ROB positions | `address`: bech32 address; `asset`: iAsset; `leverage`: multiplier (e.g. 2.0); `baseCollateral`: lovelace amount |
347
354
 
348
355
  ### Stability Pool Tools
349
356
 
350
- | Tool | Description | Parameters |
351
- |------|-------------|------------|
352
- | `get_stability_pools` | Get the latest stability pool state for each iAsset | None |
353
- | `get_stability_pool_accounts` | Get all open stability pool accounts, optionally filtered by iAsset | `asset?`: iUSD, iBTC, iETH, or iSOL |
354
- | `get_sp_account_by_owner` | Get stability pool accounts for specific owners | `owners`: array of payment key hashes or bech32 addresses |
357
+ | Tool | Description | Parameters |
358
+ | ----------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------- |
359
+ | `get_stability_pools` | Get the latest stability pool state for each iAsset | None |
360
+ | `get_stability_pool_accounts` | Get all open stability pool accounts, optionally filtered by iAsset | `asset?`: iUSD, iBTC, iETH, or iSOL |
361
+ | `get_sp_account_by_owner` | Get stability pool accounts for specific owners | `owners`: array of payment key hashes or bech32 addresses |
355
362
 
356
363
  ### Staking Tools
357
364
 
358
- | Tool | Description | Parameters |
359
- |------|-------------|------------|
360
- | `get_staking_info` | Get the current INDY staking manager state | None |
361
- | `get_staking_positions` | Get all open INDY staking positions | None |
362
- | `get_staking_positions_by_owner` | Get INDY staking positions for specific owners | `owners`: array of payment key hashes or bech32 addresses |
363
- | `get_staking_position_by_address` | Get INDY staking positions for a single address | `address`: Cardano bech32 address |
365
+ | Tool | Description | Parameters |
366
+ | --------------------------------- | ----------------------------------------------- | --------------------------------------------------------- |
367
+ | `get_staking_info` | Get the current INDY staking manager state | None |
368
+ | `get_staking_positions` | Get all open INDY staking positions | None |
369
+ | `get_staking_positions_by_owner` | Get INDY staking positions for specific owners | `owners`: array of payment key hashes or bech32 addresses |
370
+ | `get_staking_position_by_address` | Get INDY staking positions for a single address | `address`: Cardano bech32 address |
364
371
 
365
372
  ### Stability Pool Request Tools
366
373
 
367
- | Tool | Description | Parameters |
368
- |------|-------------|------------|
374
+ | Tool | Description | Parameters |
375
+ | -------------------- | --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
369
376
  | `process_sp_request` | Process a pending stability pool request (protocol maintenance) | `address`: bech32 address; `asset`: iAsset; `accountTxHash`: account UTxO tx hash; `accountOutputIndex`: output index |
370
- | `annul_sp_request` | Cancel a pending stability pool request | `address`: bech32 address; `accountTxHash`: account UTxO tx hash; `accountOutputIndex`: output index |
377
+ | `annul_sp_request` | Cancel a pending stability pool request | `address`: bech32 address; `accountTxHash`: account UTxO tx hash; `accountOutputIndex`: output index |
371
378
 
372
379
  ### Staking Write Tools
373
380
 
374
- | Tool | Description | Parameters |
375
- |------|-------------|------------|
376
- | `open_staking_position` | Stake INDY tokens by creating a new staking position | `address`: bech32 address; `amount`: INDY amount in smallest unit |
381
+ | Tool | Description | Parameters |
382
+ | ------------------------- | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
383
+ | `open_staking_position` | Stake INDY tokens by creating a new staking position | `address`: bech32 address; `amount`: INDY amount in smallest unit |
377
384
  | `adjust_staking_position` | Adjust an existing staking position (add or remove INDY) | `address`: bech32 address; `amount`: positive=stake more, negative=unstake; `positionTxHash`: UTxO tx hash; `positionOutputIndex`: UTxO output index |
378
- | `close_staking_position` | Close a staking position and unstake all INDY | `address`: bech32 address; `positionTxHash`: UTxO tx hash; `positionOutputIndex`: UTxO output index |
385
+ | `close_staking_position` | Close a staking position and unstake all INDY | `address`: bech32 address; `positionTxHash`: UTxO tx hash; `positionOutputIndex`: UTxO output index |
379
386
 
380
387
  ### Staking Reward Tools
381
388
 
382
- | Tool | Description | Parameters |
383
- |------|-------------|------------|
389
+ | Tool | Description | Parameters |
390
+ | ---------------------------- | ---------------------------------------------------------------- | -------------------------------------------------------------------------------- |
384
391
  | `distribute_staking_rewards` | Distribute collected ADA rewards from collector UTxOs to stakers | `address`: bech32 address; `collectorTxHashes`: array of `{txHash, outputIndex}` |
385
392
 
386
393
  ### Analytics & APR Tools
387
394
 
388
- | Tool | Description | Parameters |
389
- |------|-------------|------------|
390
- | `get_tvl` | Get historical TVL data from DefiLlama | None |
391
- | `get_apr_rewards` | Get all APR reward records | None |
392
- | `get_apr_by_key` | Get APR for a specific key | `key`: APR key (e.g. sp_iUSD_indy, stake_ada) |
393
- | `get_dex_yields` | Get DEX farm yields for iAsset pairs | None |
394
- | `get_protocol_stats` | Get aggregated protocol statistics | None |
395
+ | Tool | Description | Parameters |
396
+ | -------------------- | -------------------------------------- | --------------------------------------------- |
397
+ | `get_tvl` | Get historical TVL data from DefiLlama | None |
398
+ | `get_apr_rewards` | Get all APR reward records | None |
399
+ | `get_apr_by_key` | Get APR for a specific key | `key`: APR key (e.g. sp_iUSD_indy, stake_ada) |
400
+ | `get_dex_yields` | Get DEX farm yields for iAsset pairs | None |
401
+ | `get_protocol_stats` | Get aggregated protocol statistics | None |
395
402
 
396
403
  ### Governance Tools
397
404
 
398
- | Tool | Description | Parameters |
399
- |------|-------------|------------|
400
- | `get_protocol_params` | Get latest governance protocol parameters | None |
401
- | `get_temperature_checks` | Get temperature check polls | None |
402
- | `get_polls` | Get all governance polls | None |
405
+ | Tool | Description | Parameters |
406
+ | ------------------------ | ----------------------------------------- | ---------- |
407
+ | `get_protocol_params` | Get latest governance protocol parameters | None |
408
+ | `get_temperature_checks` | Get temperature check polls | None |
409
+ | `get_polls` | Get all governance polls | None |
403
410
 
404
411
  ### Redemption & Order Book Tools
405
412
 
406
- | Tool | Description | Parameters |
407
- |------|-------------|------------|
408
- | `get_order_book` | Get open limited redemption positions | `asset?`: iAsset filter; `owners?`: array of payment key hashes |
409
- | `get_redemption_orders` | Get redemption orders with optional filters | `timestamp?`: Unix ms; `in_range?`: filter by price range |
410
- | `get_redemption_queue` | Get aggregated redemption queue for an iAsset | `asset`: iUSD, iBTC, iETH, or iSOL |
413
+ | Tool | Description | Parameters |
414
+ | ----------------------- | --------------------------------------------- | --------------------------------------------------------------- |
415
+ | `get_order_book` | Get open limited redemption positions | `asset?`: iAsset filter; `owners?`: array of payment key hashes |
416
+ | `get_redemption_orders` | Get redemption orders with optional filters | `timestamp?`: Unix ms; `in_range?`: filter by price range |
417
+ | `get_redemption_queue` | Get aggregated redemption queue for an iAsset | `asset`: iUSD, iBTC, iETH, or iSOL |
411
418
 
412
419
  ### ROB Write Tools
413
420
 
414
- | Tool | Description | Parameters |
415
- |------|-------------|------------|
416
- | `open_rob` | Open a new ROB position with ADA and a max price limit | `address`: bech32 address; `asset`: iAsset; `lovelacesAmount`: lovelace to deposit; `maxPrice`: on-chain integer string |
417
- | `cancel_rob` | Cancel an existing ROB position | `address`: bech32 address; `robTxHash`: ROB UTxO tx hash; `robOutputIndex`: output index |
418
- | `adjust_rob` | Adjust ADA in a ROB (positive to add, negative to remove) | `address`: bech32 address; `robTxHash`: ROB UTxO tx hash; `robOutputIndex`: output index; `lovelacesAdjustAmount`: adjustment; `newMaxPrice?`: optional new max price |
419
- | `claim_rob` | Claim received iAssets from an ROB position | `address`: bech32 address; `robTxHash`: ROB UTxO tx hash; `robOutputIndex`: output index |
420
- | `redeem_rob` | Redeem iAssets against one or more ROB positions | `address`: bech32 address; `redemptionRobs`: array of `{txHash, outputIndex, iAssetAmount}`; `priceOracleTxHash`; `priceOracleOutputIndex`; `iassetTxHash`; `iassetOutputIndex` |
421
+ | Tool | Description | Parameters |
422
+ | ------------ | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
423
+ | `open_rob` | Open a new ROB position with ADA and a max price limit | `address`: bech32 address; `asset`: iAsset; `lovelacesAmount`: lovelace to deposit; `maxPrice`: on-chain integer string |
424
+ | `cancel_rob` | Cancel an existing ROB position | `address`: bech32 address; `robTxHash`: ROB UTxO tx hash; `robOutputIndex`: output index |
425
+ | `adjust_rob` | Adjust ADA in a ROB (positive to add, negative to remove) | `address`: bech32 address; `robTxHash`: ROB UTxO tx hash; `robOutputIndex`: output index; `lovelacesAdjustAmount`: adjustment; `newMaxPrice?`: optional new max price |
426
+ | `claim_rob` | Claim received iAssets from an ROB position | `address`: bech32 address; `robTxHash`: ROB UTxO tx hash; `robOutputIndex`: output index |
427
+ | `redeem_rob` | Redeem iAssets against one or more ROB positions | `address`: bech32 address; `redemptionRobs`: array of `{txHash, outputIndex, iAssetAmount}`; `priceOracleTxHash`; `priceOracleOutputIndex`; `iassetTxHash`; `iassetOutputIndex` |
421
428
 
422
429
  ### DEX Proxy Tools
423
430
 
424
- | Tool | Description | Parameters |
425
- |------|-------------|------------|
426
- | `get_steelswap_tokens` | Get all tokens available on Steelswap DEX | None |
427
- | `get_steelswap_estimate` | Get a swap estimate from Steelswap | `tokenIn`: input token; `tokenOut`: output token; `amountIn`: amount |
428
- | `get_iris_liquidity_pools` | Get liquidity pools from Iris | `tokenA?`: first token; `tokenB?`: second token; `dex?`: DEX filter |
429
- | `get_blockfrost_balances` | Get token balances for a Cardano address | `address`: Cardano bech32 address |
431
+ | Tool | Description | Parameters |
432
+ | -------------------------- | ----------------------------------------- | -------------------------------------------------------------------- |
433
+ | `get_steelswap_tokens` | Get all tokens available on Steelswap DEX | None |
434
+ | `get_steelswap_estimate` | Get a swap estimate from Steelswap | `tokenIn`: input token; `tokenOut`: output token; `amountIn`: amount |
435
+ | `get_iris_liquidity_pools` | Get liquidity pools from Iris | `tokenA?`: first token; `tokenB?`: second token; `dex?`: DEX filter |
436
+ | `get_blockfrost_balances` | Get token balances for a Cardano address | `address`: Cardano bech32 address |
430
437
 
431
438
  ### Collector & IPFS Tools
432
439
 
433
- | Tool | Description | Parameters |
434
- |------|-------------|------------|
440
+ | Tool | Description | Parameters |
441
+ | --------------------- | ---------------------------------------- | ------------------------------ |
435
442
  | `get_collector_utxos` | Get collector UTXOs for fee distribution | `length?`: max UTXOs to return |
436
- | `store_on_ipfs` | Store text content on IPFS | `text`: content to store |
437
- | `retrieve_from_ipfs` | Retrieve content from IPFS by CID | `cid`: IPFS content identifier |
443
+ | `store_on_ipfs` | Store text content on IPFS | `text`: content to store |
444
+ | `retrieve_from_ipfs` | Retrieve content from IPFS by CID | `cid`: IPFS content identifier |
445
+
446
+ ### Interest Tools (v3)
447
+
448
+ | Tool | Description | Parameters |
449
+ | ---------------------- | ------------------------------------------------------------ | --------------------------------------------- |
450
+ | `collect_interest` | Build a tx to collect accrued interest for one or more CDPs | `asset`, `cdps[]` |
451
+ | `distribute_interest` | Build a tx to distribute collected interest (admin) | `address` |
452
+ | `feed_interest_oracle` | Feed a new interest rate to the interest oracle (admin) | `address`, oracle params |
453
+ | `get_interest_oracle` | Read the current interest oracle state for an iAsset | `asset` |
454
+
455
+ ### Oracle / Pyth Tools (v3)
456
+
457
+ | Tool | Description | Parameters |
458
+ | ------------------- | ----------------------------------------------------------------- | ----------------------------------- |
459
+ | `get_oracle_price` | On-chain price for an iAsset (OracleNft / Delisted / Pyth) | `asset` |
460
+ | `get_pyth_price` | Read the Pyth price-feed config for an iAsset | `asset` |
461
+ | `feed_price_oracle` | Feed a new price to an OracleNft-backed price oracle (admin) | `address`, `oracleTxHash`, price |
462
+
463
+ ### Stableswap Tools (v3)
464
+
465
+ | Tool | Description | Parameters |
466
+ | ------------------------ | ------------------------------------------------------------ | ------------------------------------------- |
467
+ | `get_stableswap_pool` | Get the stableswap pool state for an (iAsset, collateral) | `asset` |
468
+ | `create_stableswap_order`| Build a tx to swap collateral↔iAsset via the stableswap pool | `address`, `asset`, `amount`, `minting` |
469
+ | `cancel_stableswap_order`| Build a tx to cancel a stableswap order | `address`, `orderTxHash`, `orderOutputIndex`|
438
470
 
439
471
  ## Environment Variables
440
472
 
441
- | Variable | Required | Default | Description |
442
- |----------|----------|---------|-------------|
443
- | `INDEXER_URL` | No | `https://analytics.indigoprotocol.io/api/v1` | Indigo analytics API base URL |
444
- | `BLOCKFROST_API_KEY` | For write ops | — | Blockfrost project ID for transaction building |
445
- | `CARDANO_NETWORK` | No | `mainnet` | Cardano network: `mainnet`, `preprod`, or `preview` |
446
- | `MCP_TRANSPORT` | No | `stdio` | Transport mode: `stdio` or `http` |
447
- | `PORT` | No | `3000` | HTTP server port (only used when `MCP_TRANSPORT=http`) |
473
+ | Variable | Required | Default | Description |
474
+ | ---------------------- | ------------- | -------------------------------------------- | ----------------------------------------------------------- |
475
+ | `INDEXER_URL` | No | `https://analytics.indigoprotocol.io/api` | Indigo analytics API base URL |
476
+ | `BLOCKFROST_API_KEY` | For write ops | — | Blockfrost project ID for transaction building |
477
+ | `CARDANO_NETWORK` | No | `mainnet` | Cardano network: `mainnet`, `preprod`, or `preview` |
478
+ | `MCP_TRANSPORT` | No | `stdio` | Transport mode: `stdio` or `http` |
479
+ | `PORT` | No | `3000` | HTTP server port (only used when `MCP_TRANSPORT=http`) |
480
+ | `X402_PRIVATE_KEY` | No | — | EVM private key (`0x…`) of the payer wallet — enables auto-payment via split flow |
481
+ | `PAYMENT_SERVER` | No | `https://mcp.openmm.io` | Settlement worker / proxy URL |
482
+ | `X402_TESTNET` | No | `false` | Use Base Sepolia testnet |
483
+ | `X402_FACILITATOR_URL` | No | — | Fallback facilitator (used only when `PAYMENT_SERVER` unset) |
448
484
 
449
485
  ## Example Queries
450
486
 
@@ -503,6 +539,8 @@ npm run test:watch # run tests in watch mode
503
539
  ```
504
540
  src/
505
541
  ├── index.ts # Server entry point (stdio transport)
542
+ ├── payment.ts # x402 configuration: chain addresses + tool price tiers
543
+ ├── payment-client.ts # withAutoPayment: client-side auto-pay on 402 responses
506
544
  ├── types/
507
545
  │ └── tx-types.ts # UnsignedTxResult, TxSummary types
508
546
  ├── tools/
@@ -550,6 +588,118 @@ npm run build
550
588
  echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"0.1.0"}}}' | node dist/index.js
551
589
  ```
552
590
 
591
+ ## x402 Payment Gating
592
+
593
+ Indigo MCP optionally gates tools behind per-call micropayments using the [x402 protocol](https://x402.org). Payment is disabled by default — set at least one wallet address to enable it.
594
+
595
+ ### How it works
596
+
597
+ Payment uses the **split execution** model — the same architecture as openMM-MCP:
598
+
599
+ 1. A tool is called (no payment header needed from the caller)
600
+ 2. The gate intercepts and contacts the **settlement worker** (`mcp.openmm.io` by default)
601
+ 3. Worker responds `402` with EIP-3009 requirements (amount, recipient, chain)
602
+ 4. Gate **signs locally** using `X402_PRIVATE_KEY` — the key never leaves this process
603
+ 5. Gate retries with the signed payment → worker verifies on-chain, issues a JWT
604
+ 6. Gate verifies JWT locally, executes the original tool handler
605
+ 7. Settlement tx hash is injected into the tool response
606
+
607
+ This keeps process isolation clean: indigo-mcp never holds the recipient wallet — only the payer key. Verification and settlement are handled by the openmm.io proxy.
608
+
609
+ - Read tools (`get_tvl`, `get_asset_price`, …) cost **$0.001 USDC** per call
610
+ - Analysis tools (`analyze_cdp_health`) cost **$0.005 USDC** per call
611
+ - Write tools (`open_cdp`, `mint_cdp`, …) cost **$0.01 USDC** per call
612
+
613
+ ### Environment variables
614
+
615
+ | Variable | Required | Default | Description |
616
+ | ---------------------- | --------- | ----------------------- | ------------------------------------------------------------------------------ |
617
+ | `X402_PRIVATE_KEY` | to enable | — | EVM private key (`0x…`) of the payer wallet — enables split payment |
618
+ | `PAYMENT_SERVER` | optional | `https://mcp.openmm.io` | Settlement worker / proxy URL |
619
+ | `X402_TESTNET` | optional | `false` | Use Base Sepolia testnet |
620
+ | `X402_FACILITATOR_URL` | optional | — | Fallback facilitator URL (used only when `PAYMENT_SERVER` is not set) |
621
+
622
+ ### Split execution flow
623
+
624
+ When `X402_PRIVATE_KEY` is set, every paid tool call is handled transparently:
625
+
626
+ 1. Gate contacts `PAYMENT_SERVER` (`https://mcp.openmm.io` by default)
627
+ 2. Signs EIP-3009 locally — the private key never leaves this process
628
+ 3. Proxy verifies on-chain, issues a short-lived JWT
629
+ 4. Gate verifies JWT, executes tool, injects settlement tx hash into response
630
+
631
+ If `X402_PRIVATE_KEY` is not set the gate is disabled and all tools execute without payment.
632
+
633
+ ```bash
634
+ # Minimal: just set the payer key (proxy defaults to mcp.openmm.io)
635
+ X402_PRIVATE_KEY=0xYourPayerPrivateKey npx @indigoprotocol/indigo-mcp
636
+
637
+ # Self-hosted proxy
638
+ X402_PRIVATE_KEY=0xYourPayerPrivateKey \
639
+ PAYMENT_SERVER=https://your-own-proxy \
640
+ npx @indigoprotocol/indigo-mcp
641
+ ```
642
+
643
+ ### Local development
644
+
645
+ ```bash
646
+ # 1. Copy example env
647
+ cp .env.example .env
648
+ # Edit .env and set X402_PRIVATE_KEY to a funded Base Sepolia wallet
649
+
650
+ # 2. Start the HTTP server
651
+ MCP_TRANSPORT=http PORT=3000 npm run dev
652
+
653
+ # 3. Run the payment e2e tests
654
+ X402_TESTNET=true npm test -- x402-payment
655
+ ```
656
+
657
+ ### MCP client config with x402
658
+
659
+ Add the `env` block to whichever MCP config file your client uses:
660
+
661
+ **Claude Code** (`~/.claude/settings.json`):
662
+
663
+ ```json
664
+ {
665
+ "mcpServers": {
666
+ "indigo": {
667
+ "command": "npx",
668
+ "args": ["-y", "@indigoprotocol/indigo-mcp"],
669
+ "env": {
670
+ "INDEXER_URL": "https://analytics.indigoprotocol.io/api",
671
+ "BLOCKFROST_API_KEY": "your-blockfrost-project-id",
672
+ "X402_PRIVATE_KEY": "0xYourPayerPrivateKey",
673
+ "X402_TESTNET": "true"
674
+ }
675
+ }
676
+ }
677
+ }
678
+ ```
679
+
680
+ **Claude Desktop** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
681
+
682
+ ```json
683
+ {
684
+ "mcpServers": {
685
+ "indigo": {
686
+ "command": "npx",
687
+ "args": ["-y", "@indigoprotocol/indigo-mcp"],
688
+ "env": {
689
+ "INDEXER_URL": "https://analytics.indigoprotocol.io/api",
690
+ "BLOCKFROST_API_KEY": "your-blockfrost-project-id",
691
+ "X402_PRIVATE_KEY": "0xYourPayerPrivateKey",
692
+ "X402_TESTNET": "true"
693
+ }
694
+ }
695
+ }
696
+ }
697
+ ```
698
+
699
+ **Cursor / Windsurf** — same `env` block applies to `~/.cursor/mcp.json` or `~/.codeium/windsurf/mcp_config.json`.
700
+
701
+ > Set `X402_TESTNET` to `false` (or omit it) for Base mainnet.
702
+
553
703
  ## License
554
704
 
555
705
  ISC