server-filesystem: tools/list schemas declare unsupported $schema draft-07 dialect, rejected by strict 2020-12 validators
Summary
@modelcontextprotocol/server-filesystem (tested on the current latest, 2026.8.31, published 2026-09-17) emits tools/list responses where every tool's schema declares:
"$schema": "http://json-schema.org/draft-07/schema#"Clients that validate tools/list strictly against JSON Schema 2020-12 reject every tool outright, e.g.:
Tool '<name>' has an invalid outputSchema/inputSchema: JSON Schema declares an unsupported dialect ("$schema": "http://json-schema.org/draft-07/schema#"). The default validator supports JSON Schema 2020-12 onlyThis is the same class of problem noted as a "separately noted, different, unrelated bug" in #4772 for server-memory, but here it reproduces for server-filesystem as well.
Steps to reproduce
Spawn the server directly and send a raw tools/list request over stdio:
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":2,"method":"tools/list"}\n' \
| node node_modules/@modelcontextprotocol/server-filesystem/dist/index.js /some/allowed/dirEvery tool's inputSchema includes "$schema":"http://json-schema.org/draft-07/schema#".
What I checked before filing
- Confirmed this reproduces on a fresh install of the latest published version (
2026.8.31), not an old cached one —npm ls -g @modelcontextprotocol/server-filesystemshows2026.8.31, installed minutes before reproducing. - The package depends on
[email protected], whosezodToJsonSchema()setscombined.$schema = "http://json-schema.org/draft-07/schema#"wheneverrefs.target === "jsonSchema7"(its own default target) —dist/cjs/zodToJsonSchema.jsanddist/esm/zodToJsonSchema.js, same line in both. - However, patching that exact line in both files (changing the literal to a 2020-12 URI) and re-spawning the server (fresh process, no compile cache active, confirmed via
node -e "console.log(process.env.NODE_COMPILE_CACHE)"→undefined) did not change the livetools/listoutput — it still returnsdraft-07. I verified withgrepthat the patched files on disk have zero occurrences ofdraft-07after the edit, yet the live response is unchanged. - I could not find any other occurrence of the literal string
draft-07anywhere else underserver-filesystem's ownnode_modules/@modelcontextprotocol/sdk, anddist/index.jsitself contains nozod-to-json-schemaimport and notoJSONSchemacall. - One more lead I did not have time to chase down: the package also pulls in
zodv4, whose nativetoJSONSchema()(node_modules/zod/v4/core/json-schema-generator.js) also normalizes its default target to"draft-07"(see the module's own JSDoc example and thenormalizedTarget = "draft-07"fallback). It's possible the actual schema generation path used by the current build goes through Zod v4's native generator instead of (or in addition to)zod-to-json-schema, which would explain why patching the latter had no effect. I did not confirm this — flagging it as the most promising next place to look.
Impact
Any MCP client with a strict JSON Schema 2020-12 validator on tools/list (e.g. Claude Code / Claude Desktop's "Cowork and Code sessions" context, similar to what's described in #4772) cannot use server-filesystem at all — every tool call fails at the schema-validation step before it's ever invoked.
Environment
@modelcontextprotocol/[email protected][email protected](as installed transitively)- Node.js v24.15.0, Windows 11 ARM64
Source: modelcontextprotocol/servers