Describe the bug
zod is declared in both dependencies and peerDependencies in package.json. With strict package managers (pnpm with enableGlobalVirtualStore or default strict isolation), the peer dependency declaration takes precedence — pnpm does not co-locate zod alongside the package in the virtual store. Packages that depend on @modelcontextprotocol/sdk but do not explicitly declare zod themselves (e.g. @modelcontextprotocol/server-sequential-thinking) fail at runtime with ERR_MODULE_NOT_FOUND when the SDK tries to import zod via ESM.
To Reproduce
Steps to reproduce the behavior:
- Create a project using pnpm with
enableGlobalVirtualStore: true (or default strict mode)
- Install any package that depends on @modelcontextprotocol/sdk without declaring zod itself:
pnpm add @modelcontextprotocol/server-sequential-thinking
- Run the package:
pnpm exec mcp-server-sequential-thinking or pnpx -y @modelcontextprotocol/server-sequential-thinking@2025.12.18
Expected behavior
Package starts successfully. zod is a declared dependency of the SDK — it should be available at runtime without the consumer explicitly installing it.
Logs
❯ pnpm exec mcp-server-sequential-thinking
node:internal/modules/run_main:107
triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'zod' imported from /home/user/.pnpm-store/v11/links/@modelcontextprotocol/server-sequential-thinking/2025.12.18/b16d7229fe63eba8f5c9df434194638ecedcbeff81abdf52f136fde8d100ab1e/node_modules/@modelcontextprotocol/server-sequential-thinking/dist/index.js
Did you mean to import "zod/index.cjs"?
at Object.getPackageJSONURL (node:internal/modules/package_json_reader:301:9)
at packageResolve (node:internal/modules/esm/resolve:768:81)
at moduleResolve (node:internal/modules/esm/resolve:859:18)
at defaultResolve (node:internal/modules/esm/resolve:992:11)
at #cachedDefaultResolve (node:internal/modules/esm/loader:691:20)
at #resolveAndMaybeBlockOnLoaderThread (node:internal/modules/esm/loader:708:38)
at ModuleLoader.resolveSync (node:internal/modules/esm/loader:740:52)
at #resolve (node:internal/modules/esm/loader:673:17)
at ModuleLoader.getOrCreateModuleJob (node:internal/modules/esm/loader:593:35)
at ModuleJob.syncLink (node:internal/modules/esm/module_job:163:33) {
code: 'ERR_MODULE_NOT_FOUND'
}
Node.js v24.16.0
Additional context
Node version: v24.16.0
Pnpm version: 11.5.2 with enableGlobalVirtualStore: true
Describe the bug
zod is declared in both
dependenciesandpeerDependenciesin package.json. With strict package managers (pnpm with enableGlobalVirtualStore or default strict isolation), the peer dependency declaration takes precedence — pnpm does not co-locate zod alongside the package in the virtual store. Packages that depend on@modelcontextprotocol/sdkbut do not explicitly declarezodthemselves (e.g.@modelcontextprotocol/server-sequential-thinking) fail at runtime with ERR_MODULE_NOT_FOUND when the SDK tries to importzodvia ESM.To Reproduce
Steps to reproduce the behavior:
enableGlobalVirtualStore: true(or default strict mode)pnpm add @modelcontextprotocol/server-sequential-thinkingpnpm exec mcp-server-sequential-thinkingorpnpx -y @modelcontextprotocol/server-sequential-thinking@2025.12.18Expected behavior
Package starts successfully. zod is a declared dependency of the SDK — it should be available at runtime without the consumer explicitly installing it.
Logs
Additional context
Node version: v24.16.0
Pnpm version: 11.5.2 with
enableGlobalVirtualStore: true