crossmint-wallets-mcp 0.2.0 → 0.2.1

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.
File without changes
package/package.json CHANGED
@@ -1,16 +1,17 @@
1
1
  {
2
2
  "name": "crossmint-wallets-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server exposing Crossmint smart wallet primitives as tools for Claude Desktop, Continue.dev, Cline, Codex CLI, and any MCP-native client.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "crossmint-wallets-mcp": "dist/mcp/server.js"
7
+ "crossmint-wallets-mcp": "scripts/mcp-entry.cjs"
8
8
  },
9
9
  "main": "dist/index.js",
10
10
  "types": "dist/index.d.ts",
11
11
  "files": [
12
12
  "dist",
13
13
  "scripts/postinstall.cjs",
14
+ "scripts/mcp-entry.cjs",
14
15
  "README.md",
15
16
  "LICENSE"
16
17
  ],
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ // This CJS wrapper patches process.stdout BEFORE any ESM module loads.
5
+ // Problem: The Crossmint SDK (@crossmint/wallets-sdk) writes telemetry
6
+ // to stdout via console.log during module initialization. In ESM, static
7
+ // imports are evaluated before any top-level code, so patching console.log
8
+ // inside server.ts runs too late. This CJS entry point runs first.
9
+ //
10
+ // Fix: intercept process.stdout.write and only let JSON-RPC messages
11
+ // through. Everything else goes to stderr.
12
+
13
+ const origWrite = process.stdout.write.bind(process.stdout);
14
+
15
+ process.stdout.write = function (chunk, encoding, callback) {
16
+ const str = typeof chunk === "string" ? chunk : chunk.toString();
17
+ const trimmed = str.trimStart();
18
+
19
+ // JSON-RPC messages start with '{' and contain "jsonrpc"
20
+ if (trimmed.startsWith("{") && trimmed.includes('"jsonrpc"')) {
21
+ return origWrite(chunk, encoding, callback);
22
+ }
23
+
24
+ // Redirect everything else to stderr (SDK telemetry, debug logs, etc.)
25
+ return process.stderr.write(chunk, encoding, callback);
26
+ };
27
+
28
+ // Also redirect console.log for anything that slips through
29
+ const origLog = console.log;
30
+ console.log = function (...args) {
31
+ console.error(...args);
32
+ };
33
+
34
+ // Now dynamically import the ESM server — all patches are in place
35
+ import("../dist/mcp/server.js").catch((err) => {
36
+ console.error("[crossmint-wallets-mcp] failed to load server:", err);
37
+ process.exit(1);
38
+ });