Summary
The plugin's MCP server starts and handshakes successfully but errors on tools/list, preventing Claude Code (and any other MCP client doing standard discovery) from seeing any of the kg_* tools. Pinning zod to v3 fixes it.
Environment
|
|
| OS |
Windows 11 |
| Node |
v22.x |
| Plugin commit |
1d2481e (current main HEAD) |
@modelcontextprotocol/sdk |
1.27.1 |
zod |
4.3.6 (within SDK peer range ^3.25 || ^4.0) |
Reproduction
Per https://modelcontextprotocol.io/docs/tools/debugging — drive the server with raw JSON-RPC over stdio:
cd knowledge-graph
KG_VAULT_PATH=/path/to/vault npx tsx src/mcp/index.ts
Send three messages on stdin:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"v","version":"1"}}}
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}
Expected: tools/list returns the 14 registered tools.
Actual:
{"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Cannot read properties of undefined (reading '_zod')"}}
initialize succeeds (serverInfo: knowledge-graph 0.1.0), so the failure is specifically in the SDK's schema-introspection path when building the tools/list response from the z.object({...}) arg schemas in src/mcp/index.ts.
Impact
Claude Code's plugin loader calls tools/list as part of discovery. The MCP server connects but is then marked as failed and none of the kg_* tools surface. The plugin is effectively unusable from inside Claude Code on a fresh install.
Workaround
Force zod v3 via npm overrides in package.json:
"overrides": { "zod": "^3.25" }
Then rm -rf node_modules package-lock.json && npm install. After this, tools/list returns all 14 tools and the plugin works inside Claude Code.
Suggested fix
Either pin zod to ^3.25 in dependencies until the SDK's zod-v4 introspection path is stable, or upgrade @modelcontextprotocol/sdk to a version that handles zod v4 schemas correctly (worth checking the SDK's own issue tracker first).
Summary
The plugin's MCP server starts and handshakes successfully but errors on
tools/list, preventing Claude Code (and any other MCP client doing standard discovery) from seeing any of thekg_*tools. Pinning zod to v3 fixes it.Environment
1d2481e(currentmainHEAD)@modelcontextprotocol/sdk1.27.1zod4.3.6(within SDK peer range^3.25 || ^4.0)Reproduction
Per https://modelcontextprotocol.io/docs/tools/debugging — drive the server with raw JSON-RPC over stdio:
cd knowledge-graph KG_VAULT_PATH=/path/to/vault npx tsx src/mcp/index.tsSend three messages on stdin:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"v","version":"1"}}} {"jsonrpc":"2.0","method":"notifications/initialized"} {"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}Expected:
tools/listreturns the 14 registered tools.Actual:
{"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Cannot read properties of undefined (reading '_zod')"}}initializesucceeds (serverInfo: knowledge-graph 0.1.0), so the failure is specifically in the SDK's schema-introspection path when building thetools/listresponse from thez.object({...})arg schemas insrc/mcp/index.ts.Impact
Claude Code's plugin loader calls
tools/listas part of discovery. The MCP server connects but is then marked as failed and none of thekg_*tools surface. The plugin is effectively unusable from inside Claude Code on a fresh install.Workaround
Force zod v3 via npm overrides in
package.json:Then
rm -rf node_modules package-lock.json && npm install. After this,tools/listreturns all 14 tools and the plugin works inside Claude Code.Suggested fix
Either pin zod to
^3.25independenciesuntil the SDK's zod-v4 introspection path is stable, or upgrade@modelcontextprotocol/sdkto a version that handles zod v4 schemas correctly (worth checking the SDK's own issue tracker first).