Skip to content

fix: upgrade to Zod v4, drop SSE server and @hono/zod-openapi#5

Merged
yaonyan merged 2 commits into
mainfrom
fix/upgrade-zod-v4-drop-sse
May 22, 2026
Merged

fix: upgrade to Zod v4, drop SSE server and @hono/zod-openapi#5
yaonyan merged 2 commits into
mainfrom
fix/upgrade-zod-v4-drop-sse

Conversation

@yaonyan
Copy link
Copy Markdown
Contributor

@yaonyan yaonyan commented May 22, 2026

Summary

  • Fix Zod v4 crash: zod-to-openapi@7.x (bundled with @hono/zod-openapi@^0.19.x) monkey-patches Zod v4 lazy prototype methods incorrectly, causing TypeError: Cannot read properties of undefined (reading 'def') on startup — upgraded zod to ^4.0.0 and dropped @hono/zod-openapi entirely
  • Drop SSE HTTP server: Removed src/server.ts, src/controllers/, hono, @mcpc/utils — the package only needs stdio transport; the SSE layer was unused overhead
  • Upgrade MCP SDK: ^1.8.0^1.29.0 which supports zod: ^3.25 || ^4.0 natively; switched from deprecated server.tool() to server.registerTool()
  • Remove @mcpc/core: No longer imported anywhere after SSE removal

Test plan

  • deno check mod.ts — zero type errors
  • deno run --allow-all tests/run-tests.ts — 76 passed, 0 failed

🤖 Generated with Claude Code

yaonyan and others added 2 commits May 22, 2026 21:42
- Upgrade @hono/zod-openapi ^0.19.2 → removed entirely (plain hono)
- Upgrade zod ^3.x → ^4.0.0
- Upgrade @modelcontextprotocol/sdk ^1.8.0 → ^1.29.0 (Zod v4 compat)
- Remove @mcpc/core and @mcpc/utils dependencies (no longer needed)
- Remove SSE HTTP server, controllers, and ./server export
- Switch server.tool() → server.registerTool() for SDK 1.29.0 API
- src/app.ts simplified to just export the MCP server instance

Fixes TypeError crash caused by zod-to-openapi@7.x monkey-patching
Zod v4 lazy prototype methods incorrectly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@yaonyan yaonyan merged commit 82be616 into main May 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant