@agentwonderland/mcp 0.1.35 → 0.1.37

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
@@ -13,6 +13,7 @@ import { registerFavoriteTools } from "./tools/favorites.js";
13
13
  import { registerTipTools } from "./tools/tip.js";
14
14
  import { registerPassTools } from "./tools/passes.js";
15
15
  import { registerUploadTools } from "./tools/upload.js";
16
+ import { registerProbeTools } from "./tools/probe.js";
16
17
  // ── Resources ────────────────────────────────────────────────────
17
18
  import { registerAgentResources } from "./resources/agents.js";
18
19
  import { registerWalletResources } from "./resources/wallet.js";
@@ -75,6 +76,7 @@ export async function startMcpServer() {
75
76
  registerTipTools(server);
76
77
  registerPassTools(server);
77
78
  registerUploadTools(server);
79
+ registerProbeTools(server);
78
80
  // Register resources
79
81
  registerAgentResources(server);
80
82
  registerWalletResources(server);
@@ -9,3 +9,4 @@ export { registerFavoriteTools } from "./favorites.js";
9
9
  export { registerTipTools } from "./tip.js";
10
10
  export { registerPassTools } from "./passes.js";
11
11
  export { registerUploadTools } from "./upload.js";
12
+ export { registerProbeTools } from "./probe.js";
@@ -9,3 +9,4 @@ export { registerFavoriteTools } from "./favorites.js";
9
9
  export { registerTipTools } from "./tip.js";
10
10
  export { registerPassTools } from "./passes.js";
11
11
  export { registerUploadTools } from "./upload.js";
12
+ export { registerProbeTools } from "./probe.js";
@@ -0,0 +1,2 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerProbeTools(server: McpServer): void;
@@ -0,0 +1,35 @@
1
+ function text(t) {
2
+ return { content: [{ type: "text", text: t }] };
3
+ }
4
+ export function registerProbeTools(server) {
5
+ server.tool("probe_roots", [
6
+ "Diagnostic tool: calls roots/list on the client and reports what filesystem roots the client exposes to the server.",
7
+ "We're using this to discover whether Claude Desktop surfaces attached files as MCP roots — if it does, we can read attachment bytes over the MCP transport without burning context or hitting the bash sandbox allowlist.",
8
+ "Returns the raw roots response (or the error, if roots/list is unsupported). Safe to call repeatedly; read-only.",
9
+ ].join(" "), {}, async () => {
10
+ const lines = ["=== roots/list probe ==="];
11
+ try {
12
+ const result = await server.server.listRoots();
13
+ lines.push(`status: ok`);
14
+ lines.push(`raw: ${JSON.stringify(result, null, 2)}`);
15
+ const roots = result.roots ?? [];
16
+ lines.push(`count: ${roots.length}`);
17
+ for (const r of roots) {
18
+ lines.push(` - ${r.name ?? "(unnamed)"}: ${r.uri}`);
19
+ }
20
+ }
21
+ catch (err) {
22
+ const e = err;
23
+ lines.push(`status: error`);
24
+ lines.push(`code: ${e.code ?? "?"}`);
25
+ lines.push(`message: ${e.message ?? String(err)}`);
26
+ if (e.data !== undefined)
27
+ lines.push(`data: ${JSON.stringify(e.data)}`);
28
+ lines.push("");
29
+ if (e.code === -32601) {
30
+ lines.push("(-32601 = Method not found — client didn't declare the roots capability.)");
31
+ }
32
+ }
33
+ return text(lines.join("\n"));
34
+ });
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentwonderland/mcp",
3
- "version": "0.1.35",
3
+ "version": "0.1.37",
4
4
  "type": "module",
5
5
  "description": "MCP server for the Agent Wonderland AI agent marketplace",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -15,6 +15,7 @@ import { registerFavoriteTools } from "./tools/favorites.js";
15
15
  import { registerTipTools } from "./tools/tip.js";
16
16
  import { registerPassTools } from "./tools/passes.js";
17
17
  import { registerUploadTools } from "./tools/upload.js";
18
+ import { registerProbeTools } from "./tools/probe.js";
18
19
 
19
20
  // ── Resources ────────────────────────────────────────────────────
20
21
  import { registerAgentResources } from "./resources/agents.js";
@@ -84,6 +85,7 @@ export async function startMcpServer(): Promise<void> {
84
85
  registerTipTools(server);
85
86
  registerPassTools(server);
86
87
  registerUploadTools(server);
88
+ registerProbeTools(server);
87
89
 
88
90
  // Register resources
89
91
  registerAgentResources(server);
@@ -9,3 +9,4 @@ export { registerFavoriteTools } from "./favorites.js";
9
9
  export { registerTipTools } from "./tip.js";
10
10
  export { registerPassTools } from "./passes.js";
11
11
  export { registerUploadTools } from "./upload.js";
12
+ export { registerProbeTools } from "./probe.js";
@@ -0,0 +1,41 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+
3
+ function text(t: string) {
4
+ return { content: [{ type: "text" as const, text: t }] };
5
+ }
6
+
7
+ export function registerProbeTools(server: McpServer) {
8
+ server.tool(
9
+ "probe_roots",
10
+ [
11
+ "Diagnostic tool: calls roots/list on the client and reports what filesystem roots the client exposes to the server.",
12
+ "We're using this to discover whether Claude Desktop surfaces attached files as MCP roots — if it does, we can read attachment bytes over the MCP transport without burning context or hitting the bash sandbox allowlist.",
13
+ "Returns the raw roots response (or the error, if roots/list is unsupported). Safe to call repeatedly; read-only.",
14
+ ].join(" "),
15
+ {},
16
+ async () => {
17
+ const lines: string[] = ["=== roots/list probe ==="];
18
+ try {
19
+ const result = await server.server.listRoots();
20
+ lines.push(`status: ok`);
21
+ lines.push(`raw: ${JSON.stringify(result, null, 2)}`);
22
+ const roots = (result as { roots?: Array<{ uri: string; name?: string }> }).roots ?? [];
23
+ lines.push(`count: ${roots.length}`);
24
+ for (const r of roots) {
25
+ lines.push(` - ${r.name ?? "(unnamed)"}: ${r.uri}`);
26
+ }
27
+ } catch (err) {
28
+ const e = err as { code?: number; message?: string; data?: unknown };
29
+ lines.push(`status: error`);
30
+ lines.push(`code: ${e.code ?? "?"}`);
31
+ lines.push(`message: ${e.message ?? String(err)}`);
32
+ if (e.data !== undefined) lines.push(`data: ${JSON.stringify(e.data)}`);
33
+ lines.push("");
34
+ if (e.code === -32601) {
35
+ lines.push("(-32601 = Method not found — client didn't declare the roots capability.)");
36
+ }
37
+ }
38
+ return text(lines.join("\n"));
39
+ },
40
+ );
41
+ }