Skip to content

fix: read memory version from package.json, add missing zod deps - #4557

Open
Timelovers wants to merge 5 commits into
modelcontextprotocol:mainfrom
Timelovers:fix/memory-version-and-zod-deps
Open

fix: read memory version from package.json, add missing zod deps#4557
Timelovers wants to merge 5 commits into
modelcontextprotocol:mainfrom
Timelovers:fix/memory-version-and-zod-deps

Conversation

@Timelovers

Copy link
Copy Markdown

Fixes #4406, fixes #4330.

Two small fixes:

  1. memory server version — reads serverInfo.version from package.json at startup instead of hardcoding "0.6.3", so it stays in sync with the published package version.

  2. missing zod dependencyzod is imported at runtime by both server-memory and server-sequential-thinking but was only available transitively through @modelcontextprotocol/sdk. With strict package managers (pnpm), this causes ERR_MODULE_NOT_FOUND at startup. Added zod: "^3" to both dependencies.

- 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>
@Timelovers

Copy link
Copy Markdown
Author

Hi — friendly ping. Let me know if any changes are needed. Thanks!

@knoal knoal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 knoal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Verify the exact zod version specified (^3 is permissive — it pulls 3.x including 3.24+ which may have breaking changes)
  2. Check for duplicate zod installs in node_modules
  3. Either pin zod to a specific version, or hoist zod to the workspace root via package.json workspaces

HOLD until CI is green.

— sophia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants