@arcadia-finance/mcp-server 0.1.4 → 0.1.5
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/LICENSE.md +631 -68
- package/README.md +19 -3
- package/dist/index.js +15 -5
- package/dist/tools/advanced/add-liquidity.js +7 -0
- package/dist/tools/advanced/close-position.js +7 -0
- package/dist/tools/advanced/position-actions.js +7 -0
- package/dist/tools/advanced/remove-liquidity.js +7 -0
- package/dist/tools/advanced/repay-with-collateral.js +7 -0
- package/dist/tools/advanced/swap.js +7 -0
- package/dist/tools/read/accounts.js +21 -0
- package/dist/tools/read/allowances.js +7 -0
- package/dist/tools/read/assets.js +7 -0
- package/dist/tools/read/balances.js +7 -0
- package/dist/tools/read/guides.js +7 -0
- package/dist/tools/read/points.js +7 -0
- package/dist/tools/read/pools.js +7 -0
- package/dist/tools/read/protocol.js +14 -0
- package/dist/tools/write/approve.js +7 -0
- package/dist/tools/write/borrow.js +7 -0
- package/dist/tools/write/configure-asset-manager.js +7 -0
- package/dist/tools/write/create-account.js +7 -0
- package/dist/tools/write/deposit.js +7 -0
- package/dist/tools/write/repay.js +7 -0
- package/dist/tools/write/set-asset-manager.js +7 -0
- package/dist/tools/write/sign-and-send.js +7 -0
- package/dist/tools/write/withdraw.js +7 -0
- package/package.json +2 -2
- package/server.json +9 -2
package/README.md
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@arcadia-finance/mcp-server)
|
|
4
4
|
[](https://www.npmjs.com/package/@arcadia-finance/mcp-server)
|
|
5
5
|
[](https://smithery.ai/server/@arcadia-finance/mcp-server)
|
|
6
|
-
[](LICENSE.md)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](https://modelcontextprotocol.io/)
|
|
9
9
|
[](https://lobehub.com/mcp/arcadia-finance-mcp-server)
|
|
10
|
-
[](https://glama.ai/mcp/servers/@arcadia-finance/mcp-server)
|
|
11
11
|
|
|
12
12
|
MCP server for [Arcadia Finance](https://arcadia.finance), a platform to manage Uniswap and Aerodrome concentrated liquidity positions with built-in leverage, automated rebalancing, and yield optimization. Read protocol data and build unsigned transactions for LP management, borrowing, deposits, and more.
|
|
13
13
|
|
|
@@ -130,7 +130,19 @@ yarn build
|
|
|
130
130
|
|
|
131
131
|
## MCP Client Configuration
|
|
132
132
|
|
|
133
|
-
**
|
|
133
|
+
**Remote (no install needed):**
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"mcpServers": {
|
|
138
|
+
"arcadia-finance": {
|
|
139
|
+
"url": "https://mcp.arcadia.finance/mcp"
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Via npx** (local stdio):
|
|
134
146
|
|
|
135
147
|
```json
|
|
136
148
|
{
|
|
@@ -149,6 +161,10 @@ yarn build
|
|
|
149
161
|
**Claude Code:**
|
|
150
162
|
|
|
151
163
|
```bash
|
|
164
|
+
# Remote
|
|
165
|
+
claude mcp add arcadia-finance --transport http https://mcp.arcadia.finance/mcp
|
|
166
|
+
|
|
167
|
+
# Local
|
|
152
168
|
claude mcp add arcadia-finance -- npx -y @arcadia-finance/mcp-server
|
|
153
169
|
```
|
|
154
170
|
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,9 @@ if (transportMode === "http") {
|
|
|
47
47
|
try {
|
|
48
48
|
entry.transport.close();
|
|
49
49
|
}
|
|
50
|
-
catch {
|
|
50
|
+
catch {
|
|
51
|
+
/* already closed */
|
|
52
|
+
}
|
|
51
53
|
sessions.delete(id);
|
|
52
54
|
}, SESSION_TTL_MS);
|
|
53
55
|
}
|
|
@@ -56,13 +58,19 @@ if (transportMode === "http") {
|
|
|
56
58
|
const transport = new StreamableHTTPServerTransport({
|
|
57
59
|
sessionIdGenerator: () => crypto.randomUUID(),
|
|
58
60
|
onsessioninitialized: (sessionId) => {
|
|
59
|
-
sessions.set(sessionId, {
|
|
61
|
+
sessions.set(sessionId, {
|
|
62
|
+
server,
|
|
63
|
+
transport,
|
|
64
|
+
timer: setTimeout(() => {
|
|
60
65
|
try {
|
|
61
66
|
transport.close();
|
|
62
67
|
}
|
|
63
|
-
catch {
|
|
68
|
+
catch {
|
|
69
|
+
/* already closed */
|
|
70
|
+
}
|
|
64
71
|
sessions.delete(sessionId);
|
|
65
|
-
}, SESSION_TTL_MS)
|
|
72
|
+
}, SESSION_TTL_MS),
|
|
73
|
+
});
|
|
66
74
|
},
|
|
67
75
|
});
|
|
68
76
|
await server.connect(transport);
|
|
@@ -100,7 +108,9 @@ if (transportMode === "http") {
|
|
|
100
108
|
try {
|
|
101
109
|
transport.close();
|
|
102
110
|
}
|
|
103
|
-
catch {
|
|
111
|
+
catch {
|
|
112
|
+
/* ignore */
|
|
113
|
+
}
|
|
104
114
|
}
|
|
105
115
|
throw err;
|
|
106
116
|
}
|
|
@@ -12,6 +12,13 @@ function formatTokenAmount(value, decimals, maxFrac = 8) {
|
|
|
12
12
|
}
|
|
13
13
|
export function registerAddLiquidityTool(server, api, chains) {
|
|
14
14
|
server.registerTool("build_add_liquidity_tx", {
|
|
15
|
+
annotations: {
|
|
16
|
+
title: "Build Add Liquidity Transaction",
|
|
17
|
+
readOnlyHint: false,
|
|
18
|
+
destructiveHint: false,
|
|
19
|
+
idempotentHint: true,
|
|
20
|
+
openWorldHint: true,
|
|
21
|
+
},
|
|
15
22
|
description: "Multi-step flash-action: atomically combines [deposit from wallet] + [use account collateral] + [swap to optimal ratio] + [mint LP] + [borrow if leveraged] in ONE transaction. Do NOT call build_deposit_tx separately. Capital sources: wallet tokens (deposits array), existing account collateral (use_account_assets=true), or both. Check allowances first (get_allowance), then approve if needed (build_approve_tx). Supports depositing multiple tokens and minting multiple LP positions in one tx. Works with both margin accounts (can leverage) and spot accounts (no leverage). For workflows, call get_guide('strategies'). The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation. expected_value_change is the estimated slippage/fee cost in the account's numeraire token (raw wei units, e.g. 18 decimals for WETH). Compare before.total_account_value and after.total_account_value for the full picture.",
|
|
16
23
|
inputSchema: {
|
|
17
24
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -5,6 +5,13 @@ import { formatAdvancedResponse } from "./format-response.js";
|
|
|
5
5
|
import { validateAddress, validateChainId } from "../../utils/validation.js";
|
|
6
6
|
export function registerClosePositionTool(server, api, chains) {
|
|
7
7
|
server.registerTool("build_close_position_tx", {
|
|
8
|
+
annotations: {
|
|
9
|
+
title: "Build Close Position Transaction",
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: true,
|
|
14
|
+
},
|
|
8
15
|
description: `Atomic flash-action that closes an Arcadia account position in ONE transaction. Combines up to 3 steps atomically: [burn LP position] + [swap all tokens to a single target asset] + [repay debt]. Tokens remain in the account after closing — use build_withdraw_tx to send them to your wallet.
|
|
9
16
|
|
|
10
17
|
ALWAYS try this tool first when closing/exiting a position. Only fall back to individual tools (build_remove_liquidity_tx, build_swap_tx, build_repay_with_collateral_tx, build_withdraw_tx) if this tool fails.
|
|
@@ -3,6 +3,13 @@ import { formatAdvancedResponse } from "./format-response.js";
|
|
|
3
3
|
import { validateAddress } from "../../utils/validation.js";
|
|
4
4
|
export function registerPositionActionsTool(server, api) {
|
|
5
5
|
server.registerTool("build_position_action_tx", {
|
|
6
|
+
annotations: {
|
|
7
|
+
title: "Build Position Action Transaction",
|
|
8
|
+
readOnlyHint: false,
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
idempotentHint: true,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
},
|
|
6
13
|
description: "Flash-action: stake, unstake, or claim rewards for an LP position in one atomic transaction. The stake/unstake direction is auto-detected from asset_address: pass the non-staked position manager to stake, or the staked position manager to unstake. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up).",
|
|
7
14
|
inputSchema: {
|
|
8
15
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -3,6 +3,13 @@ import { formatAdvancedResponse } from "./format-response.js";
|
|
|
3
3
|
import { validateAddress } from "../../utils/validation.js";
|
|
4
4
|
export function registerRemoveLiquidityTool(server, api) {
|
|
5
5
|
server.registerTool("build_remove_liquidity_tx", {
|
|
6
|
+
annotations: {
|
|
7
|
+
title: "Build Remove Liquidity Transaction",
|
|
8
|
+
readOnlyHint: false,
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
idempotentHint: true,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
},
|
|
6
13
|
description: `Flash-action: PARTIALLY decreases liquidity from an LP position. The position remains open with reduced liquidity; underlying tokens stay in the account.
|
|
7
14
|
|
|
8
15
|
For FULL position exit (burn LP + swap + repay + withdraw), use build_close_position_tx instead — it batches everything into one atomic transaction.
|
|
@@ -3,6 +3,13 @@ import { formatAdvancedResponse } from "./format-response.js";
|
|
|
3
3
|
import { validateAddress } from "../../utils/validation.js";
|
|
4
4
|
export function registerRepayWithCollateralTool(server, api) {
|
|
5
5
|
server.registerTool("build_repay_with_collateral_tx", {
|
|
6
|
+
annotations: {
|
|
7
|
+
title: "Build Repay With Collateral Transaction",
|
|
8
|
+
readOnlyHint: false,
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
idempotentHint: true,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
},
|
|
6
13
|
description: "Multi-step flash-action: swaps account collateral to debt token and repays in one atomic transaction. To repay from wallet instead, use build_repay_tx. NOTE: If you are closing a position (remove LP + swap + repay + withdraw), prefer build_close_position_tx which batches everything atomically. Only use this tool for standalone repayment while keeping the position active. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation.",
|
|
7
14
|
inputSchema: {
|
|
8
15
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -3,6 +3,13 @@ import { formatAdvancedResponse } from "./format-response.js";
|
|
|
3
3
|
import { validateAddress } from "../../utils/validation.js";
|
|
4
4
|
export function registerSwapTool(server, api) {
|
|
5
5
|
server.registerTool("build_swap_tx", {
|
|
6
|
+
annotations: {
|
|
7
|
+
title: "Build Swap Transaction",
|
|
8
|
+
readOnlyHint: false,
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
idempotentHint: true,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
},
|
|
6
13
|
description: "Flash-action: swaps assets within an Arcadia account in one atomic transaction. The backend finds the optimal swap route. NOTE: If you are closing a position (swap + repay + withdraw), prefer build_close_position_tx which batches everything atomically. Only use this tool for standalone swaps within an active position. The returned calldata is time-sensitive — sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation.",
|
|
7
14
|
inputSchema: {
|
|
8
15
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -38,6 +38,13 @@ function trimOverview(overview) {
|
|
|
38
38
|
}
|
|
39
39
|
export function registerAccountTools(server, api, chains) {
|
|
40
40
|
server.registerTool("get_account_info", {
|
|
41
|
+
annotations: {
|
|
42
|
+
title: "Get Account Info",
|
|
43
|
+
readOnlyHint: true,
|
|
44
|
+
destructiveHint: false,
|
|
45
|
+
idempotentHint: true,
|
|
46
|
+
openWorldHint: true,
|
|
47
|
+
},
|
|
41
48
|
description: "Get full overview of an Arcadia account: health factor, collateral value, debt, deposited assets, liquidation price, and automation status. Pass account_address for a specific account, or wallet_address to list all accounts owned by a wallet. Health factor = 1 - (used_margin / liquidation_value): 1 = no debt (safest), >0 = healthy, 0 = liquidation threshold, <0 = past liquidation. Higher is safer. On Base, also returns which asset managers are enabled (rebalancer, compounder, yield_claimer, merkl_operator, cow_swapper).",
|
|
42
49
|
inputSchema: {
|
|
43
50
|
account_address: z.string().optional().describe("Arcadia account address"),
|
|
@@ -174,6 +181,13 @@ export function registerAccountTools(server, api, chains) {
|
|
|
174
181
|
}
|
|
175
182
|
});
|
|
176
183
|
server.registerTool("get_account_history", {
|
|
184
|
+
annotations: {
|
|
185
|
+
title: "Get Account History",
|
|
186
|
+
readOnlyHint: true,
|
|
187
|
+
destructiveHint: false,
|
|
188
|
+
idempotentHint: true,
|
|
189
|
+
openWorldHint: true,
|
|
190
|
+
},
|
|
177
191
|
description: "Get historical collateral and debt values for an Arcadia account over time. Returns a time series of snapshots (timestamp, collateral_value, debt_value, net_value in USD). Useful for charting account performance over a period.",
|
|
178
192
|
inputSchema: {
|
|
179
193
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -198,6 +212,13 @@ export function registerAccountTools(server, api, chains) {
|
|
|
198
212
|
}
|
|
199
213
|
});
|
|
200
214
|
server.registerTool("get_account_pnl", {
|
|
215
|
+
annotations: {
|
|
216
|
+
title: "Get Account PnL",
|
|
217
|
+
readOnlyHint: true,
|
|
218
|
+
destructiveHint: false,
|
|
219
|
+
idempotentHint: true,
|
|
220
|
+
openWorldHint: true,
|
|
221
|
+
},
|
|
201
222
|
description: "Get PnL (cost basis) and yield earned for an Arcadia account. Returns lifetime totals: cost basis vs current value (negative cost_basis = net profit withdrawn), net transfers per token, total yield earned in USD and per token. All monetary values are in USD unless suffixed otherwise.",
|
|
202
223
|
inputSchema: {
|
|
203
224
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -6,6 +6,13 @@ import { validateAddress, validateChainId } from "../../utils/validation.js";
|
|
|
6
6
|
const MAX_UINT256 = 2n ** 256n - 1n;
|
|
7
7
|
export function registerAllowanceTools(server, chains) {
|
|
8
8
|
server.registerTool("get_allowance", {
|
|
9
|
+
annotations: {
|
|
10
|
+
title: "Get Token Allowance",
|
|
11
|
+
readOnlyHint: true,
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
idempotentHint: true,
|
|
14
|
+
openWorldHint: true,
|
|
15
|
+
},
|
|
9
16
|
description: "Check ERC20 token allowances for a spender address. Use before build_approve_tx to avoid redundant approvals — skip approving if the current allowance is already sufficient.",
|
|
10
17
|
inputSchema: {
|
|
11
18
|
owner_address: z.string().describe("Token owner address (the wallet granting approval)"),
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerAssetTools(server, api) {
|
|
3
3
|
server.registerTool("get_assets", {
|
|
4
|
+
annotations: {
|
|
5
|
+
title: "Get Supported Assets",
|
|
6
|
+
readOnlyHint: true,
|
|
7
|
+
destructiveHint: false,
|
|
8
|
+
idempotentHint: true,
|
|
9
|
+
openWorldHint: true,
|
|
10
|
+
},
|
|
4
11
|
description: "Get supported collateral assets on Arcadia. Returns compact list (address, symbol, decimals, type) by default. Use asset_addresses for USD price lookup. Use search to filter by symbol substring.",
|
|
5
12
|
inputSchema: {
|
|
6
13
|
asset_addresses: z
|
|
@@ -5,6 +5,13 @@ import { getPublicClient } from "../../clients/chain.js";
|
|
|
5
5
|
import { validateAddress, validateChainId } from "../../utils/validation.js";
|
|
6
6
|
export function registerBalanceTools(server, chains) {
|
|
7
7
|
server.registerTool("get_wallet_balances", {
|
|
8
|
+
annotations: {
|
|
9
|
+
title: "Get Wallet Balances",
|
|
10
|
+
readOnlyHint: true,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: true,
|
|
14
|
+
},
|
|
8
15
|
description: "Get native ETH and ERC20 token balances for a wallet address. Reads directly from chain via RPC multicall. Use before build_add_liquidity_tx or build_deposit_tx to verify the wallet has sufficient tokens.",
|
|
9
16
|
inputSchema: {
|
|
10
17
|
wallet_address: z.string().describe("Wallet address to check balances for"),
|
|
@@ -34,6 +34,13 @@ export function registerGuideTools(server) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
server.registerTool("get_guide", {
|
|
37
|
+
annotations: {
|
|
38
|
+
title: "Get Guide",
|
|
39
|
+
readOnlyHint: true,
|
|
40
|
+
destructiveHint: false,
|
|
41
|
+
idempotentHint: true,
|
|
42
|
+
openWorldHint: true,
|
|
43
|
+
},
|
|
37
44
|
description: "Get Arcadia workflow guides and reference documentation. Call this before multi-step workflows (opening LP positions, enabling automation, closing positions) or when you need contract addresses, asset manager addresses, or strategy parameters. Topics: overview (addresses + tool catalog), automation (rebalancer/compounder setup), strategies (step-by-step templates), selection (how to evaluate and parameterize strategies).",
|
|
38
45
|
inputSchema: {
|
|
39
46
|
topic: z
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerPointsTools(server, api) {
|
|
3
3
|
server.registerTool("get_points", {
|
|
4
|
+
annotations: {
|
|
5
|
+
title: "Get Points",
|
|
6
|
+
readOnlyHint: true,
|
|
7
|
+
destructiveHint: false,
|
|
8
|
+
idempotentHint: true,
|
|
9
|
+
openWorldHint: true,
|
|
10
|
+
},
|
|
4
11
|
description: "Get Arcadia points balance for a wallet, or the points leaderboard (paginated) if no wallet is specified.",
|
|
5
12
|
inputSchema: {
|
|
6
13
|
wallet_address: z.string().optional().describe("Wallet address for points balance"),
|
package/dist/tools/read/pools.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerPoolTools(server, api) {
|
|
3
3
|
server.registerTool("get_lending_pools", {
|
|
4
|
+
annotations: {
|
|
5
|
+
title: "Get Lending Pools",
|
|
6
|
+
readOnlyHint: true,
|
|
7
|
+
destructiveHint: false,
|
|
8
|
+
idempotentHint: true,
|
|
9
|
+
openWorldHint: true,
|
|
10
|
+
},
|
|
4
11
|
description: "Get Arcadia lending pool data: TVL, utilization, available liquidity. Key fields: interest_rate = current borrow cost, lending_apy = lender yield. All rates are decimal fractions (1.0 = 100%, 0.06 = 6%). Returns all pools, or a single pool with APY history if pool_address is provided.",
|
|
5
12
|
inputSchema: {
|
|
6
13
|
pool_address: z
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export function registerProtocolTools(server, api) {
|
|
3
3
|
server.registerTool("get_strategies", {
|
|
4
|
+
annotations: {
|
|
5
|
+
title: "Get Strategies",
|
|
6
|
+
readOnlyHint: true,
|
|
7
|
+
destructiveHint: false,
|
|
8
|
+
idempotentHint: true,
|
|
9
|
+
openWorldHint: true,
|
|
10
|
+
},
|
|
4
11
|
description: "Get Arcadia LP strategies. Use featured_only=true for curated top strategies (recommended first call). Use strategy_id for full detail on a specific strategy — includes APY per range width (narrower range = higher APY but more rebalancing cost/risk). Without filters, returns a compact summary with 7d avg APY for the strategy's default range. Increase limit or use offset for pagination. All APY values are decimal fractions (1.0 = 100%, 0.05 = 5%).",
|
|
5
12
|
inputSchema: {
|
|
6
13
|
strategy_id: z.number().optional().describe("Strategy ID for full detail"),
|
|
@@ -68,6 +75,13 @@ export function registerProtocolTools(server, api) {
|
|
|
68
75
|
}
|
|
69
76
|
});
|
|
70
77
|
server.registerTool("get_recommendation", {
|
|
78
|
+
annotations: {
|
|
79
|
+
title: "Get Recommendation",
|
|
80
|
+
readOnlyHint: true,
|
|
81
|
+
destructiveHint: false,
|
|
82
|
+
idempotentHint: true,
|
|
83
|
+
openWorldHint: true,
|
|
84
|
+
},
|
|
71
85
|
description: "Get a rebalancing recommendation for an Arcadia account — suggests asset changes to optimize yield. Uses 1d APY (not 7d like get_strategies list view), so recommended strategies may differ from the list ranking.",
|
|
72
86
|
inputSchema: {
|
|
73
87
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -6,6 +6,13 @@ import { validateAddress } from "../../utils/validation.js";
|
|
|
6
6
|
const MAX_UINT256 = 2n ** 256n - 1n;
|
|
7
7
|
export function registerApproveTool(server, _chains) {
|
|
8
8
|
server.registerTool("build_approve_tx", {
|
|
9
|
+
annotations: {
|
|
10
|
+
title: "Build Approve Transaction",
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
idempotentHint: true,
|
|
14
|
+
openWorldHint: false,
|
|
15
|
+
},
|
|
9
16
|
description: "Build an unsigned approval transaction. For ERC20 tokens: generates approve(spender, amount). For ERC721/ERC1155 NFTs (e.g. LP positions): generates setApprovalForAll(operator, true). Required before build_deposit_tx or build_add_liquidity_tx (when depositing from wallet). Tip: call get_allowance first to check if approval already exists — skip this if the current allowance is sufficient.",
|
|
10
17
|
inputSchema: {
|
|
11
18
|
token_address: z.string().describe("Token contract address to approve"),
|
|
@@ -5,6 +5,13 @@ import { appendDataSuffix } from "../../utils/attribution.js";
|
|
|
5
5
|
import { validateAddress } from "../../utils/validation.js";
|
|
6
6
|
export function registerBorrowTool(server, _chains, api) {
|
|
7
7
|
server.registerTool("build_borrow_tx", {
|
|
8
|
+
annotations: {
|
|
9
|
+
title: "Build Borrow Transaction",
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: false,
|
|
14
|
+
},
|
|
8
15
|
description: "Build an unsigned transaction to borrow from an Arcadia lending pool against account collateral. Only works with margin accounts (created with a creditor/lending pool). Spot accounts (no creditor) cannot borrow — the tool will validate this and reject. Before borrowing, verify the account has positive free margin via get_account_info: collateral_value must exceed used_margin.",
|
|
9
16
|
inputSchema: {
|
|
10
17
|
pool_address: z
|
|
@@ -117,6 +117,13 @@ function resolveAmAddress(chainId, amType, protocol) {
|
|
|
117
117
|
}
|
|
118
118
|
export function registerConfigureAssetManagerTool(server, _chains) {
|
|
119
119
|
server.registerTool("build_configure_asset_manager_tx", {
|
|
120
|
+
annotations: {
|
|
121
|
+
title: "Build Configure Asset Manager Transaction",
|
|
122
|
+
readOnlyHint: false,
|
|
123
|
+
destructiveHint: false,
|
|
124
|
+
idempotentHint: true,
|
|
125
|
+
openWorldHint: false,
|
|
126
|
+
},
|
|
120
127
|
description: "Build an unsigned transaction to enable AND configure an asset manager on an Arcadia V3/V4 account. Unlike build_set_asset_manager_tx (which only grants permission), this also sets the initiator, fee limits, and strategy parameters in one transaction via setAssetManagers. Supports rebalancer (with trigger ratios and compound mode), compounder, yield claimer (with fee recipient), and merkl operator (with reward recipient). For cow_swapper, use build_set_asset_manager_tx instead (no callback data needed). Pass pool_protocol to auto-resolve the correct AM address (required for rebalancer/compounder/yield_claimer), or pass asset_manager_address directly. merkl_operator is protocol-agnostic and auto-resolves without pool_protocol. Returns { transaction: { to, data, value, chainId } }.",
|
|
121
128
|
inputSchema: {
|
|
122
129
|
account_address: z.string().describe("Arcadia account address (must be V3 or V4)"),
|
|
@@ -26,6 +26,13 @@ export function computeAccountAddress(factoryAddress, userSalt, walletAddress, i
|
|
|
26
26
|
}
|
|
27
27
|
export function registerCreateAccountTool(server, chains) {
|
|
28
28
|
server.registerTool("build_create_account_tx", {
|
|
29
|
+
annotations: {
|
|
30
|
+
title: "Build Create Account Transaction",
|
|
31
|
+
readOnlyHint: false,
|
|
32
|
+
destructiveHint: false,
|
|
33
|
+
idempotentHint: true,
|
|
34
|
+
openWorldHint: false,
|
|
35
|
+
},
|
|
29
36
|
description: "Build an unsigned transaction to create a new Arcadia account via the Factory contract. account_version: 3 with creditor → V3 margin account (can borrow/leverage). account_version: 0 or 4 → V4 spot account (no borrowing, creditor is ignored, any ERC20 allowed). Returns the predicted account address (deterministic via CREATE2).",
|
|
30
37
|
inputSchema: {
|
|
31
38
|
salt: z.number().describe("Unique salt (uint32) for deterministic account address"),
|
|
@@ -6,6 +6,13 @@ import { appendDataSuffix } from "../../utils/attribution.js";
|
|
|
6
6
|
import { validateAddress, validateChainId } from "../../utils/validation.js";
|
|
7
7
|
export function registerDepositTool(server, chains) {
|
|
8
8
|
server.registerTool("build_deposit_tx", {
|
|
9
|
+
annotations: {
|
|
10
|
+
title: "Build Deposit Transaction",
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
idempotentHint: true,
|
|
14
|
+
openWorldHint: false,
|
|
15
|
+
},
|
|
9
16
|
description: "Build an unsigned transaction to deposit assets into an Arcadia account as collateral. Supports ERC20 tokens and ERC721 NFTs (LP positions). NOT needed before build_add_liquidity_tx — that tool deposits from wallet atomically. Ensure the account is approved first (call get_allowance to check, then build_approve_tx if needed). Account version is auto-detected on-chain (override with account_version if needed).",
|
|
10
17
|
inputSchema: {
|
|
11
18
|
account_address: z.string().describe("Arcadia account address"),
|
|
@@ -5,6 +5,13 @@ import { appendDataSuffix } from "../../utils/attribution.js";
|
|
|
5
5
|
import { validateAddress } from "../../utils/validation.js";
|
|
6
6
|
export function registerRepayTool(server, _chains) {
|
|
7
7
|
server.registerTool("build_repay_tx", {
|
|
8
|
+
annotations: {
|
|
9
|
+
title: "Build Repay Transaction",
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: false,
|
|
14
|
+
},
|
|
8
15
|
description: "Build an unsigned transaction to repay debt to an Arcadia lending pool from your wallet. This tool does not validate whether the account has outstanding debt — check with get_account_info first. Check allowance first (get_allowance), then approve the pool if needed (build_approve_tx). To repay using account collateral instead, use build_repay_with_collateral_tx.",
|
|
9
16
|
inputSchema: {
|
|
10
17
|
pool_address: z
|
|
@@ -5,6 +5,13 @@ import { appendDataSuffix } from "../../utils/attribution.js";
|
|
|
5
5
|
import { validateAddress } from "../../utils/validation.js";
|
|
6
6
|
export function registerSetAssetManagerTool(server, _chains) {
|
|
7
7
|
server.registerTool("build_set_asset_manager_tx", {
|
|
8
|
+
annotations: {
|
|
9
|
+
title: "Build Set Asset Manager Transaction",
|
|
10
|
+
readOnlyHint: false,
|
|
11
|
+
destructiveHint: false,
|
|
12
|
+
idempotentHint: true,
|
|
13
|
+
openWorldHint: false,
|
|
14
|
+
},
|
|
8
15
|
description: "Build an unsigned transaction to grant or revoke an asset manager's permission on an Arcadia V3/V4 account via setAssetManagers. This ONLY toggles the permission flag — it does NOT configure initiator, fees, or strategy parameters. For full setup (enable + configure in one tx), use build_configure_asset_manager_tx instead. For asset manager addresses, call get_guide('automation'). Returns { transaction: { to, data, value, chainId } }.",
|
|
9
16
|
inputSchema: {
|
|
10
17
|
account_address: z.string().describe("Arcadia account address (V3 or V4)"),
|
|
@@ -9,6 +9,13 @@ const VIEM_CHAINS = {
|
|
|
9
9
|
};
|
|
10
10
|
export function registerSignAndSendTool(server, chains) {
|
|
11
11
|
server.registerTool("sign_and_send_tx", {
|
|
12
|
+
annotations: {
|
|
13
|
+
title: "Sign and Send Transaction",
|
|
14
|
+
readOnlyHint: false,
|
|
15
|
+
destructiveHint: true,
|
|
16
|
+
idempotentHint: false,
|
|
17
|
+
openWorldHint: true,
|
|
18
|
+
},
|
|
12
19
|
description: "DEV ONLY — Sign and broadcast an unsigned transaction using a local private key (PK env var). For production, use a dedicated wallet MCP server (Fireblocks, Safe, Turnkey, etc.) instead of this tool. Takes the transaction object returned by any build_*_tx tool and submits it onchain.",
|
|
13
20
|
inputSchema: {
|
|
14
21
|
to: z.string().describe("Target contract address"),
|
|
@@ -6,6 +6,13 @@ import { appendDataSuffix } from "../../utils/attribution.js";
|
|
|
6
6
|
import { validateAddress, validateChainId } from "../../utils/validation.js";
|
|
7
7
|
export function registerWithdrawTool(server, chains) {
|
|
8
8
|
server.registerTool("build_withdraw_tx", {
|
|
9
|
+
annotations: {
|
|
10
|
+
title: "Build Withdraw Transaction",
|
|
11
|
+
readOnlyHint: false,
|
|
12
|
+
destructiveHint: false,
|
|
13
|
+
idempotentHint: true,
|
|
14
|
+
openWorldHint: false,
|
|
15
|
+
},
|
|
9
16
|
description: "Build an unsigned transaction to withdraw assets from an Arcadia account to the owner's wallet. Only the account owner can withdraw. Will revert if the account has debt and withdrawal would make it undercollateralized. Does not support max_uint256 — pass exact amounts from get_account_info. Account version is auto-detected on-chain (override with account_version if needed).",
|
|
10
17
|
inputSchema: {
|
|
11
18
|
account_address: z.string().describe("Arcadia account address"),
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcadia-finance/mcp-server",
|
|
3
3
|
"mcpName": "io.github.arcadia-finance/mcp-server",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"description": "MCP server for Arcadia Finance. Manage concentrated liquidity positions with leverage, automated rebalancing, and yield optimization on Base, Optimism, and Unichain.",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"license": "
|
|
7
|
+
"license": "AGPL-3.0",
|
|
8
8
|
"packageManager": "yarn@4.13.0",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "io.github.arcadia-finance/mcp-server",
|
|
4
4
|
"title": "Arcadia Finance",
|
|
5
5
|
"description": "Manage Uniswap and Aerodrome liquidity positions with automated rebalancing and leverage.",
|
|
6
|
-
"version": "0.1.
|
|
6
|
+
"version": "0.1.5",
|
|
7
7
|
"websiteUrl": "https://arcadia.finance",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/arcadia-finance/mcp-server",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"identifier": "@arcadia-finance/mcp-server",
|
|
16
|
-
"version": "0.1.
|
|
16
|
+
"version": "0.1.5",
|
|
17
17
|
"transport": {
|
|
18
18
|
"type": "stdio"
|
|
19
19
|
},
|
|
@@ -43,6 +43,13 @@
|
|
|
43
43
|
"isSecret": true
|
|
44
44
|
}
|
|
45
45
|
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"registryType": "url",
|
|
49
|
+
"identifier": "https://mcp.arcadia.finance/mcp",
|
|
50
|
+
"transport": {
|
|
51
|
+
"type": "streamablehttp"
|
|
52
|
+
}
|
|
46
53
|
}
|
|
47
54
|
]
|
|
48
55
|
}
|