Skip to content

@dokploy/mcp: All tool schemas inject $schema: draft-07 causing Anthropic API 400 error #36

Closed

Description

@elborky

Bug Report

Summary

Every tool registered by @dokploy/mcp has an invalid input_schema that causes the Anthropic API to return a 400 error when the MCP is connected to Claude Code (or any Claude API client):

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"tools.22.custom.input_schema: JSON schema is invalid. It must match JSON Schema draft 2020-12 (https://json-schema.org/draft/2020-12). Learn more about tool use at https://docs.claude.com/en/docs/tool-use."},"request_id":"..."}

Root Cause

@dokploy/mcp uses zod-to-json-schema (via @modelcontextprotocol/sdk) which injects "$schema": "http://json-schema.org/draft-07/schema#" into every generated input_schema.

The Anthropic API requires tool input_schema to comply with JSON Schema draft 2020-12 and rejects any schema that declares itself as draft-07.

Affected file:

node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js

The toJsonSchemaCompat function always injects $schema: draft-07 into the output.

Impact

  • All 519 dokploy tools are affected — the first one encountered (tool index 22 in a typical Claude Code session) triggers the error
  • The MCP cannot be used with Claude Code / Anthropic API at all until fixed

Versions

  • @dokploy/mcp: latest (npx -y @dokploy/mcp)
  • @modelcontextprotocol/sdk: v1.29.0
  • zod-to-json-schema: v3.25.2

Proposed Fix

In the MCP server's tool registration layer, strip the $schema key from every generated input_schema before registering:

// After generating schema with zodToJsonSchema(...)
delete schema.$schema;

Or pass options to suppress $schema injection if/when zod-to-json-schema exposes that option in a future version.

Workaround (for users)

Remove dokploy from mcpServers in ~/.claude/settings.json until this is fixed.

Activity

  1. dosubot commented on Apr 23, 2026

    @dosubot

    Hi @elborky! I'm Dosu and I’m helping the dokploy team.

    This is a confirmed upstream issue in the @modelcontextprotocol/typescript-sdk. It's tracked as issue Dokploy/dokploy#745 in their repository — the SDK's zod-to-json-schema integration injects $schema: "draft-07" into every tool schema, which Anthropic's API rejects because it requires draft-2020-12.

    The MCP TypeScript SDK is currently working toward a 2.0.0 release (alpha builds are available) which includes support for Standard Schema (Zod v4, Valibot, ArkType) that should address this [1].

    In the meantime, for the @dokploy/mcp package specifically, the fix would be relatively straightforward. In server.ts, where tools are registered via server.tool(), the $schema key could be stripped after the SDK converts the Zod shape to JSON Schema — though since the conversion happens internally inside McpServer.tool(), the cleanest short-term fix would likely be to either:

    1. Monkey-patch or wrap the SDK's internal zodToJsonSchema call to delete $schema from the output
    2. Pin or upgrade @modelcontextprotocol/sdk to a version that includes a fix (once released)
    3. Register tools with raw JSON Schema instead of Zod shapes, stripping $schema before passing them in

    This issue likely belongs on the Dokploy/mcp repository since that's where the MCP server code lives [2], separate from the main Dokploy repo.

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about dokploy Share Dosu with your team

  2. AminDhouib commented on Apr 25, 2026

    @AminDhouib

    Can confirm this is happening to us as well. It's a pretty critical bug which makes dokploy-mcp nearly unusable as chat breaks and you lose all of the progress you had on that chat.

  3. Siumauricio commented on May 13, 2026

    @Siumauricio
    Contributor

    Close here #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions