@zerodust/mcp-server 0.2.2 → 0.3.1
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 +110 -15
- package/dist/execute.d.ts +10 -4
- package/dist/execute.d.ts.map +1 -1
- package/dist/execute.js +132 -36
- package/dist/execute.js.map +1 -1
- package/dist/index.d.ts +18 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +204 -20
- package/dist/index.js.map +1 -1
- package/dist/signer.d.ts +43 -0
- package/dist/signer.d.ts.map +1 -0
- package/dist/signer.js +270 -0
- package/dist/signer.js.map +1 -0
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -53,9 +53,18 @@ Add to your `.claude/settings.json`:
|
|
|
53
53
|
| `ZERODUST_API_URL` | Custom API URL | `https://api.zerodust.xyz` |
|
|
54
54
|
| `ZERODUST_API_KEY` | API key for higher rate limits | - |
|
|
55
55
|
| `ZERODUST_ALLOW_EXECUTE` | Set to `true` to enable sweeping | `false` |
|
|
56
|
-
| `ZERODUST_PRIVATE_KEY` | Signing key for the agent's wallet | - |
|
|
57
56
|
| `ZERODUST_ALLOWED_DESTINATIONS` | Comma-separated destination allowlist | own address only |
|
|
58
57
|
|
|
58
|
+
Signing keys have their own section below — there are four ways to supply one,
|
|
59
|
+
and exactly one may be set at a time.
|
|
60
|
+
|
|
61
|
+
| Variable | Description |
|
|
62
|
+
|----------|-------------|
|
|
63
|
+
| `ZERODUST_SIGNER_MODULE` | Module returning a viem `LocalAccount` (Turnkey, Privy, KMS, ...) |
|
|
64
|
+
| `ZERODUST_KEYSTORE_FILE` | Encrypted V3 keystore, with `ZERODUST_KEYSTORE_PASSWORD_FILE` or `ZERODUST_KEYSTORE_PASSWORD` |
|
|
65
|
+
| `ZERODUST_PRIVATE_KEY_FILE` | File containing a hex private key |
|
|
66
|
+
| `ZERODUST_PRIVATE_KEY` | Hex private key inline |
|
|
67
|
+
|
|
59
68
|
## Available Tools
|
|
60
69
|
|
|
61
70
|
Read-only by default:
|
|
@@ -68,6 +77,7 @@ Read-only by default:
|
|
|
68
77
|
| `zerodust_get_quote` | Get a quote for sweeping a chain |
|
|
69
78
|
| `zerodust_get_sweep_status` | Check status of a submitted sweep |
|
|
70
79
|
| `zerodust_list_sweeps` | List past sweeps for an address |
|
|
80
|
+
| `zerodust_register_api_key` | Issue this agent its own API key, no human signup |
|
|
71
81
|
|
|
72
82
|
Added when execution is enabled (see below):
|
|
73
83
|
|
|
@@ -77,27 +87,91 @@ Added when execution is enabled (see below):
|
|
|
77
87
|
| `zerodust_sweep` | Sweep one chain to exactly zero |
|
|
78
88
|
| `zerodust_sweep_all` | Sweep every chain with a balance to one destination |
|
|
79
89
|
|
|
90
|
+
## Try it without moving funds
|
|
91
|
+
|
|
92
|
+
Every sweep tool accepts `dryRun`. It fetches a real quote, requests the real
|
|
93
|
+
EIP-712 typed data, and produces all three real signatures with your key, then
|
|
94
|
+
stops before submitting. Nothing is broadcast and no balance changes.
|
|
95
|
+
|
|
96
|
+
> "Do a dry run of sweeping my Arbitrum balance to Base"
|
|
97
|
+
|
|
98
|
+
Use this first. It exercises the entire path an actual sweep takes — key
|
|
99
|
+
handling, chain support, fee limits, signature construction — so anything
|
|
100
|
+
misconfigured surfaces while your funds are still where they were.
|
|
101
|
+
|
|
102
|
+
There is deliberately no testnet mode: the ZeroDust API currently serves no
|
|
103
|
+
testnet chains, so a testnet flag would only produce empty chain lists and
|
|
104
|
+
failing quotes. `dryRun` gives you the same confidence against production.
|
|
105
|
+
|
|
80
106
|
## Enabling sweeps
|
|
81
107
|
|
|
82
|
-
Sweeping moves real funds, so it is off unless you turn it on. Set
|
|
108
|
+
Sweeping moves real funds, so it is off unless you turn it on. Set
|
|
109
|
+
`ZERODUST_ALLOW_EXECUTE=true` **and** exactly one signing key.
|
|
110
|
+
|
|
111
|
+
Whichever you choose, the key is used locally to sign an EIP-7702 authorization
|
|
112
|
+
and an EIP-712 sweep intent. It is never transmitted — only signatures reach the
|
|
113
|
+
ZeroDust API.
|
|
114
|
+
|
|
115
|
+
### Option 1: a signer module (recommended for production)
|
|
116
|
+
|
|
117
|
+
Point ZeroDust at a module that returns a viem `LocalAccount`. This is how you
|
|
118
|
+
use Turnkey, Privy, AWS KMS, or any other custody service: ZeroDust never sees a
|
|
119
|
+
raw key, and it does not need to know which vendor you use.
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
// my-signer.mjs
|
|
123
|
+
export default async function createAccount() {
|
|
124
|
+
// Build a viem LocalAccount however your custody provider prefers.
|
|
125
|
+
// Any account that can sign EIP-712 typed data and EIP-7702
|
|
126
|
+
// authorizations works.
|
|
127
|
+
return await myProvider.toViemAccount();
|
|
128
|
+
}
|
|
129
|
+
```
|
|
83
130
|
|
|
84
131
|
```json
|
|
85
|
-
{
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
132
|
+
"env": {
|
|
133
|
+
"ZERODUST_ALLOW_EXECUTE": "true",
|
|
134
|
+
"ZERODUST_SIGNER_MODULE": "./my-signer.mjs"
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
The module is validated when it loads: if the account it returns cannot sign an
|
|
139
|
+
EIP-7702 authorization, the server says so immediately rather than failing part
|
|
140
|
+
way through a sweep.
|
|
141
|
+
|
|
142
|
+
### Option 2: an encrypted keystore
|
|
143
|
+
|
|
144
|
+
The V3 keystore format produced by `cast wallet import` and geth. Keep the
|
|
145
|
+
password in a file so neither the key nor the password lives in your MCP config.
|
|
146
|
+
|
|
147
|
+
```json
|
|
148
|
+
"env": {
|
|
149
|
+
"ZERODUST_ALLOW_EXECUTE": "true",
|
|
150
|
+
"ZERODUST_KEYSTORE_FILE": "./agent-keystore.json",
|
|
151
|
+
"ZERODUST_KEYSTORE_PASSWORD_FILE": "./agent-keystore.pass"
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Option 3: a key file
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
"env": {
|
|
159
|
+
"ZERODUST_ALLOW_EXECUTE": "true",
|
|
160
|
+
"ZERODUST_PRIVATE_KEY_FILE": "./agent.key"
|
|
96
161
|
}
|
|
97
162
|
```
|
|
98
163
|
|
|
99
|
-
|
|
100
|
-
|
|
164
|
+
### Option 4: an inline key
|
|
165
|
+
|
|
166
|
+
Simplest, and the least private — the key sits in a config file you may well
|
|
167
|
+
commit. Fine for a throwaway wallet, not for one holding anything you care about.
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
"env": {
|
|
171
|
+
"ZERODUST_ALLOW_EXECUTE": "true",
|
|
172
|
+
"ZERODUST_PRIVATE_KEY": "0x..."
|
|
173
|
+
}
|
|
174
|
+
```
|
|
101
175
|
|
|
102
176
|
### Destination allowlist
|
|
103
177
|
|
|
@@ -125,9 +199,30 @@ Once configured, you can ask Claude:
|
|
|
125
199
|
|
|
126
200
|
With execution enabled:
|
|
127
201
|
|
|
202
|
+
- "Do a dry run of sweeping my Arbitrum balance to Base" (moves nothing)
|
|
128
203
|
- "Sweep my Arbitrum balance to Base"
|
|
129
204
|
- "Exit every chain and consolidate everything on Base"
|
|
130
205
|
|
|
206
|
+
## No install: the hosted server
|
|
207
|
+
|
|
208
|
+
If you only need the read-only tools, there is nothing to install. Connect to
|
|
209
|
+
the hosted server by URL:
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
https://api.zerodust.xyz/mcp
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
It exposes the same tool names as this package. Sweeping is not available there,
|
|
216
|
+
because sweeping needs a key and the hosted server does not have yours.
|
|
217
|
+
|
|
218
|
+
## Development
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
npm install
|
|
222
|
+
npm test # unit tests
|
|
223
|
+
npm run build
|
|
224
|
+
```
|
|
225
|
+
|
|
131
226
|
## License
|
|
132
227
|
|
|
133
228
|
MIT
|
package/dist/execute.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* This module adds the tools that actually perform a sweep, which requires a
|
|
6
6
|
* signing key and is therefore opt-in.
|
|
7
7
|
*
|
|
8
|
-
* Execution is disabled unless BOTH of these are
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Execution is disabled unless BOTH of these are true:
|
|
9
|
+
* ZERODUST_ALLOW_EXECUTE=true - explicit acknowledgement that funds can move
|
|
10
|
+
* a signing key is configured - see signer.ts for the four accepted forms
|
|
11
11
|
*
|
|
12
12
|
* Optional:
|
|
13
13
|
* ZERODUST_ALLOWED_DESTINATIONS - comma-separated address allowlist.
|
|
@@ -16,11 +16,17 @@
|
|
|
16
16
|
* The allowlist is the main defence against prompt injection: an agent that is
|
|
17
17
|
* talked into sweeping somewhere it shouldn't still cannot send funds to an
|
|
18
18
|
* address the operator never approved.
|
|
19
|
+
*
|
|
20
|
+
* Every sweep tool also accepts `dryRun`, which runs the whole flow and stops
|
|
21
|
+
* before submission. That exists because there is no testnet backend to point
|
|
22
|
+
* at, so without it the only way to evaluate ZeroDust is to move real money.
|
|
19
23
|
*/
|
|
20
24
|
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
25
|
+
import { type SignerSource } from "./signer.js";
|
|
21
26
|
/** Resolved execution configuration, or null when execution is not enabled. */
|
|
22
27
|
export interface ExecuteConfig {
|
|
23
|
-
|
|
28
|
+
/** Where the signing key comes from. Resolved lazily, on first use. */
|
|
29
|
+
signer: SignerSource;
|
|
24
30
|
/** Lowercased allowlist. Empty means "agent's own address only". */
|
|
25
31
|
allowedDestinations: string[];
|
|
26
32
|
}
|
package/dist/execute.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EAAqC,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAmBnF,+EAA+E;AAC/E,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,MAAM,EAAE,YAAY,CAAC;IACrB,oEAAoE;IACpE,mBAAmB,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,aAAa,GAAG,IAAI,CAwC5F;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,mBAAmB,EAAE,MAAM,EAAE,GAC5B,MAAM,GAAG,IAAI,CAgBf;AA2CD;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI,CAiO1F"}
|
package/dist/execute.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* This module adds the tools that actually perform a sweep, which requires a
|
|
6
6
|
* signing key and is therefore opt-in.
|
|
7
7
|
*
|
|
8
|
-
* Execution is disabled unless BOTH of these are
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* Execution is disabled unless BOTH of these are true:
|
|
9
|
+
* ZERODUST_ALLOW_EXECUTE=true - explicit acknowledgement that funds can move
|
|
10
|
+
* a signing key is configured - see signer.ts for the four accepted forms
|
|
11
11
|
*
|
|
12
12
|
* Optional:
|
|
13
13
|
* ZERODUST_ALLOWED_DESTINATIONS - comma-separated address allowlist.
|
|
@@ -16,10 +16,14 @@
|
|
|
16
16
|
* The allowlist is the main defence against prompt injection: an agent that is
|
|
17
17
|
* talked into sweeping somewhere it shouldn't still cannot send funds to an
|
|
18
18
|
* address the operator never approved.
|
|
19
|
+
*
|
|
20
|
+
* Every sweep tool also accepts `dryRun`, which runs the whole flow and stops
|
|
21
|
+
* before submission. That exists because there is no testnet backend to point
|
|
22
|
+
* at, so without it the only way to evaluate ZeroDust is to move real money.
|
|
19
23
|
*/
|
|
20
24
|
import { z } from "zod";
|
|
25
|
+
import { hasSignerEnv, resolveSignerSource } from "./signer.js";
|
|
21
26
|
const ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
22
|
-
const PRIVATE_KEY_RE = /^0x[a-fA-F0-9]{64}$/;
|
|
23
27
|
function text(body, isError = false) {
|
|
24
28
|
const result = { content: [{ type: "text", text: body }] };
|
|
25
29
|
if (isError)
|
|
@@ -37,21 +41,23 @@ function errorText(prefix, error) {
|
|
|
37
41
|
* because the agent discovers it only mid-task.
|
|
38
42
|
*/
|
|
39
43
|
export function readExecuteConfig(env = process.env) {
|
|
40
|
-
const privateKey = env.ZERODUST_PRIVATE_KEY?.trim();
|
|
41
44
|
const allowExecute = env.ZERODUST_ALLOW_EXECUTE?.trim() === "true";
|
|
42
|
-
|
|
45
|
+
const signerConfigured = hasSignerEnv(env);
|
|
46
|
+
if (!signerConfigured && !allowExecute)
|
|
43
47
|
return null;
|
|
44
48
|
if (!allowExecute) {
|
|
45
|
-
throw new Error("
|
|
49
|
+
throw new Error("A ZeroDust signing key is configured but ZERODUST_ALLOW_EXECUTE is not \"true\". " +
|
|
46
50
|
"Sweeping moves real funds, so it must be enabled explicitly.");
|
|
47
51
|
}
|
|
48
|
-
if (!
|
|
49
|
-
throw new Error("ZERODUST_ALLOW_EXECUTE is \"true\" but
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
if (!signerConfigured) {
|
|
53
|
+
throw new Error("ZERODUST_ALLOW_EXECUTE is \"true\" but no signing key is configured. Set exactly one of:\n" +
|
|
54
|
+
" ZERODUST_SIGNER_MODULE module returning a viem LocalAccount (Turnkey, Privy, KMS, ...)\n" +
|
|
55
|
+
" ZERODUST_KEYSTORE_FILE encrypted V3 keystore, with ZERODUST_KEYSTORE_PASSWORD_FILE\n" +
|
|
56
|
+
" ZERODUST_PRIVATE_KEY_FILE file containing a hex private key\n" +
|
|
57
|
+
" ZERODUST_PRIVATE_KEY hex private key inline");
|
|
54
58
|
}
|
|
59
|
+
// Throws on a partial or ambiguous signer setup.
|
|
60
|
+
const signer = resolveSignerSource(env);
|
|
55
61
|
const allowedDestinations = (env.ZERODUST_ALLOWED_DESTINATIONS ?? "")
|
|
56
62
|
.split(",")
|
|
57
63
|
.map((entry) => entry.trim())
|
|
@@ -62,7 +68,7 @@ export function readExecuteConfig(env = process.env) {
|
|
|
62
68
|
}
|
|
63
69
|
}
|
|
64
70
|
return {
|
|
65
|
-
|
|
71
|
+
signer,
|
|
66
72
|
allowedDestinations: allowedDestinations.map((entry) => entry.toLowerCase()),
|
|
67
73
|
};
|
|
68
74
|
}
|
|
@@ -85,18 +91,40 @@ export function checkDestination(destination, agentAddress, allowedDestinations)
|
|
|
85
91
|
`Permitted: ${agentAddress} (own address), ${allowedDestinations.join(", ")}.`);
|
|
86
92
|
}
|
|
87
93
|
/** Suffix appended to every sweep tool description so the gate is self-documenting. */
|
|
88
|
-
const GATE_NOTE = " Requires ZERODUST_ALLOW_EXECUTE=true
|
|
94
|
+
const GATE_NOTE = " Requires ZERODUST_ALLOW_EXECUTE=true plus a signing key; without them this tool returns an " +
|
|
95
|
+
"error and moves no funds. Pass dryRun=true to rehearse the whole flow without moving anything.";
|
|
89
96
|
const DISABLED_MESSAGE = [
|
|
90
97
|
"Sweep execution is disabled on this ZeroDust MCP server, so nothing was moved.",
|
|
91
98
|
"",
|
|
92
|
-
"To enable it, restart the server with
|
|
93
|
-
"
|
|
94
|
-
"
|
|
99
|
+
"To enable it, restart the server with ZERODUST_ALLOW_EXECUTE=true and exactly",
|
|
100
|
+
"one signing key:",
|
|
101
|
+
"",
|
|
102
|
+
" ZERODUST_SIGNER_MODULE=./my-signer.js",
|
|
103
|
+
" A module whose default export returns a viem LocalAccount. This is how",
|
|
104
|
+
" you use Turnkey, Privy, AWS KMS or any other custody service without",
|
|
105
|
+
" putting a raw key anywhere.",
|
|
106
|
+
"",
|
|
107
|
+
" ZERODUST_KEYSTORE_FILE=./agent-keystore.json",
|
|
108
|
+
" ZERODUST_KEYSTORE_PASSWORD_FILE=./agent-keystore.pass",
|
|
109
|
+
" An encrypted V3 keystore, as produced by `cast wallet import` or geth.",
|
|
110
|
+
"",
|
|
111
|
+
" ZERODUST_PRIVATE_KEY_FILE=./agent.key",
|
|
112
|
+
" A file containing a hex private key, so the key stays out of configs.",
|
|
113
|
+
"",
|
|
114
|
+
" ZERODUST_PRIVATE_KEY=0x...",
|
|
115
|
+
" A hex key inline. Simplest, and the least private of the four.",
|
|
95
116
|
"",
|
|
96
117
|
"Optionally set ZERODUST_ALLOWED_DESTINATIONS to permit sweeping to addresses",
|
|
97
118
|
"other than the agent's own. The read-only tools (balances, quotes, status)",
|
|
98
119
|
"work without any of this.",
|
|
99
120
|
].join("\n");
|
|
121
|
+
/** Shared shape of the dryRun parameter, so both sweep tools describe it identically. */
|
|
122
|
+
const dryRunSchema = z
|
|
123
|
+
.boolean()
|
|
124
|
+
.optional()
|
|
125
|
+
.describe("Rehearse without moving funds (default false). Fetches a real quote and produces " +
|
|
126
|
+
"the real signatures, then stops before submitting. Use this to prove the setup " +
|
|
127
|
+
"works before sweeping a real balance.");
|
|
100
128
|
/**
|
|
101
129
|
* Registers the sweep-execution tools on an MCP server.
|
|
102
130
|
*
|
|
@@ -108,19 +136,38 @@ const DISABLED_MESSAGE = [
|
|
|
108
136
|
* advertising the tool grants no capability.
|
|
109
137
|
*/
|
|
110
138
|
export function registerExecuteTools(server, config) {
|
|
111
|
-
// The agent is constructed lazily so a bad key
|
|
112
|
-
// clear message, rather than crashing the
|
|
139
|
+
// The agent is constructed lazily so a bad key or an unreachable remote
|
|
140
|
+
// signer surfaces on first use with a clear message, rather than crashing the
|
|
141
|
+
// whole server at startup.
|
|
113
142
|
let agentPromise = null;
|
|
114
143
|
async function getAgent(enabled) {
|
|
115
144
|
if (!agentPromise) {
|
|
116
|
-
agentPromise =
|
|
145
|
+
agentPromise = (async () => {
|
|
146
|
+
const [{ ZeroDustAgent }, account] = await Promise.all([
|
|
147
|
+
import("@zerodust/sdk"),
|
|
148
|
+
enabled.signer.load(),
|
|
149
|
+
]);
|
|
150
|
+
return new ZeroDustAgent({ account, environment: "mainnet" });
|
|
151
|
+
})();
|
|
152
|
+
// A failed load must not be cached, or a transient signer outage would
|
|
153
|
+
// wedge the server until restart.
|
|
154
|
+
agentPromise.catch(() => {
|
|
155
|
+
agentPromise = null;
|
|
156
|
+
});
|
|
117
157
|
}
|
|
118
158
|
return agentPromise;
|
|
119
159
|
}
|
|
120
160
|
const disabled = () => text(DISABLED_MESSAGE, true);
|
|
121
161
|
server.registerTool("zerodust_get_agent_address", {
|
|
122
|
-
description: "
|
|
162
|
+
description: "Show which wallet this ZeroDust server signs with, where its key comes from, and " +
|
|
163
|
+
"which destinations it is allowed to sweep to. Call this before any sweep to confirm " +
|
|
164
|
+
"the right wallet is about to be emptied." +
|
|
123
165
|
GATE_NOTE,
|
|
166
|
+
annotations: {
|
|
167
|
+
title: "Show the signing wallet",
|
|
168
|
+
readOnlyHint: true,
|
|
169
|
+
openWorldHint: false,
|
|
170
|
+
},
|
|
124
171
|
inputSchema: {},
|
|
125
172
|
}, async () => {
|
|
126
173
|
if (!config)
|
|
@@ -132,6 +179,7 @@ export function registerExecuteTools(server, config) {
|
|
|
132
179
|
: `own address, ${config.allowedDestinations.join(", ")}`;
|
|
133
180
|
return text([
|
|
134
181
|
`Agent address: ${agent.address}`,
|
|
182
|
+
`Signing key: ${config.signer.description}`,
|
|
135
183
|
`Execution: enabled`,
|
|
136
184
|
`Permitted destinations: ${allowed}`,
|
|
137
185
|
].join("\n"));
|
|
@@ -141,10 +189,22 @@ export function registerExecuteTools(server, config) {
|
|
|
141
189
|
}
|
|
142
190
|
});
|
|
143
191
|
server.registerTool("zerodust_sweep", {
|
|
144
|
-
description: "
|
|
192
|
+
description: "Empty one chain completely: move 100% of the native gas token off it and leave the " +
|
|
193
|
+
"balance at exactly zero. This is the operation an ordinary transfer cannot do, because " +
|
|
194
|
+
"sending the gas token requires keeping some gas token back to pay for the send. Use " +
|
|
195
|
+
"when the goal is to close out, wind down, decommission or fully exit a chain, or to " +
|
|
196
|
+
"recover a leftover or stranded balance that is too small to move normally. Moves real " +
|
|
197
|
+
"funds. Call zerodust_get_quote first to show the user what they will receive." +
|
|
145
198
|
GATE_NOTE,
|
|
199
|
+
annotations: {
|
|
200
|
+
title: "Empty a chain to exactly zero",
|
|
201
|
+
readOnlyHint: false,
|
|
202
|
+
destructiveHint: true,
|
|
203
|
+
idempotentHint: false,
|
|
204
|
+
openWorldHint: true,
|
|
205
|
+
},
|
|
146
206
|
inputSchema: {
|
|
147
|
-
fromChainId: z.number().int().positive().describe("Chain to
|
|
207
|
+
fromChainId: z.number().int().positive().describe("Chain to empty"),
|
|
148
208
|
toChainId: z
|
|
149
209
|
.number()
|
|
150
210
|
.int()
|
|
@@ -155,8 +215,9 @@ export function registerExecuteTools(server, config) {
|
|
|
155
215
|
.regex(ADDRESS_RE)
|
|
156
216
|
.optional()
|
|
157
217
|
.describe("Destination address (defaults to the agent's own address)"),
|
|
218
|
+
dryRun: dryRunSchema,
|
|
158
219
|
},
|
|
159
|
-
}, async ({ fromChainId, toChainId, destination }) => {
|
|
220
|
+
}, async ({ fromChainId, toChainId, destination, dryRun }) => {
|
|
160
221
|
if (!config)
|
|
161
222
|
return disabled();
|
|
162
223
|
try {
|
|
@@ -169,10 +230,26 @@ export function registerExecuteTools(server, config) {
|
|
|
169
230
|
fromChainId,
|
|
170
231
|
toChainId,
|
|
171
232
|
destination: target,
|
|
172
|
-
});
|
|
233
|
+
}, dryRun ? { dryRun: true } : {});
|
|
173
234
|
if (!result.success) {
|
|
174
235
|
return text(`Sweep failed: ${result.error ?? "unknown error"}`, true);
|
|
175
236
|
}
|
|
237
|
+
if (result.dryRun) {
|
|
238
|
+
return text([
|
|
239
|
+
`Dry run only - nothing was submitted and chain ${fromChainId} is untouched.`,
|
|
240
|
+
`Would send to: ${target} (chain ${toChainId})`,
|
|
241
|
+
result.quote
|
|
242
|
+
? `Current balance: ${result.quote.userBalance} wei`
|
|
243
|
+
: null,
|
|
244
|
+
result.quote
|
|
245
|
+
? `Would receive: ${result.quote.estimatedReceive} wei`
|
|
246
|
+
: null,
|
|
247
|
+
`Signatures produced: intent, delegation, revoke (all valid, none broadcast)`,
|
|
248
|
+
`Re-run without dryRun to execute for real.`,
|
|
249
|
+
]
|
|
250
|
+
.filter(Boolean)
|
|
251
|
+
.join("\n"));
|
|
252
|
+
}
|
|
176
253
|
const lines = [
|
|
177
254
|
`Sweep complete. Chain ${fromChainId} balance is now exactly zero.`,
|
|
178
255
|
`Sweep ID: ${result.sweepId}`,
|
|
@@ -187,8 +264,19 @@ export function registerExecuteTools(server, config) {
|
|
|
187
264
|
}
|
|
188
265
|
});
|
|
189
266
|
server.registerTool("zerodust_sweep_all", {
|
|
190
|
-
description: "
|
|
267
|
+
description: "Empty every chain that still holds a native gas balance, consolidating all of it onto " +
|
|
268
|
+
"one destination chain and leaving each source at exactly zero. Use when the goal is to " +
|
|
269
|
+
"clean up a wallet across chains, collect scattered leftover gas, or retire a wallet " +
|
|
270
|
+
"entirely. Moves real funds across multiple chains. Call zerodust_get_balances first to " +
|
|
271
|
+
"show the user what will be swept." +
|
|
191
272
|
GATE_NOTE,
|
|
273
|
+
annotations: {
|
|
274
|
+
title: "Empty every chain with a balance",
|
|
275
|
+
readOnlyHint: false,
|
|
276
|
+
destructiveHint: true,
|
|
277
|
+
idempotentHint: false,
|
|
278
|
+
openWorldHint: true,
|
|
279
|
+
},
|
|
192
280
|
inputSchema: {
|
|
193
281
|
toChainId: z
|
|
194
282
|
.number()
|
|
@@ -200,8 +288,9 @@ export function registerExecuteTools(server, config) {
|
|
|
200
288
|
.regex(ADDRESS_RE)
|
|
201
289
|
.optional()
|
|
202
290
|
.describe("Destination address (defaults to the agent's own address)"),
|
|
291
|
+
dryRun: dryRunSchema,
|
|
203
292
|
},
|
|
204
|
-
}, async ({ toChainId, destination }) => {
|
|
293
|
+
}, async ({ toChainId, destination, dryRun }) => {
|
|
205
294
|
if (!config)
|
|
206
295
|
return disabled();
|
|
207
296
|
try {
|
|
@@ -213,16 +302,23 @@ export function registerExecuteTools(server, config) {
|
|
|
213
302
|
const result = await agent.sweepAll({
|
|
214
303
|
toChainId,
|
|
215
304
|
destination: target,
|
|
216
|
-
});
|
|
305
|
+
}, dryRun ? { dryRun: true } : {});
|
|
217
306
|
const summary = result.results
|
|
218
|
-
.map((sweep) =>
|
|
219
|
-
|
|
220
|
-
|
|
307
|
+
.map((sweep) => {
|
|
308
|
+
if (!sweep.success) {
|
|
309
|
+
return ` chain ${sweep.fromChainId}: failed - ${sweep.error ?? "unknown error"}`;
|
|
310
|
+
}
|
|
311
|
+
if (sweep.dryRun) {
|
|
312
|
+
const receive = sweep.quote ? ` (would receive ${sweep.quote.estimatedReceive} wei)` : "";
|
|
313
|
+
return ` chain ${sweep.fromChainId}: would sweep${receive}`;
|
|
314
|
+
}
|
|
315
|
+
return ` chain ${sweep.fromChainId}: swept${sweep.txHash ? ` (${sweep.txHash})` : ""}`;
|
|
316
|
+
})
|
|
221
317
|
.join("\n");
|
|
222
|
-
|
|
223
|
-
`
|
|
224
|
-
|
|
225
|
-
]
|
|
318
|
+
const headline = dryRun
|
|
319
|
+
? `Dry run only - nothing was submitted. ${result.successful}/${result.total} chains would sweep to ${target} on chain ${toChainId}.`
|
|
320
|
+
: `Swept ${result.successful}/${result.total} chains to ${target} on chain ${toChainId}.`;
|
|
321
|
+
return text([headline, summary, dryRun ? "Re-run without dryRun to execute for real." : null]
|
|
226
322
|
.filter(Boolean)
|
|
227
323
|
.join("\n"));
|
|
228
324
|
}
|
package/dist/execute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../src/execute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAqB,MAAM,aAAa,CAAC;AAEnF,MAAM,UAAU,GAAG,qBAAqB,CAAC;AAOzC,SAAS,IAAI,CAAC,IAAY,EAAE,OAAO,GAAG,KAAK;IACzC,MAAM,MAAM,GAAe,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAChF,IAAI,OAAO;QAAE,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACnC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,SAAS,CAAC,MAAc,EAAE,KAAc;IAC/C,OAAO,IAAI,CAAC,GAAG,MAAM,KAAK,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;AAC5F,CAAC;AAUD;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACpE,MAAM,YAAY,GAAG,GAAG,CAAC,sBAAsB,EAAE,IAAI,EAAE,KAAK,MAAM,CAAC;IACnE,MAAM,gBAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAE3C,IAAI,CAAC,gBAAgB,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAEpD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,mFAAm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,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACzD,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,23 @@
|
|
|
14
14
|
* ZERODUST_API_KEY - Optional API key for higher rate limits
|
|
15
15
|
*
|
|
16
16
|
* Sweeping is read-only by default. To let an agent actually move funds, see
|
|
17
|
-
* `execute.ts` for the ZERODUST_ALLOW_EXECUTE
|
|
17
|
+
* `execute.ts` for the ZERODUST_ALLOW_EXECUTE opt-in and `signer.ts` for the
|
|
18
|
+
* four accepted ways to supply a signing key.
|
|
19
|
+
*
|
|
20
|
+
* Tool descriptions here lead with the problem rather than the product. An
|
|
21
|
+
* agent picks a tool by matching the user's words against a description, and
|
|
22
|
+
* "check balances" collides with every other balance tool in the client. What
|
|
23
|
+
* is actually distinctive is the impossibility ZeroDust removes: you cannot
|
|
24
|
+
* send 100% of a native gas token, because sending it costs it.
|
|
25
|
+
*/
|
|
26
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
27
|
+
declare const server: McpServer;
|
|
28
|
+
/**
|
|
29
|
+
* The server instance with every read-only tool registered.
|
|
30
|
+
*
|
|
31
|
+
* Exported so tests can attach the execution tools and introspect the real tool
|
|
32
|
+
* surface over an in-memory transport, rather than asserting against a copy of
|
|
33
|
+
* the tool list that could drift from what agents actually see.
|
|
18
34
|
*/
|
|
19
|
-
export {};
|
|
35
|
+
export { server };
|
|
20
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAepE,QAAA,MAAM,MAAM,WAGV,CAAC;AAkjBH;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|