@agentwonderland/mcp 0.1.42 → 0.1.44
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/core/__tests__/api-client.test.js +1 -1
- package/dist/core/__tests__/setup.test.js +3 -3
- package/dist/core/api-client.js +2 -2
- package/dist/core/version.d.ts +1 -0
- package/dist/core/version.js +1 -0
- package/dist/index.js +5 -5
- package/dist/setup.js +5 -5
- package/dist/tools/wallet.js +5 -1
- package/package.json +1 -1
- package/src/core/__tests__/api-client.test.ts +1 -1
- package/src/core/__tests__/setup.test.ts +3 -3
- package/src/core/api-client.ts +2 -3
- package/src/core/version.ts +1 -0
- package/src/index.ts +5 -6
- package/src/setup.ts +5 -5
- package/src/tools/wallet.ts +5 -1
|
@@ -46,7 +46,7 @@ describe("api-client headers", () => {
|
|
|
46
46
|
"X-AW-Consumer-Principal": "did:pkh:solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp:42W2HfLfveSm1T5et9WTLp2CZ2QXdF2EYCUvyJ2gPpxF",
|
|
47
47
|
"X-AW-Rebate-Principal": "did:pkh:eip155:8453:0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
48
48
|
"X-AW-Surface": "mcp",
|
|
49
|
-
"X-AW-MCP-Version": "0.1.
|
|
49
|
+
"X-AW-MCP-Version": "0.1.44",
|
|
50
50
|
"X-AW-MCP-Tool": "run_agent",
|
|
51
51
|
"X-AW-MCP-Action": "execute",
|
|
52
52
|
}),
|
|
@@ -20,7 +20,7 @@ describe("MCP setup", () => {
|
|
|
20
20
|
expect(next.mcpServers.existing.command).toBe("node");
|
|
21
21
|
expect(next.mcpServers.agentwonderland).toEqual({
|
|
22
22
|
command: "npx",
|
|
23
|
-
args: ["-y", "@agentwonderland/mcp"],
|
|
23
|
+
args: ["-y", "@agentwonderland/mcp@latest"],
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
it("replaces an existing Codex TOML block without disturbing other servers", () => {
|
|
@@ -40,7 +40,7 @@ describe("MCP setup", () => {
|
|
|
40
40
|
expect(next).toContain("[mcp_servers.other]");
|
|
41
41
|
expect(next).toContain("[mcp_servers.agentwonderland]");
|
|
42
42
|
expect(next).toContain('command = "npx"');
|
|
43
|
-
expect(next).toContain('args = ["-y", "@agentwonderland/mcp"]');
|
|
43
|
+
expect(next).toContain('args = ["-y", "@agentwonderland/mcp@latest"]');
|
|
44
44
|
expect(next).not.toContain('command = "old"');
|
|
45
45
|
expect(next).toContain("[model_provider.openai]");
|
|
46
46
|
});
|
|
@@ -61,7 +61,7 @@ describe("MCP setup", () => {
|
|
|
61
61
|
const written = JSON.parse(await readFile(configPath, "utf8"));
|
|
62
62
|
expect(result.status).toBe("updated");
|
|
63
63
|
expect(result.backupPath).toBeTruthy();
|
|
64
|
-
expect(written.mcpServers.agentwonderland.args).toEqual(["-y", "@agentwonderland/mcp"]);
|
|
64
|
+
expect(written.mcpServers.agentwonderland.args).toEqual(["-y", "@agentwonderland/mcp@latest"]);
|
|
65
65
|
});
|
|
66
66
|
it("parses client selection flags", () => {
|
|
67
67
|
expect(parseSetupArgs(["--clients", "codex,cursor", "--yes"])).toEqual({
|
package/dist/core/api-client.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { getApiUrl, getApiKey } from "./config.js";
|
|
2
2
|
import { getPaymentFetch } from "./payments.js";
|
|
3
3
|
import { getBaseRebatePrincipal, ensureConsumerPrincipalForMethod, getConsumerPrincipalForMethod, } from "./principal.js";
|
|
4
|
+
import { MCP_PACKAGE_VERSION } from "./version.js";
|
|
4
5
|
// ── Error class ────────────────────────────────────────────────────
|
|
5
6
|
export class ApiError extends Error {
|
|
6
7
|
status;
|
|
@@ -12,7 +13,6 @@ export class ApiError extends Error {
|
|
|
12
13
|
this.name = "ApiError";
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
|
-
const MCP_VERSION = "0.1.42";
|
|
16
16
|
function inferToolHeaders(path, method) {
|
|
17
17
|
if (path === "/solve") {
|
|
18
18
|
return { "X-AW-MCP-Tool": "solve", "X-AW-MCP-Action": method === "POST" ? "execute" : "view" };
|
|
@@ -36,7 +36,7 @@ async function buildHeaders(path, method, options) {
|
|
|
36
36
|
"Content-Type": "application/json",
|
|
37
37
|
Accept: "application/json",
|
|
38
38
|
"X-AW-Surface": "mcp",
|
|
39
|
-
"X-AW-MCP-Version":
|
|
39
|
+
"X-AW-MCP-Version": MCP_PACKAGE_VERSION,
|
|
40
40
|
...inferToolHeaders(path, method),
|
|
41
41
|
};
|
|
42
42
|
const apiKey = getApiKey();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MCP_PACKAGE_VERSION = "0.1.44";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MCP_PACKAGE_VERSION = "0.1.44";
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ import { registerJobResources } from "./resources/jobs.js";
|
|
|
22
22
|
// ── Prompts ──────────────────────────────────────────────────────
|
|
23
23
|
import { registerPrompts } from "./prompts/index.js";
|
|
24
24
|
import { runSetupCli } from "./setup.js";
|
|
25
|
-
|
|
25
|
+
import { MCP_PACKAGE_VERSION } from "./core/version.js";
|
|
26
26
|
export async function startMcpServer() {
|
|
27
27
|
const server = new McpServer({
|
|
28
28
|
name: "agentwonderland",
|
|
@@ -107,7 +107,7 @@ if (isCli) {
|
|
|
107
107
|
"Agent Wonderland MCP server",
|
|
108
108
|
"",
|
|
109
109
|
"Usage:",
|
|
110
|
-
" npx @agentwonderland/mcp setup Configure MCP clients",
|
|
110
|
+
" npx -y @agentwonderland/mcp@latest setup Configure MCP clients",
|
|
111
111
|
" npx @agentwonderland/mcp Start the stdio MCP server",
|
|
112
112
|
"",
|
|
113
113
|
"The bare command starts a stdio MCP server. It is meant to be launched by",
|
|
@@ -115,7 +115,7 @@ if (isCli) {
|
|
|
115
115
|
"in a terminal it waits silently for MCP JSON-RPC messages on stdin.",
|
|
116
116
|
"",
|
|
117
117
|
"MCP client config:",
|
|
118
|
-
' { "mcpServers": { "agentwonderland": { "command": "npx", "args": ["-y", "@agentwonderland/mcp"] } } }',
|
|
118
|
+
' { "mcpServers": { "agentwonderland": { "command": "npx", "args": ["-y", "@agentwonderland/mcp@latest"] } } }',
|
|
119
119
|
"",
|
|
120
120
|
"Options:",
|
|
121
121
|
" -h, --help Show this help",
|
|
@@ -124,7 +124,7 @@ if (isCli) {
|
|
|
124
124
|
process.exit(0);
|
|
125
125
|
}
|
|
126
126
|
else if (args.includes("--version") || args.includes("-v")) {
|
|
127
|
-
console.log(
|
|
127
|
+
console.log(MCP_PACKAGE_VERSION);
|
|
128
128
|
process.exit(0);
|
|
129
129
|
}
|
|
130
130
|
else {
|
|
@@ -133,7 +133,7 @@ if (isCli) {
|
|
|
133
133
|
"Agent Wonderland MCP server is running.",
|
|
134
134
|
"This process speaks MCP over stdio, so it waits for a client instead of printing a prompt.",
|
|
135
135
|
"Add it to an MCP client config, or press Ctrl+C to stop.",
|
|
136
|
-
"Run `npx @agentwonderland/mcp setup` to configure your MCP clients.",
|
|
136
|
+
"Run `npx -y @agentwonderland/mcp@latest setup` to configure your MCP clients.",
|
|
137
137
|
].join("\n"));
|
|
138
138
|
}
|
|
139
139
|
startMcpServer().catch((err) => {
|
package/dist/setup.js
CHANGED
|
@@ -8,7 +8,7 @@ import { execFileSync } from "node:child_process";
|
|
|
8
8
|
export const SERVER_NAME = "agentwonderland";
|
|
9
9
|
export const SERVER_CONFIG = {
|
|
10
10
|
command: "npx",
|
|
11
|
-
args: ["-y", "@agentwonderland/mcp"],
|
|
11
|
+
args: ["-y", "@agentwonderland/mcp@latest"],
|
|
12
12
|
};
|
|
13
13
|
const CLIENT_ORDER = [
|
|
14
14
|
"codex",
|
|
@@ -272,7 +272,7 @@ export function mergeCodexTomlConfig(existing) {
|
|
|
272
272
|
const block = [
|
|
273
273
|
`[mcp_servers.${SERVER_NAME}]`,
|
|
274
274
|
`command = "npx"`,
|
|
275
|
-
`args = ["-y", "@agentwonderland/mcp"]`,
|
|
275
|
+
`args = ["-y", "@agentwonderland/mcp@latest"]`,
|
|
276
276
|
"",
|
|
277
277
|
].join("\n");
|
|
278
278
|
const pattern = new RegExp(`\\n?\\[mcp_servers\\.${SERVER_NAME.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\][\\s\\S]*?(?=\\n\\[[^\\]]+\\]|$)`);
|
|
@@ -304,9 +304,9 @@ function printSetupHelp() {
|
|
|
304
304
|
"Agent Wonderland MCP setup",
|
|
305
305
|
"",
|
|
306
306
|
"Usage:",
|
|
307
|
-
" npx @agentwonderland/mcp setup",
|
|
308
|
-
" npx @agentwonderland/mcp setup --clients codex,claude-code",
|
|
309
|
-
" npx @agentwonderland/mcp setup --all --yes",
|
|
307
|
+
" npx -y @agentwonderland/mcp@latest setup",
|
|
308
|
+
" npx -y @agentwonderland/mcp@latest setup --clients codex,claude-code",
|
|
309
|
+
" npx -y @agentwonderland/mcp@latest setup --all --yes",
|
|
310
310
|
"",
|
|
311
311
|
"Supported clients:",
|
|
312
312
|
` ${CLIENT_ORDER.join(", ")}`,
|
package/dist/tools/wallet.js
CHANGED
|
@@ -6,6 +6,7 @@ import { getSettings } from "../core/settings.js";
|
|
|
6
6
|
import { getOrCreatePendingCardSetup, formatCardSetupBlocks, getCardCapabilities, pollCardSetup, } from "../core/card-setup.js";
|
|
7
7
|
import { isOwsAvailable, createOwsWallet, importKeyToOws, listOwsWallets, listOwsWalletsByChain, installOws, platformSupportsOws, } from "../core/ows-adapter.js";
|
|
8
8
|
import { ensureConsumerPrincipal, getConsumerPrincipal } from "../core/principal.js";
|
|
9
|
+
import { MCP_PACKAGE_VERSION } from "../core/version.js";
|
|
9
10
|
function text(t) {
|
|
10
11
|
return { content: [{ type: "text", text: t }] };
|
|
11
12
|
}
|
|
@@ -21,7 +22,10 @@ export function registerWalletTools(server) {
|
|
|
21
22
|
}
|
|
22
23
|
const settings = await getSettings();
|
|
23
24
|
const networkLabel = settings ? ` (${settings.network})` : "";
|
|
24
|
-
const lines = [
|
|
25
|
+
const lines = [
|
|
26
|
+
`Agent Wonderland MCP: ${MCP_PACKAGE_VERSION}`,
|
|
27
|
+
`Payment methods${networkLabel}:`,
|
|
28
|
+
];
|
|
25
29
|
for (const w of wallets) {
|
|
26
30
|
const label = w.label ? ` (${w.label})` : "";
|
|
27
31
|
const storage = w.keyType === "ows" ? " [encrypted]" : " [plaintext]";
|
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ describe("api-client headers", () => {
|
|
|
72
72
|
"X-AW-Rebate-Principal":
|
|
73
73
|
"did:pkh:eip155:8453:0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
|
|
74
74
|
"X-AW-Surface": "mcp",
|
|
75
|
-
"X-AW-MCP-Version": "0.1.
|
|
75
|
+
"X-AW-MCP-Version": "0.1.44",
|
|
76
76
|
"X-AW-MCP-Tool": "run_agent",
|
|
77
77
|
"X-AW-MCP-Action": "execute",
|
|
78
78
|
}),
|
|
@@ -30,7 +30,7 @@ describe("MCP setup", () => {
|
|
|
30
30
|
expect(next.mcpServers.existing.command).toBe("node");
|
|
31
31
|
expect(next.mcpServers.agentwonderland).toEqual({
|
|
32
32
|
command: "npx",
|
|
33
|
-
args: ["-y", "@agentwonderland/mcp"],
|
|
33
|
+
args: ["-y", "@agentwonderland/mcp@latest"],
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -52,7 +52,7 @@ describe("MCP setup", () => {
|
|
|
52
52
|
expect(next).toContain("[mcp_servers.other]");
|
|
53
53
|
expect(next).toContain("[mcp_servers.agentwonderland]");
|
|
54
54
|
expect(next).toContain('command = "npx"');
|
|
55
|
-
expect(next).toContain('args = ["-y", "@agentwonderland/mcp"]');
|
|
55
|
+
expect(next).toContain('args = ["-y", "@agentwonderland/mcp@latest"]');
|
|
56
56
|
expect(next).not.toContain('command = "old"');
|
|
57
57
|
expect(next).toContain("[model_provider.openai]");
|
|
58
58
|
});
|
|
@@ -76,7 +76,7 @@ describe("MCP setup", () => {
|
|
|
76
76
|
|
|
77
77
|
expect(result.status).toBe("updated");
|
|
78
78
|
expect(result.backupPath).toBeTruthy();
|
|
79
|
-
expect(written.mcpServers.agentwonderland.args).toEqual(["-y", "@agentwonderland/mcp"]);
|
|
79
|
+
expect(written.mcpServers.agentwonderland.args).toEqual(["-y", "@agentwonderland/mcp@latest"]);
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
it("parses client selection flags", () => {
|
package/src/core/api-client.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getConsumerPrincipal,
|
|
8
8
|
getConsumerPrincipalForMethod,
|
|
9
9
|
} from "./principal.js";
|
|
10
|
+
import { MCP_PACKAGE_VERSION } from "./version.js";
|
|
10
11
|
|
|
11
12
|
// ── Error class ────────────────────────────────────────────────────
|
|
12
13
|
|
|
@@ -29,8 +30,6 @@ interface RequestOptions {
|
|
|
29
30
|
extraHeaders?: Record<string, string>;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
const MCP_VERSION = "0.1.42";
|
|
33
|
-
|
|
34
33
|
function inferToolHeaders(path: string, method: string): Record<string, string> {
|
|
35
34
|
if (path === "/solve") {
|
|
36
35
|
return { "X-AW-MCP-Tool": "solve", "X-AW-MCP-Action": method === "POST" ? "execute" : "view" };
|
|
@@ -55,7 +54,7 @@ async function buildHeaders(path: string, method: string, options?: RequestOptio
|
|
|
55
54
|
"Content-Type": "application/json",
|
|
56
55
|
Accept: "application/json",
|
|
57
56
|
"X-AW-Surface": "mcp",
|
|
58
|
-
"X-AW-MCP-Version":
|
|
57
|
+
"X-AW-MCP-Version": MCP_PACKAGE_VERSION,
|
|
59
58
|
...inferToolHeaders(path, method),
|
|
60
59
|
};
|
|
61
60
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MCP_PACKAGE_VERSION = "0.1.44";
|
package/src/index.ts
CHANGED
|
@@ -26,8 +26,7 @@ import { registerJobResources } from "./resources/jobs.js";
|
|
|
26
26
|
// ── Prompts ──────────────────────────────────────────────────────
|
|
27
27
|
import { registerPrompts } from "./prompts/index.js";
|
|
28
28
|
import { runSetupCli } from "./setup.js";
|
|
29
|
-
|
|
30
|
-
const PACKAGE_VERSION = "0.1.42";
|
|
29
|
+
import { MCP_PACKAGE_VERSION } from "./core/version.js";
|
|
31
30
|
|
|
32
31
|
export async function startMcpServer(): Promise<void> {
|
|
33
32
|
const server = new McpServer(
|
|
@@ -123,7 +122,7 @@ if (isCli) {
|
|
|
123
122
|
"Agent Wonderland MCP server",
|
|
124
123
|
"",
|
|
125
124
|
"Usage:",
|
|
126
|
-
" npx @agentwonderland/mcp setup Configure MCP clients",
|
|
125
|
+
" npx -y @agentwonderland/mcp@latest setup Configure MCP clients",
|
|
127
126
|
" npx @agentwonderland/mcp Start the stdio MCP server",
|
|
128
127
|
"",
|
|
129
128
|
"The bare command starts a stdio MCP server. It is meant to be launched by",
|
|
@@ -131,7 +130,7 @@ if (isCli) {
|
|
|
131
130
|
"in a terminal it waits silently for MCP JSON-RPC messages on stdin.",
|
|
132
131
|
"",
|
|
133
132
|
"MCP client config:",
|
|
134
|
-
' { "mcpServers": { "agentwonderland": { "command": "npx", "args": ["-y", "@agentwonderland/mcp"] } } }',
|
|
133
|
+
' { "mcpServers": { "agentwonderland": { "command": "npx", "args": ["-y", "@agentwonderland/mcp@latest"] } } }',
|
|
135
134
|
"",
|
|
136
135
|
"Options:",
|
|
137
136
|
" -h, --help Show this help",
|
|
@@ -139,7 +138,7 @@ if (isCli) {
|
|
|
139
138
|
].join("\n"));
|
|
140
139
|
process.exit(0);
|
|
141
140
|
} else if (args.includes("--version") || args.includes("-v")) {
|
|
142
|
-
console.log(
|
|
141
|
+
console.log(MCP_PACKAGE_VERSION);
|
|
143
142
|
process.exit(0);
|
|
144
143
|
} else {
|
|
145
144
|
if (process.stdin.isTTY && process.stdout.isTTY) {
|
|
@@ -147,7 +146,7 @@ if (isCli) {
|
|
|
147
146
|
"Agent Wonderland MCP server is running.",
|
|
148
147
|
"This process speaks MCP over stdio, so it waits for a client instead of printing a prompt.",
|
|
149
148
|
"Add it to an MCP client config, or press Ctrl+C to stop.",
|
|
150
|
-
"Run `npx @agentwonderland/mcp setup` to configure your MCP clients.",
|
|
149
|
+
"Run `npx -y @agentwonderland/mcp@latest setup` to configure your MCP clients.",
|
|
151
150
|
].join("\n"));
|
|
152
151
|
}
|
|
153
152
|
|
package/src/setup.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { execFileSync } from "node:child_process";
|
|
|
9
9
|
export const SERVER_NAME = "agentwonderland";
|
|
10
10
|
export const SERVER_CONFIG = {
|
|
11
11
|
command: "npx",
|
|
12
|
-
args: ["-y", "@agentwonderland/mcp"],
|
|
12
|
+
args: ["-y", "@agentwonderland/mcp@latest"],
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export type SetupClientId =
|
|
@@ -330,7 +330,7 @@ export function mergeCodexTomlConfig(existing: string): string {
|
|
|
330
330
|
const block = [
|
|
331
331
|
`[mcp_servers.${SERVER_NAME}]`,
|
|
332
332
|
`command = "npx"`,
|
|
333
|
-
`args = ["-y", "@agentwonderland/mcp"]`,
|
|
333
|
+
`args = ["-y", "@agentwonderland/mcp@latest"]`,
|
|
334
334
|
"",
|
|
335
335
|
].join("\n");
|
|
336
336
|
|
|
@@ -367,9 +367,9 @@ function printSetupHelp(): void {
|
|
|
367
367
|
"Agent Wonderland MCP setup",
|
|
368
368
|
"",
|
|
369
369
|
"Usage:",
|
|
370
|
-
" npx @agentwonderland/mcp setup",
|
|
371
|
-
" npx @agentwonderland/mcp setup --clients codex,claude-code",
|
|
372
|
-
" npx @agentwonderland/mcp setup --all --yes",
|
|
370
|
+
" npx -y @agentwonderland/mcp@latest setup",
|
|
371
|
+
" npx -y @agentwonderland/mcp@latest setup --clients codex,claude-code",
|
|
372
|
+
" npx -y @agentwonderland/mcp@latest setup --all --yes",
|
|
373
373
|
"",
|
|
374
374
|
"Supported clients:",
|
|
375
375
|
` ${CLIENT_ORDER.join(", ")}`,
|
package/src/tools/wallet.ts
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
platformSupportsOws,
|
|
29
29
|
} from "../core/ows-adapter.js";
|
|
30
30
|
import { ensureConsumerPrincipal, getConsumerPrincipal } from "../core/principal.js";
|
|
31
|
+
import { MCP_PACKAGE_VERSION } from "../core/version.js";
|
|
31
32
|
|
|
32
33
|
function text(t: string) {
|
|
33
34
|
return { content: [{ type: "text" as const, text: t }] };
|
|
@@ -53,7 +54,10 @@ export function registerWalletTools(server: McpServer): void {
|
|
|
53
54
|
|
|
54
55
|
const settings = await getSettings();
|
|
55
56
|
const networkLabel = settings ? ` (${settings.network})` : "";
|
|
56
|
-
const lines = [
|
|
57
|
+
const lines = [
|
|
58
|
+
`Agent Wonderland MCP: ${MCP_PACKAGE_VERSION}`,
|
|
59
|
+
`Payment methods${networkLabel}:`,
|
|
60
|
+
];
|
|
57
61
|
|
|
58
62
|
for (const w of wallets) {
|
|
59
63
|
const label = w.label ? ` (${w.label})` : "";
|