Skip to content

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

@elborky

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.

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