Skip to content

fix: declare zod runtime dependencies#4289

Open
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/sequential-thinking-zod-dependency
Open

fix: declare zod runtime dependencies#4289
he-yufeng wants to merge 1 commit into
modelcontextprotocol:mainfrom
he-yufeng:fix/sequential-thinking-zod-dependency

Conversation

@he-yufeng
Copy link
Copy Markdown

Fixes #4288.

Summary

@modelcontextprotocol/server-sequential-thinking imports zod directly from its runtime entrypoint, but the package did not declare zod as a dependency. With strict package isolation, consumers can install the server without a local zod, then hit ERR_MODULE_NOT_FOUND at runtime.

While checking the same dependency boundary, I found two other published server packages with the same direct runtime import:

  • @modelcontextprotocol/server-memory
  • @modelcontextprotocol/server-filesystem

This patch declares zod in those three packages, using the same ^4.0.0 range already used by @modelcontextprotocol/server-everything.

Validation

  • npm install --package-lock-only --ignore-scripts
  • npm install --ignore-scripts
  • npm run build --workspace=@modelcontextprotocol/server-sequential-thinking
  • npm run build --workspace=@modelcontextprotocol/server-memory
  • npm run build --workspace=@modelcontextprotocol/server-filesystem
  • npm test --workspace=@modelcontextprotocol/server-sequential-thinking
  • npm test --workspace=@modelcontextprotocol/server-memory
  • npm test --workspace=@modelcontextprotocol/server-filesystem
  • npm exec prettier -- --check src/filesystem/package.json src/memory/package.json src/sequentialthinking/package.json package-lock.json
  • git diff --check

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.

zod declared in both dependencies and peerDependencies causes ERR_MODULE_NOT_FOUND with pnpm strict isolation

1 participant