@openclawcash/mcp-server 0.1.1 → 0.1.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 +5 -1
- package/openclawcash-mcp.mjs +47 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,6 +58,8 @@ Set one of these environment variables:
|
|
|
58
58
|
- `OPENCLAWCASH_AGENT_KEY`
|
|
59
59
|
- `AGENTWALLETAPI_KEY`
|
|
60
60
|
|
|
61
|
+
All MCP tools require an OpenClawCash agent key because they call the authenticated agent API, including read tools such as `swap_quote` and `supported_tokens_list`.
|
|
62
|
+
|
|
61
63
|
Optional base URL override:
|
|
62
64
|
|
|
63
65
|
- `OPENCLAWCASH_BASE_URL`
|
|
@@ -217,8 +219,10 @@ The MCP server itself does not hold approval memory. The MCP client or agent run
|
|
|
217
219
|
|
|
218
220
|
## Notes
|
|
219
221
|
|
|
220
|
-
- `swap_quote` is read-only.
|
|
222
|
+
- `swap_quote` is read-only, but still requires an agent key.
|
|
223
|
+
- `supported_tokens_list` is read-only, but still requires an agent key.
|
|
221
224
|
- `transfer_send`, `swap_execute`, `approve_token`, `wallet_create`, and `wallet_import` are write tools.
|
|
225
|
+
- For `wallet_get`, `transactions_list`, `supported_tokens_list`, and `swap_quote`, pass at most one wallet selector when using `walletId`, `walletLabel`, or `walletAddress`.
|
|
222
226
|
- The server uses stdio transport and is intended for MCP-compatible desktop or agent clients.
|
|
223
227
|
|
|
224
228
|
## Standalone Packaging Notes
|
package/openclawcash-mcp.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url";
|
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
|
|
9
9
|
const SERVER_NAME = "openclawcash";
|
|
10
|
-
const SERVER_VERSION = "0.1.
|
|
10
|
+
const SERVER_VERSION = "0.1.3";
|
|
11
11
|
const PROTOCOL_VERSION = "2024-11-05";
|
|
12
12
|
const DEFAULT_BASE_URL = "https://openclawcash.com";
|
|
13
13
|
|
|
@@ -130,13 +130,16 @@ const transferArgsSchema = walletSelectorBaseSchema
|
|
|
130
130
|
message: "Provide exactly one of amount or value.",
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
const swapQuoteArgsSchema =
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
})
|
|
133
|
+
const swapQuoteArgsSchema = walletSelectorBaseSchema
|
|
134
|
+
.extend({
|
|
135
|
+
network: z.string().min(1),
|
|
136
|
+
tokenIn: z.string().min(1),
|
|
137
|
+
tokenOut: z.string().min(1),
|
|
138
|
+
amountIn: z.string().min(1),
|
|
139
|
+
})
|
|
140
|
+
.refine((data) => [data.walletId, data.walletLabel, data.walletAddress].filter((value) => value !== undefined).length <= 1, {
|
|
141
|
+
message: selectorDescription(),
|
|
142
|
+
});
|
|
140
143
|
|
|
141
144
|
const swapExecuteArgsSchema = z
|
|
142
145
|
.object({
|
|
@@ -165,15 +168,20 @@ const approveArgsSchema = z
|
|
|
165
168
|
message: "Provide exactly one of walletId or walletAddress.",
|
|
166
169
|
});
|
|
167
170
|
|
|
168
|
-
const supportedTokensArgsSchema =
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
})
|
|
171
|
+
const supportedTokensArgsSchema = walletSelectorBaseSchema
|
|
172
|
+
.extend({
|
|
173
|
+
network: z.string().min(1).optional(),
|
|
174
|
+
})
|
|
175
|
+
.refine((data) => [data.walletId, data.walletLabel, data.walletAddress].filter((value) => value !== undefined).length <= 1, {
|
|
176
|
+
message: selectorDescription(),
|
|
177
|
+
});
|
|
172
178
|
|
|
173
179
|
const createWalletArgsSchema = z.object({
|
|
174
180
|
label: z.string().min(1),
|
|
175
181
|
network: z.enum(["sepolia", "mainnet", "solana-devnet", "solana-testnet", "solana-mainnet"]).optional(),
|
|
176
182
|
exportPassphrase: z.string().trim().min(12),
|
|
183
|
+
exportPassphraseStorageType: z.enum(["env", "secret_manager", "vault", "other"]),
|
|
184
|
+
exportPassphraseStorageRef: z.string().trim().min(3),
|
|
177
185
|
confirmExportPassphraseSaved: z.literal(true),
|
|
178
186
|
});
|
|
179
187
|
|
|
@@ -352,6 +360,9 @@ const tools = [
|
|
|
352
360
|
properties: {
|
|
353
361
|
network: { type: "string", description: "Example: mainnet, sepolia, solana-mainnet." },
|
|
354
362
|
chain: { type: "string", enum: ["evm", "solana"] },
|
|
363
|
+
walletId: { oneOf: [{ type: "integer" }, { type: "string" }], description: "Optional wallet selector for history-linked activity." },
|
|
364
|
+
walletLabel: { type: "string", description: "Optional wallet selector for history-linked activity." },
|
|
365
|
+
walletAddress: { type: "string", description: "Optional wallet selector for history-linked activity." },
|
|
355
366
|
},
|
|
356
367
|
additionalProperties: false,
|
|
357
368
|
},
|
|
@@ -361,7 +372,6 @@ const tools = [
|
|
|
361
372
|
method: "GET",
|
|
362
373
|
pathName: "/api/agent/supported-tokens",
|
|
363
374
|
query: args,
|
|
364
|
-
requireAuth: false,
|
|
365
375
|
}),
|
|
366
376
|
},
|
|
367
377
|
{
|
|
@@ -398,6 +408,9 @@ const tools = [
|
|
|
398
408
|
type: "object",
|
|
399
409
|
properties: {
|
|
400
410
|
network: { type: "string" },
|
|
411
|
+
walletId: { oneOf: [{ type: "integer" }, { type: "string" }], description: "Optional wallet selector for history-linked activity." },
|
|
412
|
+
walletLabel: { type: "string", description: "Optional wallet selector for history-linked activity." },
|
|
413
|
+
walletAddress: { type: "string", description: "Optional wallet selector for history-linked activity." },
|
|
401
414
|
tokenIn: { type: "string" },
|
|
402
415
|
tokenOut: { type: "string" },
|
|
403
416
|
amountIn: { type: "string" },
|
|
@@ -414,7 +427,6 @@ const tools = [
|
|
|
414
427
|
pathName: "/api/agent/quote",
|
|
415
428
|
query: { network },
|
|
416
429
|
body,
|
|
417
|
-
requireAuth: false,
|
|
418
430
|
});
|
|
419
431
|
},
|
|
420
432
|
},
|
|
@@ -479,12 +491,30 @@ const tools = [
|
|
|
479
491
|
enum: ["sepolia", "mainnet", "solana-devnet", "solana-testnet", "solana-mainnet"],
|
|
480
492
|
},
|
|
481
493
|
exportPassphrase: { type: "string", minLength: 12 },
|
|
494
|
+
exportPassphraseStorageType: { type: "string", enum: ["env", "secret_manager", "vault", "other"] },
|
|
495
|
+
exportPassphraseStorageRef: { type: "string", minLength: 3 },
|
|
482
496
|
confirmExportPassphraseSaved: { type: "boolean", const: true },
|
|
483
497
|
},
|
|
484
|
-
required: ["label", "exportPassphrase", "confirmExportPassphraseSaved"],
|
|
498
|
+
required: ["label", "exportPassphrase", "exportPassphraseStorageType", "exportPassphraseStorageRef", "confirmExportPassphraseSaved"],
|
|
485
499
|
additionalProperties: false,
|
|
486
500
|
},
|
|
487
|
-
parse: (args) =>
|
|
501
|
+
parse: (args) => {
|
|
502
|
+
const parsed = createWalletArgsSchema.parse(args ?? {});
|
|
503
|
+
if (parsed.exportPassphraseStorageType === "env") {
|
|
504
|
+
const envValue = process.env[parsed.exportPassphraseStorageRef];
|
|
505
|
+
if (!envValue) {
|
|
506
|
+
throw new Error(
|
|
507
|
+
`Missing env-backed wallet export passphrase. Set ${parsed.exportPassphraseStorageRef} before calling wallet_create.`,
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
if (envValue.trim() !== parsed.exportPassphrase) {
|
|
511
|
+
throw new Error(
|
|
512
|
+
`Env verification failed for wallet_create. ${parsed.exportPassphraseStorageRef} does not match exportPassphrase.`,
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return parsed;
|
|
517
|
+
},
|
|
488
518
|
execute: async (args) =>
|
|
489
519
|
callAgentApi({
|
|
490
520
|
method: "POST",
|
|
@@ -646,7 +676,7 @@ async function runSelfTest() {
|
|
|
646
676
|
capabilities: {},
|
|
647
677
|
clientInfo: {
|
|
648
678
|
name: "openclawcash-self-test",
|
|
649
|
-
version:
|
|
679
|
+
version: SERVER_VERSION,
|
|
650
680
|
},
|
|
651
681
|
},
|
|
652
682
|
};
|
package/package.json
CHANGED