starkfi 0.6.1 → 0.6.3

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/MCP.md CHANGED
@@ -1,469 +1,129 @@
1
- # Model Context Protocol (MCP) Integration
1
+ # Model Context Protocol (MCP) — Tool Reference
2
2
 
3
- StarkFi operates as a fully-featured Model Context Protocol (MCP) server. By executing `npx starkfi@latest mcp-start` over the `stdio` transport layer, AI development environments such as Cursor, Claude Desktop, and Antigravity can interact with the Starknet blockchain and execute decentralized finance operations through natural language commands.
3
+ StarkFi exposes **42 MCP tools** via stdio transport. AI clients (Cursor, Claude Desktop, Antigravity) connect and discover all tools with JSON schemas automatically.
4
4
 
5
- ## Client Configuration
6
-
7
- To integrate StarkFi into your AI environment, configure your MCP client settings file (e.g., `.cursor/mcp.json`, `claude_desktop_config.json`, or `~/.gemini/antigravity/mcp_config.json`) with the following definition:
5
+ ## Setup
8
6
 
9
7
  ```json
10
8
  {
11
- "mcpServers": {
12
- "starkfi": {
13
- "command": "npx",
14
- "args": ["-y", "starkfi@latest", "mcp-start"]
15
- }
16
- }
9
+ "mcpServers": {
10
+ "starkfi": {
11
+ "command": "npx",
12
+ "args": ["-y", "starkfi@latest", "mcp-start"]
13
+ }
14
+ }
17
15
  }
18
- ```
19
-
20
- **Authentication Requirement:** The StarkFi CLI must be authenticated locally (via `npx starkfi@latest auth login`) before the MCP server can execute any state-mutating transactions on behalf of the user.
21
-
22
- ## Tool Registry
23
-
24
- Upon initialization, the StarkFi server dynamically provisions **42 tool schemas** to the connected AI client. Tools are organized into domain-specific registration modules (`src/mcp/tools/`): **auth** (2), **wallet** (6), **trade** (5), **staking** (8), **lending** (10), **dca** (4), and **confidential** (7).
25
-
26
- ---
27
-
28
- ### Read-Only Tools
29
-
30
- These tools do not mutate blockchain state and are safe to call without user confirmation.
31
-
32
- #### `get_auth_status`
33
-
34
- Validates the active CLI session and verifies Fibrous API connectivity.
35
-
36
- _No input parameters required._
37
-
38
- #### `get_balance`
39
-
40
- Retrieves STRK, ETH, and specified ERC-20 token balances for the authenticated wallet.
41
-
42
- | Parameter | Type | Required | Description |
43
- | --------- | ------ | -------- | ------------------------------------------------------------------------------- |
44
- | `token` | string | No | Specific token symbol (e.g. `STRK`, `ETH`, `USDC`). Omit to fetch all balances. |
45
-
46
- #### `get_tx_status`
47
-
48
- Queries the Starknet sequencer for transaction status and execution receipts.
49
-
50
- | Parameter | Type | Required | Description |
51
- | --------- | ------ | -------- | -------------------------- |
52
- | `hash` | string | **Yes** | Transaction hash (`0x...`) |
53
-
54
- #### `get_portfolio`
55
-
56
- Returns a complete DeFi portfolio: all token balances with USD values, staking positions, and lending positions in one call.
57
-
58
- _No input parameters required._
59
-
60
- #### `get_swap_quote`
61
-
62
- Calculates swap routing via Fibrous (default). Returns the expected output amount and quote details. Optionally specify a different provider or use `auto` to race all providers for best price. Always call this **before** `swap_tokens` so the user can review the expected output.
63
-
64
- | Parameter | Type | Required | Description |
65
- | ------------ | ------ | -------- | ---------------------------------------------------- |
66
- | `amount` | string | **Yes** | Amount to swap (e.g. `0.1`, `100`) |
67
- | `from_token` | string | **Yes** | Source token symbol to sell (e.g. `ETH`, `USDC`) |
68
- | `to_token` | string | **Yes** | Destination token symbol to buy (e.g. `STRK`, `DAI`) |
69
- | `provider` | string | No | Swap provider: `fibrous` (default), `avnu`, `ekubo`, or `auto` (race all). |
70
-
71
- #### `get_multi_swap_quote`
72
-
73
- Calculates routing for 2-3 swap pairs at once. Each pair uses Fibrous by default, or specify a different provider.
74
-
75
- | Parameter | Type | Required | Description |
76
- | ---------- | ------------------------------------------------------- | -------- | ------------------------------- |
77
- | `swaps` | array of `{ amount, from_token, to_token }` (2-3 items) | **Yes** | Array of swap pairs (2-3 items) |
78
- | `provider` | string | No | Swap provider: `fibrous` (default), `avnu`, `ekubo`, or `auto` (race all per pair). |
79
-
80
- #### `list_validators`
81
-
82
- Enumerates all officially recognized Starknet staking validators.
83
-
84
- _No input parameters required._
85
-
86
- #### `list_pools`
87
-
88
- Enumerates available delegation pools for a validator, including multi-token pools.
89
-
90
- | Parameter | Type | Required | Description |
91
- | ----------- | ------ | -------- | -------------------------------------------------------------------------------------- |
92
- | `validator` | string | **Yes** | Validator name (e.g. `Karnot`, `Kakarot`) or staker address. Supports partial matches. |
93
-
94
- #### `get_staking_info`
95
-
96
- Retrieves specific user staked balances, unclaimed rewards, and active cooldown periods.
97
-
98
- | Parameter | Type | Required | Description |
99
- | --------- | ------ | -------- | --------------------------------------- |
100
- | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
101
-
102
- #### `get_stake_status`
103
-
104
- Generates a consolidated staking dashboard across validators. Accepts an optional target validator name to filter the view.
105
-
106
- | Parameter | Type | Required | Description |
107
- | ----------- | ------ | -------- | -------------------------------------------------------------------- |
108
- | `validator` | string | No | Optional validator name or staker address to strictly filter results |
109
-
110
- #### `list_lending_pools`
111
-
112
- Enumerates active Vesu V2 lending pools — assets (with APY/APR), supported pairs, and pool addresses.
113
-
114
- | Parameter | Type | Required | Description |
115
- | --------- | ------ | -------- | ------------------------------------------------------- |
116
- | `name` | string | No | Filter pools by name (partial match). Omit to list all. |
117
-
118
- #### `get_lending_position`
119
-
120
- Retrieves the user's supplied yield, outstanding debt, Health Factor, and Risk Level for a specific pool.
121
-
122
- | Parameter | Type | Required | Description |
123
- | ------------------ | ------ | -------- | --------------------------------------------------------------------------- |
124
- | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
125
- | `collateral_token` | string | **Yes** | Collateral token symbol (e.g. `ETH`, `STRK`) |
126
- | `borrow_token` | string | No | Borrow token symbol (e.g. `USDC`, `USDT`). Optional for supply-only checks. |
127
-
128
- #### `lending_quote_health`
129
-
130
- Simulates the impact of a lending action (borrow, repay, deposit, withdraw) on position health factor **without executing**. Returns current and projected health.
131
-
132
- | Parameter | Type | Required | Description |
133
- | ------------------ | ------ | -------- | ------------------------------------------------------------- |
134
- | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
135
- | `collateral_token` | string | **Yes** | Collateral token symbol (e.g. `ETH`, `STRK`) |
136
- | `debt_token` | string | **Yes** | Debt token symbol (e.g. `USDC`, `USDT`) |
137
- | `action` | enum | **Yes** | Action to simulate: `borrow`, `repay`, `deposit`, `withdraw` |
138
- | `amount` | string | **Yes** | Amount for the action (e.g. `100`, `0.5`) |
139
-
140
- ---
141
-
142
- ### DCA (Dollar-Cost Averaging) Tools
143
-
144
- #### `dca_preview`
145
-
146
- Previews a single DCA cycle by estimating the swap output for one execution. Always call this **before** `dca_create` so the user can review the expected output per cycle.
147
-
148
- | Parameter | Type | Required | Description |
149
- | --------------- | ------ | -------- | --------------------------------------------------------- |
150
- | `sell_token` | string | **Yes** | Token to sell (e.g. `USDC`, `ETH`) |
151
- | `buy_token` | string | **Yes** | Token to buy (e.g. `STRK`, `ETH`) |
152
- | `amount` | string | **Yes** | Amount to sell per cycle (e.g. `10`, `100`) |
153
- | `provider` | string | No | DCA provider: `avnu` (default) or `ekubo` |
154
-
155
- #### `dca_create`
156
-
157
- Creates a recurring DCA order that automatically executes swaps at regular intervals. Only call this **after** previewing with `dca_preview`.
158
-
159
- | Parameter | Type | Required | Description |
160
- | ---------------- | ------- | -------- | --------------------------------------------------------- |
161
- | `sell_token` | string | **Yes** | Token to sell (e.g. `USDC`, `ETH`) |
162
- | `buy_token` | string | **Yes** | Token to buy (e.g. `STRK`, `ETH`) |
163
- | `amount` | string | **Yes** | Total amount to sell across all cycles |
164
- | `amount_per_cycle` | string | **Yes** | Amount sold per cycle (e.g. `10`) |
165
- | `frequency` | string | No | ISO 8601 duration (default: `P1D`). E.g. `PT12H`, `P1W` |
166
- | `provider` | string | No | DCA provider: `avnu` (default) or `ekubo` |
167
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
168
-
169
- #### `dca_list`
170
-
171
- Lists the user's DCA orders with optional filtering by status and provider. Each order in the response includes both `id` (UUID) and `orderAddress` (on-chain contract address) — use either to cancel.
172
-
173
- | Parameter | Type | Required | Description |
174
- | ---------- | ------ | -------- | ---------------------------------------------------------- |
175
- | `status` | string | No | Filter by status: `ACTIVE`, `CLOSED`, or `INDEXING` |
176
- | `provider` | string | No | Filter by provider: `avnu` or `ekubo` |
177
- | `page` | number | No | Page number for pagination (default: `0`) |
178
-
179
- #### `dca_cancel`
180
-
181
- Cancels an active DCA order. Use the order UUID or on-chain contract address from `dca_list`. At least one identifier is required.
182
-
183
- | Parameter | Type | Required | Description |
184
- | --------------- | ------- | -------- | -------------------------------------------------------------------------- |
185
- | `order_id` | string | No* | DCA order UUID (the `id` field from `dca_list`) |
186
- | `order_address` | string | No* | DCA order on-chain contract address (the `orderAddress` field from `dca_list`) |
187
- | `provider` | string | No | DCA provider: `avnu` or `ekubo` |
188
-
189
- \*At least one of `order_id` or `order_address` is required.
190
-
191
- ---
192
-
193
- ### Confidential Transfer Tools (Tongo Cash)
194
-
195
- Privacy-preserving transfers using ZK proofs via Tongo. Amounts are hidden on-chain; recipients are identified by elliptic curve public keys (x, y), not Starknet addresses.
196
-
197
- #### `confidential_setup`
198
-
199
- Configures Tongo Cash credentials. The private key is stored locally and never sent to the network. Must be called before any other confidential operations.
200
-
201
- | Parameter | Type | Required | Description |
202
- | ------------------ | ------ | -------- | ------------------------------------------------------ |
203
- | `tongo_key` | string | **Yes** | Tongo private key (kept locally, never sent to network) |
204
- | `contract_address` | string | **Yes** | Tongo contract address on Starknet (`0x…`) |
205
-
206
- #### `confidential_balance`
207
16
 
208
- Returns the confidential account state: active balance, pending balance, nonce, and Tongo address. Call this before fund/transfer/withdraw to verify state.
209
-
210
- _No input parameters required._
211
-
212
- #### `confidential_fund`
213
-
214
- Funds the confidential account by converting public ERC-20 tokens into private confidential balance.
215
-
216
- | Parameter | Type | Required | Description |
217
- | ---------- | ------- | -------- | --------------------------------------------------------- |
218
- | `amount` | string | **Yes** | Amount to fund (e.g. `100`) |
219
- | `token` | string | No | Token symbol (default: `USDC`) |
220
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
221
-
222
- #### `confidential_transfer`
223
-
224
- Transfers tokens confidentially to another Tongo account. Generates ZK proofs locally and submits on-chain. Recipient is identified by elliptic curve point (x, y), NOT a Starknet address.
225
-
226
- | Parameter | Type | Required | Description |
227
- | ------------- | ------- | -------- | --------------------------------------------------------- |
228
- | `amount` | string | **Yes** | Amount to transfer |
229
- | `recipient_x` | string | **Yes** | Recipient public key X coordinate (BigNumberish) |
230
- | `recipient_y` | string | **Yes** | Recipient public key Y coordinate (BigNumberish) |
231
- | `token` | string | No | Token symbol (default: `USDC`) |
232
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
233
-
234
- #### `confidential_withdraw`
235
-
236
- Withdraws from confidential account to a public Starknet address. Converts private balance back to public ERC-20 tokens.
237
-
238
- | Parameter | Type | Required | Description |
239
- | ---------- | ------- | -------- | --------------------------------------------------------- |
240
- | `amount` | string | **Yes** | Amount to withdraw |
241
- | `to` | string | No | Recipient Starknet address (default: own wallet) |
242
- | `token` | string | No | Token symbol (default: `USDC`) |
243
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
244
-
245
- #### `confidential_ragequit`
246
-
247
- Emergency exit — withdraws the entire confidential balance to a public address. Use when you need to exit immediately.
248
-
249
- | Parameter | Type | Required | Description |
250
- | --------- | ------ | -------- | ------------------------------------------------ |
251
- | `to` | string | No | Recipient Starknet address (default: own wallet) |
252
-
253
- #### `confidential_rollover`
17
+ ```
254
18
 
255
- Activates pending confidential balance. Received transfers start as "pending" and must be rolled over to become spendable.
19
+ > **Prerequisite:** Authenticate via `npx starkfi@latest auth login` before the MCP server can execute transactions.
256
20
 
257
- _No input parameters required._
21
+ **[Full Setup Guide](https://docs.starkfi.app/docs/mcp/setup)**
258
22
 
259
23
  ---
260
24
 
261
- ### Transactional Tools
262
-
263
- These tools construct and broadcast transactions. The connecting AI client is strictly responsible for prompting the user for explicit confirmation before execution. All transactional tools accept an optional `simulate` parameter — when set to `true`, the tool estimates fees and validates the transaction without broadcasting.
264
-
265
- #### `deploy_account`
266
-
267
- Deploys the associated smart contract account to the Starknet network (idempotent operation).
268
-
269
- _No input parameters required._
270
-
271
- #### `swap_tokens`
272
-
273
- Broadcasts a token swap transaction via Fibrous (default) or a specified provider. Only call this **after** showing the user a quote via `get_swap_quote`.
274
-
275
- | Parameter | Type | Required | Description |
276
- | ------------ | ------- | -------- | --------------------------------------------------------- |
277
- | `amount` | string | **Yes** | Amount to swap (e.g. `0.1`, `100`) |
278
- | `from_token` | string | **Yes** | Source token symbol to sell (e.g. `ETH`, `STRK`) |
279
- | `to_token` | string | **Yes** | Destination token symbol to buy (e.g. `USDC`, `DAI`) |
280
- | `slippage` | number | No | Slippage tolerance in % (default: `1`) |
281
- | `provider` | string | No | Swap provider: `fibrous` (default), `avnu`, `ekubo`, or `auto` (race all). |
282
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
283
-
284
- #### `send_tokens`
285
-
286
- Broadcasts a standard token transfer transaction for STRK, ETH, or ERC-20 assets. Pre-checks balance.
287
-
288
- | Parameter | Type | Required | Description |
289
- | ----------- | ------- | -------- | --------------------------------------------------------- |
290
- | `amount` | string | **Yes** | Amount to send (e.g. `0.1`, `100`) |
291
- | `token` | string | **Yes** | Token symbol (e.g. `STRK`, `ETH`, `USDC`) |
292
- | `recipient` | string | **Yes** | Recipient Starknet address (`0x...`) |
293
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
294
-
295
- #### `multi_swap`
296
-
297
- Executes 2-3 token swaps in a single transaction. Each pair uses Fibrous by default. Call `get_multi_swap_quote` first to preview.
298
-
299
- | Parameter | Type | Required | Description |
300
- | ---------- | ------------------------------------------------------- | -------- | --------------------------------------------- |
301
- | `swaps` | array of `{ amount, from_token, to_token }` (2-3 items) | **Yes** | Array of swap pairs (2-3 items) |
302
- | `slippage` | number | No | Slippage tolerance in % (default: `1`) |
303
- | `provider` | string | No | Swap provider: `fibrous` (default), `avnu`, `ekubo`, or `auto` (race all per pair). |
304
- | `simulate` | boolean | No | Set `true` to estimate fees without executing |
305
-
306
- #### `batch_execute`
307
-
308
- Executes multiple DeFi operations (swap, stake, supply, send, borrow, repay, withdraw, dca-create, dca-cancel) in a single Starknet multicall. Minimum 2 operations.
309
-
310
- | Parameter | Type | Required | Description |
311
- | ------------ | ----------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
312
- | `operations` | array of `{ type, params }` (min 2 items) | **Yes** | Each operation has a `type` (`swap`, `stake`, `supply`, `send`, `borrow`, `repay`, `withdraw`, `dca-create`, `dca-cancel`) and a `params` record. **swap**: `{amount, from_token, to_token}`. **stake**: `{amount, token?, pool? or validator?}`. **supply**: `{amount, token, pool}`. **send**: `{amount, token, to}`. **borrow**: `{collateral_amount, collateral_token, borrow_amount, borrow_token, pool}`. **repay**: `{amount, token, collateral_token, pool}`. **withdraw**: `{amount, token, pool}`. **dca-create**: `{sell_token, buy_token, sell_amount, amount_per_cycle, frequency?, provider?}`. **dca-cancel**: `{order_id?, order_address?, provider?}`. |
313
- | `simulate` | boolean | No | Set `true` to estimate fees without executing |
314
-
315
- #### `stake_tokens`
316
-
317
- Executes multi-token smart delegation (STRK, WBTC, tBTC, SolvBTC, LBTC). Auto-detects whether the user needs to enter the pool or add to an existing delegation.
318
-
319
- | Parameter | Type | Required | Description |
320
- | --------- | ------ | -------- | ----------------------------------------------------------------------------------- |
321
- | `amount` | string | **Yes** | Amount to stake (e.g. `100`, `0.01`) |
322
- | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
323
- | `token` | string | No | Token symbol to stake (default: `STRK`). Supported: STRK, WBTC, tBTC, SolvBTC, LBTC |
324
-
325
- #### `unstake_tokens`
326
-
327
- Manages the strict two-step Starknet unstaking lifecycle. Step 1: call with `action="intent"` to start cooldown. Step 2: call with `action="exit"` to complete withdrawal.
328
-
329
- | Parameter | Type | Required | Description |
330
- | --------- | ---------------------- | ----------------- | --------------------------------------------------------------------- |
331
- | `action` | `"intent"` or `"exit"` | **Yes** | `intent` starts unstaking, `exit` completes withdrawal after cooldown |
332
- | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
333
- | `amount` | string | Only for `intent` | Amount to unstake |
334
- | `token` | string | No | Token symbol (default: `STRK`). Must match the pool's token. |
335
-
336
- #### `claim_rewards`
337
-
338
- Extracts earned rewards from a staking pool to the user's wallet.
339
-
340
- | Parameter | Type | Required | Description |
341
- | --------- | ------ | -------- | --------------------------------------- |
342
- | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
343
-
344
- #### `compound_rewards`
345
-
346
- Atomically claims staking rewards and re-stakes them into the same pool in a single transaction (compound interest).
347
-
348
- | Parameter | Type | Required | Description |
349
- | --------- | ------ | -------- | --------------------------------------- |
350
- | `pool` | string | **Yes** | Staking pool contract address (`0x...`) |
351
-
352
- #### `supply_assets`
353
-
354
- Deposits specified assets into a Vesu V2 pool to generate yield.
355
-
356
- | Parameter | Type | Required | Description |
357
- | --------- | ------ | -------- | ------------------------------------------------------------- |
358
- | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
359
- | `amount` | string | **Yes** | Amount to supply (e.g. `100`, `0.5`) |
360
- | `token` | string | **Yes** | Token symbol to supply (e.g. `STRK`, `ETH`, `USDC`) |
361
- | `simulate`| boolean | No | Set `true` to estimate fees without sending a transaction |
362
-
363
- #### `withdraw_assets`
364
-
365
- Redeems supplied assets from a Vesu V2 lending pool.
366
-
367
- | Parameter | Type | Required | Description |
368
- | --------- | ------ | -------- | ------------------------------------------------------------- |
369
- | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
370
- | `amount` | string | **Yes** | Amount to withdraw (e.g. `100`, `0.5`) |
371
- | `token` | string | **Yes** | Token symbol to withdraw (e.g. `STRK`, `ETH`, `USDC`) |
372
- | `simulate`| boolean | No | Set `true` to estimate fees without sending a transaction |
373
-
374
- #### `borrow_assets`
375
-
376
- Executes an atomic collateral deposit and subsequent asset borrow against a Vesu V2 pool. Supports using previously supplied earn positions as collateral.
377
-
378
- | Parameter | Type | Required | Description |
379
- | ------------------- | ------- | -------- | ------------------------------------------------------------------------- |
380
- | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
381
- | `collateral_amount` | string | **Yes** | Collateral amount to deposit (e.g. `1000`) |
382
- | `collateral_token` | string | **Yes** | Collateral token symbol (e.g. `STRK`, `ETH`) |
383
- | `borrow_amount` | string | **Yes** | Amount to borrow (e.g. `100`) |
384
- | `borrow_token` | string | **Yes** | Token to borrow (e.g. `USDC`, `USDT`) |
385
- | `use_supplied` | boolean | No | Set `true` to use previously supplied earn position as collateral via multicall |
386
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
387
-
388
- #### `repay_debt`
389
-
390
- Processes the repayment of borrowed assets against an existing Vesu V2 position.
391
-
392
- | Parameter | Type | Required | Description |
393
- | ------------------ | ------ | -------- | --------------------------------------------------------------------------------------- |
394
- | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
395
- | `amount` | string | **Yes** | Amount to repay (e.g. `50`, `100`) |
396
- | `token` | string | **Yes** | Token to repay (e.g. `USDC`, `USDT`) |
397
- | `collateral_token` | string | **Yes** | Collateral token of the position (e.g. `ETH`, `STRK`). Needed to identify the position. |
398
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
399
-
400
- #### `close_position`
401
-
402
- Atomically closes an active Vesu V2 lending position. Repays all outstanding debt and withdraws all collateral in a single unified execution.
403
-
404
- | Parameter | Type | Required | Description |
405
- | ------------------ | ------ | -------- | ------------------------------------------------------------- |
406
- | `pool` | string | **Yes** | Pool name (e.g. `Prime`, `Re7`) or contract address (`0x...`) |
407
- | `collateral_token` | string | **Yes** | Collateral token symbol of the position (e.g. `STRK`, `ETH`) |
408
- | `debt_token` | string | **Yes** | Borrowed token symbol of the position (e.g. `USDC`, `USDT`) |
409
- | `simulate` | boolean | No | Set `true` to estimate fees without sending a transaction |
410
-
411
- #### `monitor_lending_position`
412
-
413
- Monitors health factors across lending positions. Returns alerts and actionable recommendations when health factor drops below configurable thresholds.
414
-
415
- | Parameter | Type | Required | Description |
416
- | ------------------- | ------ | -------- | -------------------------------------------------------------------------------- |
417
- | `pool` | string | No | Pool name or address. Omit to scan all pools for active borrow positions. |
418
- | `collateral_token` | string | No | Collateral token symbol. Required when specifying a pool. |
419
- | `borrow_token` | string | No | Debt token symbol. Required when specifying a pool. |
420
- | `warning_threshold` | number | No | Custom warning threshold (default: `1.3`). |
421
-
422
- #### `auto_rebalance_lending`
423
-
424
- Automatically adjusts a lending position to restore health factor via debt repayment or additional collateral. Supports simulation mode.
425
-
426
- | Parameter | Type | Required | Description |
427
- | ---------------------- | ------- | -------- | ------------------------------------------------------------------------ |
428
- | `pool` | string | **Yes** | Pool name or address |
429
- | `collateral_token` | string | **Yes** | Collateral token symbol |
430
- | `borrow_token` | string | **Yes** | Debt token symbol |
431
- | `strategy` | enum | No | `repay`, `add-collateral`, or `auto` (default: `auto`) |
432
- | `target_health_factor` | number | No | Target health factor (default: `1.3`) |
433
- | `simulate` | boolean | No | Set `true` to preview adjustment without executing |
434
-
435
- #### `rebalance_portfolio`
436
-
437
- Rebalances a portfolio to match a target allocation. Calculates optimal swaps and executes as a single batch transaction via Fibrous (default).
438
-
439
- | Parameter | Type | Required | Description |
440
- | ----------- | ------- | -------- | ----------------------------------------------------------------- |
441
- | `target` | string | **Yes** | Target allocation, e.g. `"50 ETH, 30 USDC, 20 STRK"` |
442
- | `slippage` | number | No | Slippage tolerance % (default: `1`) |
443
- | `simulate` | boolean | No | Set `true` to preview plan without executing |
25
+ ## Tool Registry (42 Tools)
26
+
27
+ ### Auth & Config (2)
28
+
29
+ | Tool | Type | Description |
30
+ | --- | --- | --- |
31
+ | `get_auth_status` | read | Session status and API health |
32
+ | `config_action` | write | Manage RPC, network, gas settings (`list`, `reset`, `set-rpc`, `get-rpc`, `set-network`, `set-gasfree`, `set-gas-token`) |
33
+
34
+ ### Wallet (6)
35
+
36
+ | Tool | Type | Description |
37
+ | --- | --- | --- |
38
+ | `get_balance` | read | Token balances (STRK, ETH, ERC-20) |
39
+ | `get_portfolio` | read | Full DeFi dashboard with USD values |
40
+ | `get_tx_status` | read | Transaction status and receipt |
41
+ | `deploy_account` | write | Deploy smart account (idempotent) |
42
+ | `send_tokens` | write | Transfer tokens to an address |
43
+ | `rebalance_portfolio` | write | Rebalance to target allocation via batch swaps |
44
+
45
+ ### Trade (5)
46
+
47
+ | Tool | Type | Description |
48
+ | --- | --- | --- |
49
+ | `get_swap_quote` | read | Swap quote (Fibrous/AVNU/Ekubo/auto) |
50
+ | `swap_tokens` | write | Execute swap |
51
+ | `get_multi_swap_quote` | read | Multi-pair quote (2-3 pairs) |
52
+ | `multi_swap` | write | Execute multi-pair swap |
53
+ | `batch_execute` | write | Atomic multicall (swap + stake + lend + send + DCA, min 2 ops) |
54
+
55
+ ### Staking (8)
56
+
57
+ | Tool | Type | Description |
58
+ | --- | --- | --- |
59
+ | `list_validators` | read | All Starknet validators |
60
+ | `list_pools` | read | Pools for a validator |
61
+ | `get_staking_info` | read | User staked balance and rewards |
62
+ | `get_stake_status` | read | Staking dashboard across validators |
63
+ | `stake_tokens` | write | Stake (STRK, WBTC, tBTC, SolvBTC, LBTC) |
64
+ | `unstake_tokens` | write | Unstake (2-step: intent → exit) |
65
+ | `claim_rewards` | write | Claim staking rewards |
66
+ | `compound_rewards` | write | Claim + re-stake atomically |
67
+
68
+ ### Lending (10)
69
+
70
+ | Tool | Type | Description |
71
+ | --- | --- | --- |
72
+ | `list_lending_pools` | read | Vesu V2 pools with APY/APR |
73
+ | `get_lending_position` | read | Position health, yield, and debt |
74
+ | `lending_quote_health` | read | Simulate action impact on health factor |
75
+ | `supply_assets` | write | Supply to lending pool |
76
+ | `withdraw_assets` | write | Withdraw from lending pool |
77
+ | `borrow_assets` | write | Borrow with collateral |
78
+ | `repay_debt` | write | Repay outstanding debt |
79
+ | `close_position` | write | Atomic repay + withdraw |
80
+ | `monitor_lending_position` | read | Health factor monitoring with alerts |
81
+ | `auto_rebalance_lending` | write | Auto-rebalance risky positions |
82
+
83
+ ### DCA (4)
84
+
85
+ | Tool | Type | Description |
86
+ | --- | --- | --- |
87
+ | `dca_preview` | read | Preview single DCA cycle |
88
+ | `dca_create` | write | Create recurring buy order |
89
+ | `dca_list` | read | List DCA orders |
90
+ | `dca_cancel` | write | Cancel DCA order |
91
+
92
+ ### Confidential (7)
93
+
94
+ | Tool | Type | Description |
95
+ | --- | --- | --- |
96
+ | `confidential_setup` | write | Configure Tongo Cash credentials (local-only) |
97
+ | `confidential_balance` | read | Confidential account state |
98
+ | `confidential_fund` | write | Fund from public confidential |
99
+ | `confidential_transfer` | write | Private transfer (ZK proof) |
100
+ | `confidential_withdraw` | write | Withdraw to public address |
101
+ | `confidential_ragequit` | write | Emergency full withdrawal |
102
+ | `confidential_rollover` | write | Activate pending balance |
444
103
 
445
104
  ---
446
105
 
447
- ### Configuration Utilities
448
-
449
- #### `config_action`
450
-
451
- Views and modifies global CLI behavior: RPC routing, network selection, and Gas Abstraction. Network changes take effect immediately — no re-authentication required.
106
+ ## Agent Best Practices
452
107
 
453
- | Parameter | Type | Required | Description |
454
- | --------- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
455
- | `action` | enum | **Yes** | One of: `list`, `reset`, `set-rpc`, `get-rpc`, `set-network`, `set-gasfree`, `set-gas-token` |
456
- | `value` | string | No | `set-gasfree`: `on`/`off`. `set-gas-token`: symbol (`USDC`, `ETH`) or `reset`/`off`. `set-rpc`: URL string. `set-network`: `mainnet`/`sepolia` (instant switch, overrides session). |
108
+ 1. **Always quote before executing** `get_swap_quote` → `swap_tokens`, `dca_preview` → `dca_create`
109
+ 2. **Use simulation** Set `simulate: true` on any write tool to preview fees
110
+ 3. **Confirm with user** Never execute write tools without explicit user confirmation
111
+ 4. **Check auth first** Call `get_auth_status` before any wallet operations
112
+ 5. **Check existing positions** — Query before creating to avoid duplicates
113
+ 6. **Confidential lifecycle** — Always `confidential_setup` → `confidential_balance` → action. Remind recipients to `confidential_rollover`
457
114
 
458
115
  ---
459
116
 
460
- ## Agent Best Practices
461
-
462
- 1. **Always quote before executing** — Call `get_swap_quote` before `swap_tokens`, `get_multi_swap_quote` before `multi_swap`, and `dca_preview` before `dca_create`
463
- 2. **Use simulation for transparency** — Set `simulate: true` on any transactional tool to preview fees before executing
464
- 3. **Confirm with the user** — Never execute a transactional tool without explicit user confirmation
465
- 4. **Use `get_auth_status` first** Verify the session is active before attempting any wallet operations
466
- 5. **Check existing positions** Query `get_stake_status`, `get_lending_position`, and `dca_list` before creating new positions to avoid duplicates
467
- 6. **Network awareness** Use `config_action` with `set-network` to switch between `mainnet` and `sepolia`. Lending, staking, batch, portfolio, and wallet tools are fully network-aware. Swap tools (`swap_tokens`, `multi_swap`, `rebalance_portfolio`) are mainnet-only
468
- 7. **DCA lifecycle** Always preview with `dca_preview` first, list existing orders with `dca_list` to avoid duplicates, and confirm cancellation before calling `dca_cancel`
469
- 8. **Confidential lifecycle** Always call `confidential_setup` and `confidential_balance` before transactional operations. After receiving a transfer, remind the user to `confidential_rollover` to activate pending balance
117
+ ## Full Documentation
118
+
119
+ | Resource | Link |
120
+ | --- | --- |
121
+ | MCP Overview | [docs.starkfi.app/docs/mcp](https://docs.starkfi.app/docs/mcp) |
122
+ | Tool Schemas (Auth) | [docs.starkfi.app/docs/mcp/tools-auth](https://docs.starkfi.app/docs/mcp/tools-auth) |
123
+ | Tool Schemas (Wallet) | [docs.starkfi.app/docs/mcp/tools-wallet](https://docs.starkfi.app/docs/mcp/tools-wallet) |
124
+ | Tool Schemas (Trade) | [docs.starkfi.app/docs/mcp/tools-trade](https://docs.starkfi.app/docs/mcp/tools-trade) |
125
+ | Tool Schemas (Staking) | [docs.starkfi.app/docs/mcp/tools-staking](https://docs.starkfi.app/docs/mcp/tools-staking) |
126
+ | Tool Schemas (Lending) | [docs.starkfi.app/docs/mcp/tools-lending](https://docs.starkfi.app/docs/mcp/tools-lending) |
127
+ | Tool Schemas (DCA) | [docs.starkfi.app/docs/mcp/tools-dca](https://docs.starkfi.app/docs/mcp/tools-dca) |
128
+ | Tool Schemas (Confidential) | [docs.starkfi.app/docs/mcp/tools-confidential](https://docs.starkfi.app/docs/mcp/tools-confidential) |
129
+ | Security Model | [docs.starkfi.app/docs/architecture/security](https://docs.starkfi.app/docs/architecture/security) |