@rackspay/wallet-mcp 1.0.0 → 1.0.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/README.md +134 -0
- package/build/index.js +81 -1
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# @rackspay/wallet-mcp
|
|
2
|
+
|
|
3
|
+
Crypto-native trading and betting infrastructure for AI agents via Model Context Protocol.
|
|
4
|
+
|
|
5
|
+
Trade perpetuals on Hyperliquid, place prediction market bets on Polymarket, and check on-chain balances — all from Claude Desktop or any MCP-compatible client.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Quick Start
|
|
10
|
+
|
|
11
|
+
### 1. Get Your API Key
|
|
12
|
+
|
|
13
|
+
Sign up at [wallet.rackspay.com](https://wallet.rackspay.com), create an agent, and copy your API key from the agent page.
|
|
14
|
+
|
|
15
|
+
### 2. Configure Claude Desktop
|
|
16
|
+
|
|
17
|
+
Edit `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS or `%APPDATA%\Claude\claude_desktop_config.json` on Windows:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"racks-wallet": {
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["@rackspay/wallet-mcp", "--api-key", "YOUR_API_KEY"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Restart Claude Desktop. RACKS tools will appear in the tools menu.
|
|
31
|
+
|
|
32
|
+
### 3. Try It
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
What's my wallet balance?
|
|
36
|
+
```
|
|
37
|
+
```
|
|
38
|
+
Go long 0.1 ETH on Hyperliquid at market price
|
|
39
|
+
```
|
|
40
|
+
```
|
|
41
|
+
Find a Polymarket market on the US election and bet $20 on the leading outcome
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Available Tools
|
|
47
|
+
|
|
48
|
+
| Tool | Description |
|
|
49
|
+
|---|---|
|
|
50
|
+
| `racks_get_status` | Agent name, wallet addresses, capabilities, and spend limits |
|
|
51
|
+
| `racks_get_wallet_balance` | USDC balance across Arbitrum, Polygon, and HyperCore |
|
|
52
|
+
| `racks_get_trade_account` | Full Hyperliquid account: margin, open positions, open orders |
|
|
53
|
+
| `racks_get_positions` | Open perp positions with unrealized PnL |
|
|
54
|
+
| `racks_place_order` | Place a limit or market order on Hyperliquid |
|
|
55
|
+
| `racks_cancel_order` | Cancel an open order by ID |
|
|
56
|
+
| `racks_get_markets` | Browse active Polymarket prediction markets |
|
|
57
|
+
| `racks_place_bet` | Place a bet on a Polymarket outcome |
|
|
58
|
+
| `racks_get_bet_positions` | Open Polymarket positions with current value |
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## How It Works
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Claude Desktop (MCP client)
|
|
66
|
+
↓ tool call: racks_place_order
|
|
67
|
+
@rackspay/wallet-mcp (this package)
|
|
68
|
+
↓ POST /api/v1/agent/trade/order
|
|
69
|
+
RACKS API (api.wallet.rackspay.com)
|
|
70
|
+
↓ EIP-712 signature via Privy
|
|
71
|
+
Hyperliquid (builder code attached)
|
|
72
|
+
↓ order filled
|
|
73
|
+
Claude receives confirmation → position open
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Every order is signed server-side using the agent's embedded Privy wallet. Builder codes are attached automatically. Every action is logged with a full audit trail visible in your dashboard.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Options
|
|
81
|
+
|
|
82
|
+
| Flag | Env var | Required | Description |
|
|
83
|
+
|---|---|---|---|
|
|
84
|
+
| `--api-key` | `RACKS_API_KEY` | Yes | Agent API key from the dashboard |
|
|
85
|
+
| — | `RACKS_API_URL` | No | Override API endpoint (default: `https://api.wallet.rackspay.com`) |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Capabilities
|
|
90
|
+
|
|
91
|
+
Agents have per-capability permissions set from the dashboard:
|
|
92
|
+
|
|
93
|
+
- **Trading** — required for Hyperliquid orders and positions
|
|
94
|
+
- **Betting** — required for Polymarket bets and positions
|
|
95
|
+
- **Spend limits** — daily and monthly USDC caps enforced server-side
|
|
96
|
+
|
|
97
|
+
Call `racks_get_status` to see what's enabled for your agent.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Development
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git clone https://github.com/racks-ai/wallet-mcp.git
|
|
105
|
+
cd wallet-mcp
|
|
106
|
+
npm install
|
|
107
|
+
|
|
108
|
+
# Run in dev mode
|
|
109
|
+
npm run dev -- --api-key YOUR_API_KEY
|
|
110
|
+
|
|
111
|
+
# Build
|
|
112
|
+
npm run build
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Also Available
|
|
118
|
+
|
|
119
|
+
- **[`@rackspay/mcp-server`](https://www.npmjs.com/package/@rackspay/mcp-server)** — fiat payments: issue virtual cards, manage budgets, view transactions
|
|
120
|
+
- **REST API** — direct integration via [api.wallet.rackspay.com/docs](https://api.wallet.rackspay.com/docs)
|
|
121
|
+
- **Python SDK** — coming Q2 2026
|
|
122
|
+
- **TypeScript SDK** — coming Q2 2026
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Links
|
|
127
|
+
|
|
128
|
+
- [Dashboard](https://wallet.rackspay.com)
|
|
129
|
+
- [Documentation](https://wallet.rackspay.com/docs)
|
|
130
|
+
- [MCP Protocol](https://modelcontextprotocol.io)
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
MIT — Racks AI, Inc.
|
package/build/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* "mcpServers": {
|
|
15
15
|
* "racks-wallet": {
|
|
16
16
|
* "command": "npx",
|
|
17
|
-
* "args": ["@
|
|
17
|
+
* "args": ["@rackspay/wallet-mcp", "--api-key", "rk_live_..."]
|
|
18
18
|
* }
|
|
19
19
|
* }
|
|
20
20
|
* }
|
|
@@ -164,6 +164,86 @@ server.tool("racks_get_wallet_balance", "Return this agent's USDC balance on eve
|
|
|
164
164
|
};
|
|
165
165
|
});
|
|
166
166
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
167
|
+
// Tool: racks_bridge_usdc
|
|
168
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
169
|
+
server.tool("racks_bridge_usdc", "Bridge USDC between chains using the Relay solver network. " +
|
|
170
|
+
"Gas is abstracted — no ETH needed on the destination chain. " +
|
|
171
|
+
"Supports Solana → Arbitrum, Arbitrum → Arbitrum, Polygon → Arbitrum. " +
|
|
172
|
+
"Use this to move funds into Arbitrum before depositing to HyperCore for trading. " +
|
|
173
|
+
"IMPORTANT: call racks_get_wallet_balance first to confirm source chain balance.", {
|
|
174
|
+
origin_chain: z
|
|
175
|
+
.enum(["solana", "arbitrum", "polygon"])
|
|
176
|
+
.describe("Chain to bridge FROM. Use 'solana' to bridge from the agent's Solana wallet"),
|
|
177
|
+
destination_chain: z
|
|
178
|
+
.enum(["arbitrum", "polygon"])
|
|
179
|
+
.describe("Chain to bridge TO. Use 'arbitrum' to fund HyperCore trading"),
|
|
180
|
+
amount_usdc: z
|
|
181
|
+
.number()
|
|
182
|
+
.positive()
|
|
183
|
+
.describe("Amount of USDC to bridge (e.g. 1.0 = $1.00). A small relayer fee is deducted from this amount"),
|
|
184
|
+
}, async ({ origin_chain, destination_chain, amount_usdc }) => {
|
|
185
|
+
const res = await request("POST", "/api/v1/agent/wallet/bridge", {
|
|
186
|
+
origin_chain,
|
|
187
|
+
destination_chain,
|
|
188
|
+
amount_usdc,
|
|
189
|
+
});
|
|
190
|
+
if (!res.ok)
|
|
191
|
+
return apiError(res, "Failed to bridge USDC");
|
|
192
|
+
const d = res.data;
|
|
193
|
+
return {
|
|
194
|
+
content: [
|
|
195
|
+
{
|
|
196
|
+
type: "text",
|
|
197
|
+
text: JSON.stringify({
|
|
198
|
+
success: true,
|
|
199
|
+
bridge: {
|
|
200
|
+
from: origin_chain,
|
|
201
|
+
to: destination_chain,
|
|
202
|
+
amount_usdc,
|
|
203
|
+
relayer_fee: d.relayer_fee_usdc,
|
|
204
|
+
expected_received: d.expected_output,
|
|
205
|
+
request_id: d.request_id,
|
|
206
|
+
},
|
|
207
|
+
steps: d.steps_executed,
|
|
208
|
+
note: `Funds arrive on ${destination_chain} in ~5-30 seconds. Then call racks_deposit_to_hypercore to fund trading.`,
|
|
209
|
+
status_url: d.status_endpoint,
|
|
210
|
+
}, null, 2),
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
};
|
|
214
|
+
});
|
|
215
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
216
|
+
// Tool: racks_deposit_to_hypercore
|
|
217
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
218
|
+
server.tool("racks_deposit_to_hypercore", "Move USDC from this agent's Arbitrum wallet into HyperCore (Hyperliquid's L1 trading account). " +
|
|
219
|
+
"This is required before placing any trades — Hyperliquid only accepts funds from Arbitrum. " +
|
|
220
|
+
"The agent signs two transactions via Privy: ERC-20 approve, then bridge deposit. " +
|
|
221
|
+
"IMPORTANT: call racks_get_wallet_balance first to confirm sufficient Arbitrum USDC.", {
|
|
222
|
+
amount_usdc: z
|
|
223
|
+
.number()
|
|
224
|
+
.positive()
|
|
225
|
+
.describe("Amount of USDC to deposit into HyperCore (e.g. 10.5 = $10.50)"),
|
|
226
|
+
}, async ({ amount_usdc }) => {
|
|
227
|
+
const res = await request("POST", "/api/v1/agent/wallet/deposit/hypercore", { amount_usdc });
|
|
228
|
+
if (!res.ok)
|
|
229
|
+
return apiError(res, "Failed to deposit to HyperCore");
|
|
230
|
+
const d = res.data;
|
|
231
|
+
return {
|
|
232
|
+
content: [
|
|
233
|
+
{
|
|
234
|
+
type: "text",
|
|
235
|
+
text: JSON.stringify({
|
|
236
|
+
success: true,
|
|
237
|
+
deposited_usdc: amount_usdc,
|
|
238
|
+
approve_tx: d.approve_tx,
|
|
239
|
+
deposit_tx: d.deposit_tx,
|
|
240
|
+
note: "Funds typically arrive in HyperCore within 1-2 minutes. Then call racks_get_trade_account to confirm.",
|
|
241
|
+
}, null, 2),
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
};
|
|
245
|
+
});
|
|
246
|
+
// ─────────────────────────────────────────────────────────────────────────────
|
|
167
247
|
// Tool: racks_get_trade_account
|
|
168
248
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
169
249
|
server.tool("racks_get_trade_account", "Fetch this agent's full Hyperliquid HyperCore account state: account value, margin, " +
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rackspay/wallet-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "RACKS Wallet MCP — crypto trading and betting infrastructure for AI agents. Trade perps on Hyperliquid, bet on Polymarket, and check on-chain balances via Claude Desktop or any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"
|
|
7
|
+
"rackswallet": "./build/index.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc && chmod 755 build/index.js",
|