@arcadia-finance/mcp-server 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/index.js +1 -1
- package/dist/tools/read/accounts.js +44 -2
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
# Arcadia Finance MCP Server
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@arcadia-finance/mcp-server)
|
|
4
|
+
[](https://smithery.ai/server/@arcadia-finance/mcp-server)
|
|
5
|
+
[](LICENSE.md)
|
|
6
|
+
[](https://www.typescriptlang.org/)
|
|
7
|
+
[](https://modelcontextprotocol.io/)
|
|
8
|
+
|
|
3
9
|
MCP server for [Arcadia Finance](https://arcadia.finance), a platform to manage 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.
|
|
4
10
|
|
|
5
11
|
Designed for AI agents (Claude, Cursor, etc.) to interact with Arcadia onchain.
|
|
6
12
|
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
[](https://vscode.dev/redirect/mcp/install?name=arcadia-finance&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40arcadia-finance%2Fmcp-server%22%5D%7D)
|
|
16
|
+
[](https://cursor.com/en/install-mcp?name=arcadia-finance&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBhcmNhZGlhLWZpbmFuY2UvbWNwLXNlcnZlciJdfQ==)
|
|
17
|
+
|
|
7
18
|
## Tools
|
|
8
19
|
|
|
9
20
|
### Read Tools
|
|
@@ -132,6 +143,12 @@ yarn build
|
|
|
132
143
|
}
|
|
133
144
|
```
|
|
134
145
|
|
|
146
|
+
**Claude Code:**
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
claude mcp add arcadia-finance -- npx -y @arcadia-finance/mcp-server
|
|
150
|
+
```
|
|
151
|
+
|
|
135
152
|
**From source** (local development):
|
|
136
153
|
|
|
137
154
|
```json
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ const pkg = require("../package.json");
|
|
|
19
19
|
const server = new McpServer({
|
|
20
20
|
name: "arcadia-finance",
|
|
21
21
|
version: pkg.version,
|
|
22
|
-
description: "Arcadia Finance
|
|
22
|
+
description: "Arcadia Finance. Manage concentrated liquidity positions with leverage, automated rebalancing, and yield optimization on Base, Optimism, and Unichain.",
|
|
23
23
|
});
|
|
24
24
|
const apiClient = new ArcadiaApiClient();
|
|
25
25
|
const chainConfigs = getChainConfigs();
|
|
@@ -2,6 +2,39 @@ import { z } from "zod";
|
|
|
2
2
|
import { accountAbi } from "../../abis/index.js";
|
|
3
3
|
import { getPublicClient } from "../../clients/chain.js";
|
|
4
4
|
import { ASSET_MANAGERS } from "../../config/addresses.js";
|
|
5
|
+
function trimOverview(overview) {
|
|
6
|
+
const trimmed = { ...overview };
|
|
7
|
+
if (Array.isArray(trimmed.historic_actions)) {
|
|
8
|
+
trimmed.historic_actions_count = trimmed.historic_actions.length;
|
|
9
|
+
delete trimmed.historic_actions;
|
|
10
|
+
}
|
|
11
|
+
if (Array.isArray(trimmed.assets)) {
|
|
12
|
+
trimmed.assets = trimmed.assets.map((a) => {
|
|
13
|
+
const { related_strategies, asset_details: _ad, ...rest } = a;
|
|
14
|
+
const asset = { ...rest };
|
|
15
|
+
if (Array.isArray(related_strategies) && related_strategies.length > 0) {
|
|
16
|
+
asset.strategy_count = related_strategies.length;
|
|
17
|
+
}
|
|
18
|
+
return asset;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
delete trimmed.total_value_spot;
|
|
22
|
+
delete trimmed.total_value_spot_usd;
|
|
23
|
+
delete trimmed.net_numeraire_spot;
|
|
24
|
+
delete trimmed.debt_numeraire_spot;
|
|
25
|
+
delete trimmed.debt_usd_spot;
|
|
26
|
+
if (trimmed.health_factor === 1) {
|
|
27
|
+
delete trimmed.maintenance_margin;
|
|
28
|
+
delete trimmed.maintenance_margin_usd;
|
|
29
|
+
delete trimmed.collateral_value_account;
|
|
30
|
+
delete trimmed.collateral_value_account_usd;
|
|
31
|
+
delete trimmed.liquidation_value_account;
|
|
32
|
+
delete trimmed.liquidation_value_account_usd;
|
|
33
|
+
delete trimmed.used_margin;
|
|
34
|
+
delete trimmed.used_margin_usd;
|
|
35
|
+
}
|
|
36
|
+
return trimmed;
|
|
37
|
+
}
|
|
5
38
|
export function registerAccountTools(server, api, chains) {
|
|
6
39
|
server.registerTool("get_account_info", {
|
|
7
40
|
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).",
|
|
@@ -128,7 +161,7 @@ export function registerAccountTools(server, api, chains) {
|
|
|
128
161
|
}
|
|
129
162
|
const result = {
|
|
130
163
|
account_version: accountVersion,
|
|
131
|
-
overview,
|
|
164
|
+
overview: overview ? trimOverview(overview) : null,
|
|
132
165
|
liquidation_price,
|
|
133
166
|
};
|
|
134
167
|
if (automation)
|
|
@@ -208,7 +241,16 @@ export function registerAccountTools(server, api, chains) {
|
|
|
208
241
|
api.getPnlCostBasis(chain_id, account_address),
|
|
209
242
|
api.getYieldEarned(chain_id, account_address),
|
|
210
243
|
]);
|
|
211
|
-
const { direct_deposits: _, ...pnl } = pnlRaw;
|
|
244
|
+
const { direct_deposits: _, flashaction_deposits, flashaction_withdrawals, direct_withdrawals, yield_withdrawals, ...pnl } = pnlRaw;
|
|
245
|
+
if (Array.isArray(flashaction_deposits) && flashaction_deposits.length > 0)
|
|
246
|
+
pnl.flashaction_deposit_count = flashaction_deposits.length;
|
|
247
|
+
if (Array.isArray(flashaction_withdrawals) && flashaction_withdrawals.length > 0)
|
|
248
|
+
pnl.flashaction_withdrawal_count =
|
|
249
|
+
flashaction_withdrawals.length;
|
|
250
|
+
if (Array.isArray(direct_withdrawals) && direct_withdrawals.length > 0)
|
|
251
|
+
pnl.direct_withdrawal_count = direct_withdrawals.length;
|
|
252
|
+
if (Array.isArray(yield_withdrawals) && yield_withdrawals.length > 0)
|
|
253
|
+
pnl.yield_withdrawal_count = yield_withdrawals.length;
|
|
212
254
|
const { daily_yields: _dy, daily_yields_usd: _dyu, ...yieldData } = yieldRaw;
|
|
213
255
|
return {
|
|
214
256
|
content: [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcadia-finance/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "MCP server for Arcadia Finance
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "MCP server for Arcadia Finance. Manage concentrated liquidity positions with leverage, automated rebalancing, and yield optimization on Base, Optimism, and Unichain.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
7
7
|
"packageManager": "yarn@4.13.0",
|
|
@@ -18,12 +18,11 @@
|
|
|
18
18
|
"clamm",
|
|
19
19
|
"liquidity",
|
|
20
20
|
"base",
|
|
21
|
-
"optimism"
|
|
21
|
+
"optimism",
|
|
22
|
+
"unichain"
|
|
22
23
|
],
|
|
23
24
|
"files": [
|
|
24
25
|
"dist",
|
|
25
|
-
"!dist/**/*.d.ts",
|
|
26
|
-
"!dist/**/*.js.map",
|
|
27
26
|
"skills",
|
|
28
27
|
"README.md",
|
|
29
28
|
"LICENSE.md"
|