Skip to content

fix(server): work around Claude Desktop JSON Schema dialect rejection - #42

Merged
antonisobkowicz-asana merged 2 commits into
mainfrom
fix/claude-desktop-json-schema-dialect
Sep 8, 2026
Merged

fix(server): work around Claude Desktop JSON Schema dialect rejection#42
antonisobkowicz-asana merged 2 commits into
mainfrom
fix/claude-desktop-json-schema-dialect

Conversation

@antonisobkowicz-asana

Copy link
Copy Markdown
Collaborator

Summary

  • Claude Desktop rejects every tool call (get_context, search_tickets, list_workspaces, ...) because @modelcontextprotocol/sdk (1.30.0, latest) always advertises tools/list schemas with $schema: draft-07 — its handler never passes a target to the schema converter. Claude Desktop's tool runner only accepts JSON Schema 2020-12.
  • This is an upstream SDK bug, not fixable in our server code (confirmed via modelcontextprotocol/typescript-sdk#2084 and #2721, both open; proposed fixes #2085/#2653 not yet merged/released).
  • Added applyJsonSchemaDialectWorkaround, which wraps the transport's send to relabel the declared dialect from draft-07 to 2020-12 in transit, wired into cli.ts right before server.connect(). Safe here because this server never emits tuple-style items arrays — the one keyword whose meaning differs between the two dialects. Marked with a TODO to delete once a released SDK version fixes this upstream.
  • Also bumped the timeout on the installer test that runs install.sh three times end-to-end (fresh install, upgrade, no-op rerun) — it was intermittently exceeding vitest's default 5s timeout on a loaded machine.

Test plan

  • npx tsc --noEmit
  • npm run lint
  • npx vitest run — 380 tests passing, including new coverage for the workaround (dialect relabeling, non-tools/list messages passed through untouched, wiring through runCli)
  • Reran the previously-flaky installer test 3x in a row to confirm stability

🤖 Generated with Claude Code

…patibility

@modelcontextprotocol/sdk (1.30.0, latest) always advertises tool schemas
with $schema: draft-07, since its tools/list handler never passes a
target to the schema converter. Claude Desktop's tool runner only
accepts JSON Schema 2020-12 and rejects every call as a result.

Wrap the transport's send to relabel the dialect in transit until the
upstream fix (modelcontextprotocol/typescript-sdk#2084, #2721) lands in
a release; safe here since this server never emits tuple-style items
arrays, the one keyword that differs between the two dialects.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This test runs install.sh three times in a row (fresh install, upgrade,
no-op rerun), which was intermittently exceeding vitest's default 5s
timeout on a loaded machine. No other installer test invokes the
script more than twice.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@antonisobkowicz-asana
antonisobkowicz-asana merged commit 72fb0f0 into main Sep 8, 2026
2 checks passed
@antonisobkowicz-asana
antonisobkowicz-asana deleted the fix/claude-desktop-json-schema-dialect branch September 8, 2026 07:59
antonisobkowicz-asana added a commit that referenced this pull request Sep 8, 2026
## Summary
- Bumps `package.json`/`package-lock.json` to 0.4.1 to release the
Claude Desktop JSON Schema dialect workaround (#42).

## Test plan
- [x] `npm ci`
- [x] `npm run check` (typecheck, lint, 380 tests, build) — all passing
- [x] `npm audit` — 0 vulnerabilities
- [x] `npm pack --dry-run` — tarball contents look correct

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant