@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/dist/index.js CHANGED
@@ -14,9 +14,18 @@
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 / ZERODUST_PRIVATE_KEY opt-in.
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.
18
25
  */
19
26
  import { createRequire } from "node:module";
27
+ import { realpathSync } from "node:fs";
28
+ import { pathToFileURL } from "node:url";
20
29
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
21
30
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
22
31
  import { z } from "zod";
@@ -53,7 +62,14 @@ async function apiRequest(path, options = {}) {
53
62
  }
54
63
  // ============ Tool: Get Supported Chains ============
55
64
  server.registerTool("zerodust_get_chains", {
56
- description: "Get a list of all blockchain chains supported by ZeroDust for sweeping native gas tokens. Returns chain IDs, names, native tokens, and contract addresses.",
65
+ description: "List the EVM chains a native gas balance can be emptied to exactly zero on. Returns " +
66
+ "chain IDs, names, and native tokens. Call this to check whether a specific chain is " +
67
+ "supported before quoting or sweeping.",
68
+ annotations: {
69
+ title: "List supported chains",
70
+ readOnlyHint: true,
71
+ openWorldHint: true,
72
+ },
57
73
  inputSchema: {},
58
74
  }, async () => {
59
75
  try {
@@ -85,7 +101,18 @@ server.registerTool("zerodust_get_chains", {
85
101
  });
86
102
  // ============ Tool: Get Balances ============
87
103
  server.registerTool("zerodust_get_balances", {
88
- description: "Check native gas token balances across all supported chains for a wallet address. Shows which chains have sweepable balances and their USD values.",
104
+ description: "Find leftover native gas token (ETH, BNB, POL, ...) stranded across every supported EVM " +
105
+ "chain for one address, and report which of it can be recovered. Normally these balances " +
106
+ "are unrecoverable: you cannot transfer 100% of a gas token, because paying for the " +
107
+ "transfer consumes the thing you are transferring, so a remainder is always left behind. " +
108
+ "This reports what is stuck and what could be moved out. Useful when a wallet has small " +
109
+ "amounts scattered over many chains, when someone cannot send their full balance, or " +
110
+ "before closing out, winding down or decommissioning a wallet.",
111
+ annotations: {
112
+ title: "Find stranded gas across chains",
113
+ readOnlyHint: true,
114
+ openWorldHint: true,
115
+ },
89
116
  inputSchema: {
90
117
  address: z
91
118
  .string()
@@ -131,7 +158,15 @@ server.registerTool("zerodust_get_balances", {
131
158
  });
132
159
  // ============ Tool: Get Quote ============
133
160
  server.registerTool("zerodust_get_quote", {
134
- description: "Get a quote for sweeping native gas tokens from one chain. Returns the estimated amount the user will receive, fee breakdown, and a quote ID for executing the sweep. Quotes expire in 60 seconds.",
161
+ description: "Price out emptying a chain's native gas balance to exactly zero: how much actually " +
162
+ "arrives, the full fee breakdown, and whether the balance is even large enough to be " +
163
+ "worth recovering. Call this before sweeping so the user sees the numbers first. Returns " +
164
+ "a quote ID; quotes expire after about 60 seconds.",
165
+ annotations: {
166
+ title: "Quote emptying a chain",
167
+ readOnlyHint: true,
168
+ openWorldHint: true,
169
+ },
135
170
  inputSchema: {
136
171
  fromChainId: z.number().int().positive().describe("Source chain ID to sweep from"),
137
172
  toChainId: z.number().int().positive().describe("Destination chain ID to receive funds"),
@@ -175,7 +210,14 @@ server.registerTool("zerodust_get_quote", {
175
210
  });
176
211
  // ============ Tool: Check Sweep Status ============
177
212
  server.registerTool("zerodust_get_sweep_status", {
178
- description: "Check the status of a previously submitted sweep. Returns the current status (pending, simulating, executing, bridging, completed, failed), transaction hash if available, and error messages if failed.",
213
+ description: "Check how a previously submitted sweep is progressing. Returns the current status " +
214
+ "(pending, simulating, executing, bridging, completed, failed), the transaction hash once " +
215
+ "there is one, and the error message if it failed.",
216
+ annotations: {
217
+ title: "Check sweep status",
218
+ readOnlyHint: true,
219
+ openWorldHint: true,
220
+ },
179
221
  inputSchema: {
180
222
  sweepId: z
181
223
  .string()
@@ -219,7 +261,13 @@ server.registerTool("zerodust_get_sweep_status", {
219
261
  });
220
262
  // ============ Tool: List Sweeps ============
221
263
  server.registerTool("zerodust_list_sweeps", {
222
- description: "List past sweeps for a wallet address. Shows sweep history with status and amounts.",
264
+ description: "List past sweeps for a wallet address, with status and amounts. Useful for confirming a " +
265
+ "chain was already emptied before trying again.",
266
+ annotations: {
267
+ title: "List past sweeps",
268
+ readOnlyHint: true,
269
+ openWorldHint: true,
270
+ },
223
271
  inputSchema: {
224
272
  address: z
225
273
  .string()
@@ -277,9 +325,91 @@ server.registerTool("zerodust_list_sweeps", {
277
325
  };
278
326
  }
279
327
  });
328
+ // ============ Tool: Register API Key ============
329
+ server.registerTool("zerodust_register_api_key", {
330
+ description: "Issue this agent its own ZeroDust API key for higher rate limits, with no human signup " +
331
+ "step. The read-only tools work without a key, so only call this when rate limits are " +
332
+ "actually being hit, or when setting up an unattended agent that will run repeatedly. " +
333
+ "The key is returned once and is not stored by this server - report it to the operator " +
334
+ "so they can set ZERODUST_API_KEY.",
335
+ annotations: {
336
+ title: "Get an API key for this agent",
337
+ readOnlyHint: false,
338
+ // Creates a credential, but destroys nothing and touches no funds.
339
+ destructiveHint: false,
340
+ idempotentHint: false,
341
+ openWorldHint: true,
342
+ },
343
+ inputSchema: {
344
+ name: z
345
+ .string()
346
+ .min(3)
347
+ .max(100)
348
+ .describe("Human-readable name for this agent, e.g. 'arbitrage-bot-prod'"),
349
+ agentId: z
350
+ .string()
351
+ .max(255)
352
+ .optional()
353
+ .describe("Stable unique identifier for this agent, if it has one"),
354
+ contactEmail: z
355
+ .string()
356
+ .email()
357
+ .optional()
358
+ .describe("Contact email for support and abuse notices"),
359
+ },
360
+ }, async ({ name, agentId, contactEmail }) => {
361
+ try {
362
+ const body = { name };
363
+ if (agentId)
364
+ body.agentId = agentId;
365
+ if (contactEmail)
366
+ body.contactEmail = contactEmail;
367
+ const data = await apiRequest("/agent/register", { method: "POST", body });
368
+ return {
369
+ content: [
370
+ {
371
+ type: "text",
372
+ text: [
373
+ "API key issued. It is shown once and is not stored by this server.",
374
+ "",
375
+ ` ZERODUST_API_KEY=${data.apiKey}`,
376
+ "",
377
+ `Key type: ${data.keyType}`,
378
+ data.rateLimits
379
+ ? `Rate limits: ${data.rateLimits.perMinute}/minute, ${data.rateLimits.daily}/day`
380
+ : null,
381
+ "",
382
+ "Give this to the operator to add to the server environment. Treat it as a",
383
+ "secret: it raises rate limits, it does not authorise moving funds.",
384
+ ]
385
+ .filter(Boolean)
386
+ .join("\n"),
387
+ },
388
+ ],
389
+ };
390
+ }
391
+ catch (error) {
392
+ return {
393
+ content: [
394
+ {
395
+ type: "text",
396
+ text: `Error registering API key: ${error instanceof Error ? error.message : String(error)}`,
397
+ },
398
+ ],
399
+ isError: true,
400
+ };
401
+ }
402
+ });
280
403
  // ============ Tool: Service Info ============
281
404
  server.registerTool("zerodust_info", {
282
- description: "Get information about ZeroDust service, including what it does, fee structure, and how to use it. Use this tool when the user asks about ZeroDust or needs to understand the service.",
405
+ description: "Explain how a native gas balance can be emptied to exactly zero, what it costs, and how " +
406
+ "to set this server up to do it. Call this when asked how ZeroDust works, why a full " +
407
+ "balance normally cannot be sent, or what sweeping will cost.",
408
+ annotations: {
409
+ title: "How ZeroDust works",
410
+ readOnlyHint: true,
411
+ openWorldHint: false,
412
+ },
283
413
  inputSchema: {},
284
414
  }, async () => {
285
415
  return {
@@ -307,25 +437,50 @@ server.registerTool("zerodust_info", {
307
437
  " - Gas costs: Paid by relayer, reimbursed from swept amount",
308
438
  " - Users always receive the quoted amount or more",
309
439
  "",
310
- "Supported chains: 25+ EVM chains including Ethereum, Arbitrum, Base,",
311
- " Optimism, Polygon, BSC, Gnosis, and more.",
440
+ "Supported chains:",
441
+ " 25 EVM chains with EIP-7702 support. Call zerodust_get_chains for the",
442
+ " authoritative live list rather than relying on any written-down count.",
312
443
  "",
313
444
  "Integration:",
314
445
  " - SDK: npm install @zerodust/sdk viem",
315
- " - API: POST /quote, POST /sweep, GET /sweep/:id/status",
316
- " - MCP: This server (stdio transport)",
446
+ " - API: GET /quote, POST /authorization, POST /sweep, GET /sweep/:id",
447
+ " - MCP: this server (stdio), or https://api.zerodust.xyz/mcp (no install)",
448
+ "",
449
+ "Trying it safely:",
450
+ " Every sweep tool accepts dryRun=true. That fetches a real quote and",
451
+ " produces the real signatures, then stops before submitting, so an",
452
+ " integration can be proven end to end without moving any funds.",
317
453
  "",
318
454
  "Sweeping from this MCP server:",
319
455
  " The zerodust_sweep and zerodust_sweep_all tools are always listed, but",
320
- " refuse to move funds unless both ZERODUST_PRIVATE_KEY and",
321
- " ZERODUST_ALLOW_EXECUTE=true are set. Funds may only be sent to the",
322
- " agent's own address unless ZERODUST_ALLOWED_DESTINATIONS lists more.",
456
+ " refuse to move funds unless ZERODUST_ALLOW_EXECUTE=true and a signing",
457
+ " key are both configured. A key may be supplied four ways:",
458
+ " ZERODUST_SIGNER_MODULE module returning a viem LocalAccount,",
459
+ " which is how Turnkey, Privy and KMS are used",
460
+ " ZERODUST_KEYSTORE_FILE encrypted V3 keystore + password file",
461
+ " ZERODUST_PRIVATE_KEY_FILE hex key in a file, not in the config",
462
+ " ZERODUST_PRIVATE_KEY hex key inline",
463
+ " Funds may only be sent to the agent's own address unless",
464
+ " ZERODUST_ALLOWED_DESTINATIONS lists more.",
465
+ "",
466
+ "Rate limits:",
467
+ " The read-only tools work with no credential at all. For higher limits an",
468
+ " agent can issue itself an API key with zerodust_register_api_key, with no",
469
+ " human signup step, then pass it as ZERODUST_API_KEY.",
323
470
  ].join("\n"),
324
471
  },
325
472
  ],
326
473
  };
327
474
  });
328
475
  // ============ Start Server ============
476
+ /**
477
+ * The server instance with every read-only tool registered.
478
+ *
479
+ * Exported so tests can attach the execution tools and introspect the real tool
480
+ * surface over an in-memory transport, rather than asserting against a copy of
481
+ * the tool list that could drift from what agents actually see.
482
+ */
483
+ export { server };
329
484
  async function main() {
330
485
  const executeConfig = readExecuteConfig();
331
486
  // Registered unconditionally: when executeConfig is null the sweep tools are
@@ -335,11 +490,40 @@ async function main() {
335
490
  const transport = new StdioServerTransport();
336
491
  await server.connect(transport);
337
492
  console.error(executeConfig
338
- ? "ZeroDust MCP Server running on stdio (sweep execution ENABLED)"
339
- : "ZeroDust MCP Server running on stdio (sweep tools listed but DISABLED; set ZERODUST_ALLOW_EXECUTE=true and ZERODUST_PRIVATE_KEY to enable)");
493
+ ? `ZeroDust MCP Server running on stdio (sweep execution ENABLED via ${executeConfig.signer.description})`
494
+ : "ZeroDust MCP Server running on stdio (sweep tools listed but DISABLED; set " +
495
+ "ZERODUST_ALLOW_EXECUTE=true plus one of ZERODUST_SIGNER_MODULE, " +
496
+ "ZERODUST_KEYSTORE_FILE, ZERODUST_PRIVATE_KEY_FILE or ZERODUST_PRIVATE_KEY to enable)");
497
+ }
498
+ /**
499
+ * True when this module is the process entry point rather than an import.
500
+ *
501
+ * The realpath resolution is load-bearing, not defensive. npm installs a `bin`
502
+ * as a **symlink** (`node_modules/.bin/zerodust-mcp` ->
503
+ * `../@zerodust/mcp-server/dist/index.js`), so `process.argv[1]` is the symlink
504
+ * path while `import.meta.url` is the resolved target. Comparing them raw makes
505
+ * this false for every real invocation — `npx @zerodust/mcp-server` and every
506
+ * MCP client — and the server silently never starts. Version 0.3.0 shipped
507
+ * exactly that bug.
508
+ */
509
+ function isEntryPoint() {
510
+ const entry = process.argv[1];
511
+ if (entry === undefined)
512
+ return false;
513
+ try {
514
+ return import.meta.url === pathToFileURL(realpathSync(entry)).href;
515
+ }
516
+ catch {
517
+ // argv[1] may not exist on disk (some runners pass a virtual path). Falling
518
+ // back to the unresolved comparison is still better than crashing.
519
+ return import.meta.url === pathToFileURL(entry).href;
520
+ }
521
+ }
522
+ // Importing this module — which the tests do — must not take over stdio.
523
+ if (isEntryPoint()) {
524
+ main().catch((error) => {
525
+ console.error("Fatal error:", error);
526
+ process.exit(1);
527
+ });
340
528
  }
341
- main().catch((error) => {
342
- console.error("Fatal error:", error);
343
- process.exit(1);
344
- });
345
529
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEvE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,0BAA0B,CAAC;AAC5E,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;AAE7C,6EAA6E;AAC7E,4EAA4E;AAC5E,uCAAuC;AACvC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAE5E,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,8BAA8B;AAC9B,KAAK,UAAU,UAAU,CACvB,IAAY,EACZ,UAA+C,EAAE;IAEjD,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;QAClC,YAAY,EAAE,2BAA2B;KAC1C,CAAC;IACF,IAAI,O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,6EAA6E;IAC7E,4EAA4E;IAC5E,0EAA0E;IAC1E,oBAAoB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAE5C,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CACX,aAAa;QACX,CAAC,CAAC,qEAAqE,aAAa,CAAC,MAAM,CAAC,WAAW,GAAG;QAC1G,CAAC,CAAC,6EAA6E;YAC3E,kEAAkE;YAClE,sFAAsF,CAC7F,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,YAAY;IACnB,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAEtC,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,4EAA4E;QAC5E,mEAAmE;QACnE,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;IACvD,CAAC;AACH,CAAC;AAED,yEAAyE;AACzE,IAAI,YAAY,EAAE,EAAE,CAAC;IACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @fileoverview Signer resolution for the ZeroDust MCP server
3
+ *
4
+ * Sweeping requires a key that can produce an EIP-712 signature and two
5
+ * EIP-7702 authorizations. The original server accepted exactly one form of
6
+ * that key: a raw hex private key in an environment variable, which in practice
7
+ * means pasting a hot key into an MCP client's JSON config. Operators running
8
+ * agents with real balances decline to do that, which is precisely the
9
+ * population with the most stranded gas.
10
+ *
11
+ * So there are four ways in, in descending order of precedence:
12
+ *
13
+ * ZERODUST_SIGNER_MODULE a module that returns a viem LocalAccount
14
+ * ZERODUST_KEYSTORE_FILE an encrypted V3 keystore + password
15
+ * ZERODUST_PRIVATE_KEY_FILE a file containing a hex key
16
+ * ZERODUST_PRIVATE_KEY a hex key inline (unchanged, still supported)
17
+ *
18
+ * The module hook is the important one. Rather than depending on Turnkey,
19
+ * Privy, AWS KMS and every future custody vendor, this server loads any module
20
+ * that hands back a viem `LocalAccount` — which every one of those vendors
21
+ * already knows how to produce. ZeroDust stays out of the custody business and
22
+ * the integration surface stops growing.
23
+ */
24
+ import { type LocalAccount } from "viem";
25
+ /** How the signing key was supplied, for diagnostics and the address tool. */
26
+ export type SignerKind = "module" | "keystore" | "key-file" | "key-env";
27
+ export interface SignerSource {
28
+ kind: SignerKind;
29
+ /** Human-readable origin, safe to show an agent. Never contains key material. */
30
+ description: string;
31
+ /** Resolves the account. Called at most once per process. */
32
+ load: () => Promise<LocalAccount>;
33
+ }
34
+ /** True when any signer variable is present, used to detect a partial setup. */
35
+ export declare function hasSignerEnv(env: NodeJS.ProcessEnv): boolean;
36
+ /**
37
+ * Picks the signer source from the environment.
38
+ *
39
+ * @returns the source, or null when no signer variable is set
40
+ * @throws when more than one is set, or when the chosen one is incomplete
41
+ */
42
+ export declare function resolveSignerSource(env?: NodeJS.ProcessEnv): SignerSource | null;
43
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAYH,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,MAAM,CAAC;AAkC9D,8EAA8E;AAC9E,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;AAExE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,UAAU,CAAC;IACjB,iFAAiF;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,IAAI,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC;CACnC;AAUD,gFAAgF;AAChF,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,YAAY,GAAG,IAAI,CAuB7F"}