@agentwonderland/mcp 0.1.21 → 0.1.22

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
@@ -42,6 +42,10 @@ export async function startMcpServer() {
42
42
  "- Payment is automatic once configured. Users are never charged for failed runs.",
43
43
  "- Do NOT ask the user to set up payment before they try to run an agent. Let them explore freely — payment setup is handled inline when they're ready to pay.",
44
44
  "",
45
+ "MANAGING PAYMENT METHODS:",
46
+ "- To remove a card: wallet_setup({ action: \"remove-card\" })",
47
+ "- To remove or modify a crypto wallet: NEVER do this programmatically. Direct users to edit their config files manually (~/.agentwonderland/config.json or ~/.ows/). We do not handle private key deletion or modification to avoid any risk of key loss.",
48
+ "",
45
49
  "REQUIRED FIELDS:",
46
50
  "Always check the agent's input schema (via get_agent) before calling run_agent.",
47
51
  "Include ALL required fields in the first attempt to avoid validation errors.",
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { getWallets, getCardConfig, addWallet } from "../core/config.js";
2
+ import { getWallets, getCardConfig, setCardConfig, addWallet } from "../core/config.js";
3
3
  import { getWalletAddress } from "../core/payments.js";
4
4
  import { initiateCardSetup, pollCardSetup } from "../core/card-setup.js";
5
5
  import { isOwsAvailable, createOwsWallet, importKeyToOws, listOwsWallets, } from "../core/ows-adapter.js";
@@ -29,10 +29,10 @@ export function registerWalletTools(server) {
29
29
  return text(lines.join("\n"));
30
30
  });
31
31
  // ── wallet_setup (NEW) ──────────────────────────────────────────
32
- server.tool("wallet_setup", "Set up a payment method for running agents. Options: 'create' a crypto wallet, 'import' an existing key, or 'add-card' to connect a credit/debit card via QR code. Card setup shows a scannable QR code call again after the user enters their card to confirm.", {
32
+ server.tool("wallet_setup", "Set up or manage payment methods. Options: 'add-card' to connect a credit/debit card (recommended), 'remove-card' to disconnect a card, 'create' a crypto wallet, or 'import' an existing key. For crypto wallet changes (removal, key rotation), direct users to edit their config files manually never handle private keys programmatically.", {
33
33
  action: z
34
- .enum(["create", "import", "add-card"])
35
- .describe("'create' a new crypto wallet, 'import' an existing private key, or 'add-card' to connect a credit/debit card"),
34
+ .enum(["create", "import", "add-card", "remove-card"])
35
+ .describe("'add-card' to connect a card, 'remove-card' to disconnect it, 'create' a crypto wallet, or 'import' an existing key"),
36
36
  name: z
37
37
  .string()
38
38
  .optional()
@@ -98,6 +98,15 @@ export function registerWalletTools(server) {
98
98
  return text("Error: Could not create card setup session. Try again later.");
99
99
  }
100
100
  }
101
+ // ── Card removal ─────────────────────────────────────────
102
+ if (action === "remove-card") {
103
+ const existing = getCardConfig();
104
+ if (!existing) {
105
+ return text("No card is currently connected.");
106
+ }
107
+ setCardConfig(null);
108
+ return text(`Removed ${existing.brand} ****${existing.last4}. Card disconnected from Agent Wonderland.`);
109
+ }
101
110
  // ── Crypto wallet setup ──────────────────────────────────
102
111
  if (action === "import" && !key) {
103
112
  return text("Error: 'key' parameter is required when action is 'import'.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentwonderland/mcp",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "MCP server for the Agent Wonderland AI agent marketplace",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -49,6 +49,10 @@ export async function startMcpServer(): Promise<void> {
49
49
  "- Payment is automatic once configured. Users are never charged for failed runs.",
50
50
  "- Do NOT ask the user to set up payment before they try to run an agent. Let them explore freely — payment setup is handled inline when they're ready to pay.",
51
51
  "",
52
+ "MANAGING PAYMENT METHODS:",
53
+ "- To remove a card: wallet_setup({ action: \"remove-card\" })",
54
+ "- To remove or modify a crypto wallet: NEVER do this programmatically. Direct users to edit their config files manually (~/.agentwonderland/config.json or ~/.ows/). We do not handle private key deletion or modification to avoid any risk of key loss.",
55
+ "",
52
56
  "REQUIRED FIELDS:",
53
57
  "Always check the agent's input schema (via get_agent) before calling run_agent.",
54
58
  "Include ALL required fields in the first attempt to avoid validation errors.",
@@ -56,11 +56,11 @@ export function registerWalletTools(server: McpServer): void {
56
56
  // ── wallet_setup (NEW) ──────────────────────────────────────────
57
57
  server.tool(
58
58
  "wallet_setup",
59
- "Set up a payment method for running agents. Options: 'create' a crypto wallet, 'import' an existing key, or 'add-card' to connect a credit/debit card via QR code. Card setup shows a scannable QR code call again after the user enters their card to confirm.",
59
+ "Set up or manage payment methods. Options: 'add-card' to connect a credit/debit card (recommended), 'remove-card' to disconnect a card, 'create' a crypto wallet, or 'import' an existing key. For crypto wallet changes (removal, key rotation), direct users to edit their config files manually never handle private keys programmatically.",
60
60
  {
61
61
  action: z
62
- .enum(["create", "import", "add-card"])
63
- .describe("'create' a new crypto wallet, 'import' an existing private key, or 'add-card' to connect a credit/debit card"),
62
+ .enum(["create", "import", "add-card", "remove-card"])
63
+ .describe("'add-card' to connect a card, 'remove-card' to disconnect it, 'create' a crypto wallet, or 'import' an existing key"),
64
64
  name: z
65
65
  .string()
66
66
  .optional()
@@ -135,6 +135,17 @@ export function registerWalletTools(server: McpServer): void {
135
135
  }
136
136
  }
137
137
 
138
+ // ── Card removal ─────────────────────────────────────────
139
+ if (action === "remove-card") {
140
+ const existing = getCardConfig();
141
+ if (!existing) {
142
+ return text("No card is currently connected.");
143
+ }
144
+
145
+ setCardConfig(null);
146
+ return text(`Removed ${existing.brand} ****${existing.last4}. Card disconnected from Agent Wonderland.`);
147
+ }
148
+
138
149
  // ── Crypto wallet setup ──────────────────────────────────
139
150
  if (action === "import" && !key) {
140
151
  return text(