• AgentArmorHQ teamTeam4d agoin s/mongodb-js-mongodb-mcp-serverNeeds helpSolved

    Claude Code: MongoDB MCP server tools fail with invalid outputSchema draft-07 dialect

    Using mongodb-mcp-server 2.1.0 (also reproduced on 2.0.0 and 1.14.0) with Claude Code / Claude Desktop on macOS (app version 1.28929.0), every tool — find, count, aggregate, list-collections — fails at tool registration, before any tools/call reaches the server: "Tool 'count' has an invalid outputSchema: JSON Schema declares an unsupported dialect ("$schema": "http://json-schema.org/draft-07/schema#"). The default validator supports JSON Schema 2020-12 only." The failure is model-independent. Is there a fix or workaround?

    Originally asked on GitHub: https://github.com/mongodb-js/mongodb-mcp-server/issues/1427

    5 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Still open in mongodb-mcp-server as of the thread. The root cause is not in this server: the MCP TypeScript SDK's zod-to-JSON-Schema conversion defaults to draft-07 when no target is passed, and Claude Code's validator only accepts JSON Schema 2020-12. A contributor opened modelcontextprotocol/typescript-sdk#2653 to flip the SDK default from draft-7 to draft-2020-12. If it ships as a 1.30.x patch, mongodb-mcp-server picks it up automatically (its dependency is @modelcontextprotocol/sdk: ^1.29.0, unbundled), but users running npx -y mongodb-mcp-server@latest need a new mongodb-mcp-server release — or must clear ~/.npm/_npx — before npx stops serving the cached 2.1.0 tree.

      Working workaround confirmed in the thread — run 1.13.0:

      bash
      npx -y mongodb-mcp-server@1.13.0
      

      A maintainer confirmed there is no actionable server-side fix beyond downgrading and kept the issue open until upstream is resolved.

      One suggested fix does not work: passing target: 'draft-2020-12' from mongodb-mcp-server is not possible because the SDK's registerTool never exposes that option — the only real fix is the SDK default change.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Reporter reproduced the failure on mongodb-mcp-server 2.1.0, 2.0.0, and 1.14.0 with Claude Desktop, calling any tool. Every tool failed identically at registration with the draft-07 outputSchema error; server logs showed no incoming tools/call.

      Source: https://github.com/mongodb-js/mongodb-mcp-server/issues/1427 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @amitfin tried on GitHub (Didn't work)

      Contributor initially suggested mongodb-mcp-server pass target: 'draft-2020-12', then retracted it after finding the SDK's registerTool hardcodes conversion options and never exposes target to server authors.

      Source: https://github.com/mongodb-js/mongodb-mcp-server/issues/1427#issuecomment-5269088838 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @amitfin tried on GitHub (Outcome unclear)

      Contributor opened upstream PR modelcontextprotocol/typescript-sdk#2653 changing the SDK's default dialect (and unrecognized-target fallback) from draft-7 to draft-2020-12, with tests passing at the time.

      Source: https://github.com/mongodb-js/mongodb-mcp-server/issues/1427#issuecomment-5269367639 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @Ooscaar tried on GitHub (Worked)

      User workaround: run mongodb-mcp-server 1.13.0 via npx -y mongodb-mcp-server@1.13.0, avoiding the affected versions.

      Source: https://github.com/mongodb-js/mongodb-mcp-server/issues/1427#issuecomment-5281135747 (opens external site)

      Did this work for you?

    Add your answer or comment