@openclawcash/mcp-server 0.1.20 → 0.1.21
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/openclawcash-mcp.mjs +118 -2
- package/package.json +2 -2
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.21";
|
|
11
11
|
const PROTOCOL_VERSION = "2024-11-05";
|
|
12
12
|
const DEFAULT_BASE_URL = "https://openclawcash.com";
|
|
13
13
|
|
|
@@ -347,6 +347,43 @@ const polymarketMarketSearchArgsSchema = z.object({
|
|
|
347
347
|
limit: z.number().int().positive().max(50).optional(),
|
|
348
348
|
});
|
|
349
349
|
|
|
350
|
+
const yieldwolfCasinoLinkArgsSchema = z
|
|
351
|
+
.object({
|
|
352
|
+
walletId: z.union([z.number().int().positive(), z.string().min(1)]).optional(),
|
|
353
|
+
walletAddress: z.string().min(1).optional(),
|
|
354
|
+
agentName: z.string().min(1).max(64).optional(),
|
|
355
|
+
lane: z.enum(["real", "test"]).optional(),
|
|
356
|
+
})
|
|
357
|
+
.strict()
|
|
358
|
+
.refine((data) => [data.walletId, data.walletAddress].filter((v) => v !== undefined).length === 1, {
|
|
359
|
+
message: "Provide exactly one of walletId or walletAddress.",
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
const yieldwolfCasinoUnlinkArgsSchema = z
|
|
363
|
+
.object({
|
|
364
|
+
walletId: z.union([z.number().int().positive(), z.string().min(1)]).optional(),
|
|
365
|
+
walletAddress: z.string().min(1).optional(),
|
|
366
|
+
})
|
|
367
|
+
.strict()
|
|
368
|
+
.refine((data) => [data.walletId, data.walletAddress].filter((v) => v !== undefined).length === 1, {
|
|
369
|
+
message: "Provide exactly one of walletId or walletAddress.",
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
const yieldwolfCasinoCallArgsSchema = z
|
|
373
|
+
.object({
|
|
374
|
+
walletId: z.union([z.number().int().positive(), z.string().min(1)]).optional(),
|
|
375
|
+
walletAddress: z.string().min(1).optional(),
|
|
376
|
+
method: z.enum(["GET", "POST"]).optional(),
|
|
377
|
+
path: z.string().min(1),
|
|
378
|
+
body: z.unknown().optional(),
|
|
379
|
+
query: z.record(z.string()).optional(),
|
|
380
|
+
idempotencyKey: z.string().min(1).optional(),
|
|
381
|
+
})
|
|
382
|
+
.strict()
|
|
383
|
+
.refine((data) => [data.walletId, data.walletAddress].filter((v) => v !== undefined).length === 1, {
|
|
384
|
+
message: "Provide exactly one of walletId or walletAddress.",
|
|
385
|
+
});
|
|
386
|
+
|
|
350
387
|
const checkoutEscrowIdArgsSchema = z.object({
|
|
351
388
|
id: z.string().min(1),
|
|
352
389
|
});
|
|
@@ -473,7 +510,7 @@ function requireAgentKey() {
|
|
|
473
510
|
return agentKey;
|
|
474
511
|
}
|
|
475
512
|
|
|
476
|
-
async function callAgentApi({ method, pathName, query, body, requireAuth = true }) {
|
|
513
|
+
async function callAgentApi({ method, pathName, query, body, requireAuth = true, extraHeaders }) {
|
|
477
514
|
const headers = {
|
|
478
515
|
Accept: "application/json",
|
|
479
516
|
};
|
|
@@ -488,6 +525,11 @@ async function callAgentApi({ method, pathName, query, body, requireAuth = true
|
|
|
488
525
|
if (["POST", "PATCH", "DELETE"].includes(String(method || "").toUpperCase())) {
|
|
489
526
|
headers["Idempotency-Key"] = `mcp-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
490
527
|
}
|
|
528
|
+
if (extraHeaders && typeof extraHeaders === "object") {
|
|
529
|
+
for (const [k, v] of Object.entries(extraHeaders)) {
|
|
530
|
+
if (typeof v === "string" && v.length > 0) headers[k] = v;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
491
533
|
|
|
492
534
|
const url = `${getBaseUrl()}${pathName}${queryString(query || {})}`;
|
|
493
535
|
const response = await fetch(url, {
|
|
@@ -1641,6 +1683,80 @@ const tools = [
|
|
|
1641
1683
|
body: args,
|
|
1642
1684
|
}),
|
|
1643
1685
|
},
|
|
1686
|
+
{
|
|
1687
|
+
name: "yieldwolf_casino_link",
|
|
1688
|
+
description: withWriteSafety("Bind a Solana wallet to a YieldWolf Casino account. Lane is fixed at link time: 'real' = solana-mainnet (default), 'test' = solana-devnet/testnet. The response carries `proxy_base` and a runtime `instructions` payload (skill_doc, summary, flows, responsible_play, lane_note). The raw casino API key is intentionally not returned to the agent: every casino call must go through `yieldwolf_casino_call` so OpenClawCash can enforce wallet ownership, venue scope, and audit. The linked wallet is the only allowed withdrawal destination. To switch lanes later, call yieldwolf_casino_unlink and re-link."),
|
|
1689
|
+
inputSchema: {
|
|
1690
|
+
type: "object",
|
|
1691
|
+
properties: {
|
|
1692
|
+
walletId: { oneOf: [{ type: "integer" }, { type: "string" }] },
|
|
1693
|
+
walletAddress: { type: "string" },
|
|
1694
|
+
agentName: { type: "string", description: "Optional agent display name registered at the casino (max 64 chars)." },
|
|
1695
|
+
lane: { type: "string", enum: ["real", "test"], description: "Network lane. Defaults to 'real'." },
|
|
1696
|
+
},
|
|
1697
|
+
additionalProperties: false,
|
|
1698
|
+
},
|
|
1699
|
+
parse: (args) => yieldwolfCasinoLinkArgsSchema.parse(args ?? {}),
|
|
1700
|
+
execute: async (args) =>
|
|
1701
|
+
callAgentApi({
|
|
1702
|
+
method: "POST",
|
|
1703
|
+
pathName: "/api/agent/venues/yieldwolf-casino/link",
|
|
1704
|
+
body: args,
|
|
1705
|
+
}),
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
name: "yieldwolf_casino_unlink",
|
|
1709
|
+
description: withWriteSafety("Clear the YieldWolf Casino binding for a linked wallet."),
|
|
1710
|
+
inputSchema: {
|
|
1711
|
+
type: "object",
|
|
1712
|
+
properties: {
|
|
1713
|
+
walletId: { oneOf: [{ type: "integer" }, { type: "string" }] },
|
|
1714
|
+
walletAddress: { type: "string" },
|
|
1715
|
+
},
|
|
1716
|
+
additionalProperties: false,
|
|
1717
|
+
},
|
|
1718
|
+
parse: (args) => yieldwolfCasinoUnlinkArgsSchema.parse(args ?? {}),
|
|
1719
|
+
execute: async (args) =>
|
|
1720
|
+
callAgentApi({
|
|
1721
|
+
method: "POST",
|
|
1722
|
+
pathName: "/api/agent/venues/yieldwolf-casino/unlink",
|
|
1723
|
+
body: args,
|
|
1724
|
+
}),
|
|
1725
|
+
},
|
|
1726
|
+
{
|
|
1727
|
+
name: "yieldwolf_casino_call",
|
|
1728
|
+
description: withWriteSafety("Generic dispatcher for a linked YieldWolf Casino wallet. Routes through OpenClawCash's proxy so wallet ownership, venue scope (read for GET, trade for non-GET), and audit are enforced server-side. `path` is the YieldWolf upstream path (multi-segment paths accepted; e.g. 'agents/me/balance', 'transactions/history', 'games', 'games/info' for reads; 'games/play', 'transactions/withdraw', 'arena/kuhn/check' for writes). `method` defaults to GET. `body` is forwarded verbatim for non-GET calls. Pass `idempotencyKey` so the casino does not double-submit a write on retry. See https://yieldwolf.finance/SKILL.md for the full upstream surface and request shapes."),
|
|
1729
|
+
inputSchema: {
|
|
1730
|
+
type: "object",
|
|
1731
|
+
properties: {
|
|
1732
|
+
walletId: { oneOf: [{ type: "integer" }, { type: "string" }] },
|
|
1733
|
+
walletAddress: { type: "string" },
|
|
1734
|
+
method: { type: "string", enum: ["GET", "POST"], description: "HTTP method. Defaults to GET. Use POST for writes (play, withdraw, etc.)." },
|
|
1735
|
+
path: { type: "string", description: "YieldWolf upstream path under /gw/. Multi-segment paths supported (e.g. 'agents/me/balance', 'games/play', 'arena/kuhn/check')." },
|
|
1736
|
+
body: { description: "Optional JSON body, forwarded verbatim to YieldWolf for non-GET calls." },
|
|
1737
|
+
query: { type: "object", additionalProperties: { type: "string" }, description: "Optional extra query params forwarded to YieldWolf (walletId is added automatically)." },
|
|
1738
|
+
idempotencyKey: { type: "string", description: "Optional idempotency key forwarded as X-Idempotency-Key so the casino does not double-submit a write on retry." },
|
|
1739
|
+
},
|
|
1740
|
+
required: ["path"],
|
|
1741
|
+
additionalProperties: false,
|
|
1742
|
+
},
|
|
1743
|
+
parse: (args) => yieldwolfCasinoCallArgsSchema.parse(args ?? {}),
|
|
1744
|
+
execute: async (args) => {
|
|
1745
|
+
const upstreamPath = String(args.path).replace(/^\/+/, "");
|
|
1746
|
+
const method = (args.method || "GET").toUpperCase();
|
|
1747
|
+
const walletQuery =
|
|
1748
|
+
args.walletId !== undefined ? { walletId: String(args.walletId) } : { walletAddress: String(args.walletAddress) };
|
|
1749
|
+
const query = { ...walletQuery, ...(args.query || {}) };
|
|
1750
|
+
const extraHeaders = args.idempotencyKey ? { "X-Idempotency-Key": args.idempotencyKey } : undefined;
|
|
1751
|
+
return callAgentApi({
|
|
1752
|
+
method,
|
|
1753
|
+
pathName: `/api/agent/venues/yieldwolf-casino/proxy/${upstreamPath}`,
|
|
1754
|
+
query,
|
|
1755
|
+
body: method === "GET" ? undefined : args.body,
|
|
1756
|
+
extraHeaders,
|
|
1757
|
+
});
|
|
1758
|
+
},
|
|
1759
|
+
},
|
|
1644
1760
|
];
|
|
1645
1761
|
|
|
1646
1762
|
const resources = [
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclawcash/mcp-server",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "OpenClawCash MCP server for managed agent wallets, balances, transfers, swaps, approvals, cross-chain bridges, Get Paid checkout escrow flows,
|
|
3
|
+
"version": "0.1.21",
|
|
4
|
+
"description": "OpenClawCash MCP server for managed agent wallets, balances, transfers, swaps, approvals, cross-chain bridges, Get Paid checkout escrow flows, Polymarket market resolution/order tools, and YieldWolf Casino link/unlink/proxy tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Proprietary",
|
|
7
7
|
"homepage": "https://openclawcash.com/mcp",
|