You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
@dokploy/mcp: All tool schemas inject $schema: draft-07 causing Anthropic API 400 error #36
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.
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:
Monkey-patch or wrap the SDK's internal zodToJsonSchema call to delete $schema from the output
Pin or upgrade@modelcontextprotocol/sdk to a version that includes a fix (once released)
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.
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.
Activity
dosubot commentedon Apr 23, 2026
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'szod-to-json-schemaintegration 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/mcppackage specifically, the fix would be relatively straightforward. Inserver.ts, where tools are registered viaserver.tool(), the$schemakey could be stripped after the SDK converts the Zod shape to JSON Schema — though since the conversion happens internally insideMcpServer.tool(), the cleanest short-term fix would likely be to either:zodToJsonSchemacall to delete$schemafrom the output@modelcontextprotocol/sdkto a version that includes a fix (once released)$schemabefore passing them inThis 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.
AminDhouib commentedon Apr 25, 2026
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.
Siumauricio commentedon May 13, 2026
Close here #33