Commit 464e8f8
committed
fix: add Zod v3/v4 compatibility for MCP SDK 1.23.0
MCP SDK 1.23.0 now supports both Zod v3 and v4, which have different
internal structures. This caused context parameter injection to fail.
Changes:
- Add zod-compat.ts with version-agnostic detection and utilities
- Update context-parameters.ts to use zod-compat utilities
- Update tracingV2.ts to use zod-compat for schema shape access
- Update Zod dependency to support both v3 and v4
- Add comprehensive tests for zod-compat utilities
Tested with MCP SDK versions 1.21.2 and 1.23.0.1 parent 580f1fc commit 464e8f8
File tree
6 files changed
+530
-73
lines changed- src
- modules
- tests
6 files changed
+530
-73
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
24 | 10 | | |
25 | 11 | | |
26 | 12 | | |
| |||
43 | 29 | | |
44 | 30 | | |
45 | 31 | | |
46 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
47 | 36 | | |
48 | 37 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
| 38 | + | |
53 | 39 | | |
54 | 40 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
76 | 51 | | |
77 | 52 | | |
78 | 53 | | |
| |||
84 | 59 | | |
85 | 60 | | |
86 | 61 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
93 | 66 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
99 | 71 | | |
100 | 72 | | |
101 | 73 | | |
| |||
115 | 87 | | |
116 | 88 | | |
117 | 89 | | |
118 | | - | |
119 | | - | |
| 90 | + | |
120 | 91 | | |
121 | 92 | | |
122 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
332 | 333 | | |
333 | 334 | | |
334 | 335 | | |
335 | | - | |
| 336 | + | |
| 337 | + | |
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
| |||
0 commit comments