Skip to content

Commit 4e9cb39

Browse files
committed
chore(deps): consolidate dependabot updates
Bumps all pending dependency updates into one commit: Root package: - zod 3.25.76 → 4.3.6 (major) - @types/node 22 → 25 (major) - @modelcontextprotocol/sdk 1.26.0 → 1.27.1 - tsdown 0.15.12 → 0.21.4 - prettier 3.6.2 → 3.8.1 - typescript-eslint 8.48.0 → 8.57.1 - lefthook 2.0.2 → 2.1.4 - eslint/@eslint/js → 9.39.4 (kept at v9, typescript-eslint lacks v10 support) - Regenerated lockfile to pick up transitive security fixes (hono, @hono/node-server, express-rate-limit, flatted, rollup, minimatch, ajv, qs, undici) examples/servers/typescript: - @modelcontextprotocol/sdk → 1.27.1 - Removed zod-to-json-schema (broken with zod v4) - Added zod ^4 as direct dep - Regenerated lockfile GitHub Actions: - actions/setup-node v4 → v6 in action.yml Code changes for zod v4: - ZodError.errors → ZodError.issues (src/index.ts) - .refine() callback signature updated (src/schemas.ts) - everything-server: replaced zodToJsonSchema with SDK's toJsonSchemaCompat helper (handles zod v3/v4/v4-mini) Build fix for tsdown 0.21: - Added --no-fixed-extension to preserve dist/index.js output (tsdown 0.21 defaults to .mjs for type:module packages)
1 parent 02a5f1c commit 4e9cb39

8 files changed

Lines changed: 914 additions & 1273 deletions

File tree

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ runs:
3535
using: 'composite'
3636
steps:
3737
- name: Setup Node.js
38-
uses: actions/setup-node@v4
38+
uses: actions/setup-node@v6
3939
with:
4040
node-version: ${{ inputs.node-version }}
4141

examples/servers/typescript/everything-server.ts

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import {
2525
type ListToolsResult,
2626
type Tool
2727
} from '@modelcontextprotocol/sdk/types.js';
28-
import { zodToJsonSchema } from 'zod-to-json-schema';
2928
import { z } from 'zod';
29+
import { toJsonSchemaCompat } from '@modelcontextprotocol/sdk/server/zod-json-schema-compat.js';
3030
import cors from 'cors';
3131
import { randomUUID } from 'crypto';
3232

@@ -1006,31 +1006,14 @@ function createMcpServer() {
10061006
};
10071007
}
10081008

1009-
// For other tools, convert Zod to JSON Schema
1010-
// Handle different inputSchema formats:
1011-
// - undefined/null: use empty object schema
1012-
// - Zod schema (has _def): convert directly
1013-
// - Raw shape (object with Zod values): wrap in z.object first
1014-
let inputSchema: Tool['inputSchema'];
1015-
if (!tool.inputSchema) {
1016-
inputSchema = { type: 'object' as const, properties: {} };
1017-
} else if ('_def' in tool.inputSchema) {
1018-
// Already a Zod schema
1019-
inputSchema = zodToJsonSchema(tool.inputSchema, {
1020-
strictUnions: true
1021-
}) as Tool['inputSchema'];
1022-
} else if (
1023-
typeof tool.inputSchema === 'object' &&
1024-
Object.keys(tool.inputSchema).length > 0
1025-
) {
1026-
// Raw shape with Zod values
1027-
inputSchema = zodToJsonSchema(z.object(tool.inputSchema), {
1028-
strictUnions: true
1029-
}) as Tool['inputSchema'];
1030-
} else {
1031-
// Empty object or unknown format
1032-
inputSchema = { type: 'object' as const, properties: {} };
1033-
}
1009+
// For other tools, use the SDK's own JSON Schema conversion
1010+
// which handles zod v3/v4/v4-mini compatibility
1011+
const inputSchema: Tool['inputSchema'] = tool.inputSchema
1012+
? (toJsonSchemaCompat(tool.inputSchema, {
1013+
strictUnions: true,
1014+
pipeStrategy: 'input'
1015+
}) as Tool['inputSchema'])
1016+
: { type: 'object' as const, properties: {} };
10341017

10351018
return {
10361019
name,

0 commit comments

Comments
 (0)