fix: read memory version from package.json, add missing zod deps - #4557
fix: read memory version from package.json, add missing zod deps#4557Timelovers wants to merge 5 commits into
Conversation
- Read serverInfo.version from package.json instead of hardcoding "0.6.3", so it stays in sync with the published package version - Add missing zod dependency to server-memory and server-sequential-thinking package.json files — both import zod at runtime but it was only available transitively through the SDK Fixes modelcontextprotocol#4406, fixes modelcontextprotocol#4330 Co-authored-by: Timelovers <46080686+Timelovers@users.noreply.github.com>
Co-authored-by: Timelovers <46080686+Timelovers@users.noreply.github.com>
Co-authored-by: Timelovers <46080686+Timelovers@users.noreply.github.com>
Co-authored-by: Timelovers <46080686+Timelovers@users.noreply.github.com>
createRequire is the standard Node.js ESM pattern for reading JSON files and avoids file path resolution issues in CI test environments. Co-authored-by: Timelovers <46080686+Timelovers@users.noreply.github.com>
|
Hi — friendly ping. Let me know if any changes are needed. Thanks! |
knoal
left a comment
There was a problem hiding this comment.
Reviewing via MCE A/B pilot 7 (sophia@hermes.local).
Summary
Replaces hardcoded version "0.6.3" with a runtime import from package.json via createRequire(import.meta.url). Adds zod to dependencies where it was missing.
What's good
- Drift-prone hardcoded version is the bug — every release requires manually updating the string. The fix uses the standard ESM pattern for reading package.json at runtime.
- Cross-cutting fix — the same hardcoded version bug is fixed in at least 2-3 server packages (memory, sequentialthinking, time).
APPROVE — standard hygiene fix. The use of createRequire(import.meta.url) is the correct ESM pattern.
— sophia
knoal
left a comment
There was a problem hiding this comment.
Re-checking — the Test filesystem, Test everything, and Test memory workflows are FAILING on this PR. Most likely cause: the zod: ^3 dependency added to memory/sequentialthinking/time packages is conflicting with whatever zod the rest of the workspace uses.
Recommend:
- Verify the exact zod version specified (^3 is permissive — it pulls 3.x including 3.24+ which may have breaking changes)
- Check for duplicate zod installs in
node_modules - Either pin zod to a specific version, or hoist zod to the workspace root via
package.jsonworkspaces
HOLD until CI is green.
— sophia
Fixes #4406, fixes #4330.
Two small fixes:
memory server version — reads
serverInfo.versionfrompackage.jsonat startup instead of hardcoding"0.6.3", so it stays in sync with the published package version.missing zod dependency —
zodis imported at runtime by bothserver-memoryandserver-sequential-thinkingbut was only available transitively through@modelcontextprotocol/sdk. With strict package managers (pnpm), this causesERR_MODULE_NOT_FOUNDat startup. Addedzod: "^3"to bothdependencies.