Skip to content

SQLcl MCP Server 25.4.0 - Invalid JSON Schema in run-sql tool breaks Claude Code CLI #65

@rpogula2014

Description

@rpogula2014

Bug: MCP Server run-sql tool has invalid JSON Schema (regression in 25.4.0)

Environment

Component Version
SQLcl 25.4.0.346.1855
OS macOS (Apple Silicon)
Java OpenJDK (Homebrew)

Description

The run-sql tool in SQLcl's MCP server (sql -mcp) has an invalid JSON Schema that violates the JSON Schema draft 2020-12 specification. This causes strict MCP clients (e.g., Claude Code CLI) to reject the tool.
Error:
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"}}

Regression

  • Works: SQLcl 25.3.2
  • Broken: SQLcl 25.4.0

Root Cause

In the run-sql tool's inputSchema, the oneOf keyword is incorrectly placed inside properties instead of at the schema root level.

Current schema (invalid) ```json { "inputSchema": { "type": "object", "properties": { "oneOf": [ { "properties": {}, "required": ["sql"] }, { "properties": {}, "required": ["job_id", "command"] } ] } } }
Expected schema (valid) { inputSchema: { type: object, oneOf: [ { properties: {}, required: [sql] }, { properties: {}, required: [job_id, command] } ] } }

Steps to Reproduce

  1. Install SQLcl 25.4.0
  2. Start MCP server:
    sql -mcp
    3. Send MCP initialize + tools/list request
  3. Observe the run-sql tool's invalid schema
  4. Use with a strict MCP client → schema validation error

Workaround

Downgrade to SQLcl 25.3.2

Additional Notes

Some MCP clients (e.g., Claude Desktop) have lenient validation and happen to work, but the schema is still technically invalid per JSON Schema specification. Strict clients will reject it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions