Repository navigation
Declare zod as an mcp runtime dependency so tools/list works in a clean install - #99
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
@mobile-reality/mdma-mcp@0.3.0failstools/listin a clean install withMCP error -32603: Cannot read properties of undefined (reading 'def').src/index.tsimportszodat runtime butzodwas only a devDependency, so a cleannpm installhoists zod 4.6.7 for the MCP while@mobile-reality/mdma-speckeeps its own zod 3. The SDK then fails convertingbuild-system-prompt's input schema, which mixes a zod 3 spec schema into the MCP'sz. This PR declareszod: ^3.24.0(the spec's range) independenciesand adds two guards so it cannot recur unnoticed.Key files
packages/mcp/package.json—zodmoved fromdevDependenciestodependencies(^3.24.0); newsmoke:packscript.pnpm-lock.yamlfollows (importer entry only).packages/mcp/tests/dependencies.test.ts— scanssrc/**/*.tsimport statements (relative andnode:ignored, scoped names reduced to@scope/name) and asserts each package is independenciesorpeerDependencies. Fails onmain(['zod']), passes now.packages/mcp/scripts/smoke-pack.mjs—pnpm pack, install the tarball into a fresh temp dir with a fresh npm cache and--ignore-scripts, startdist/bin/mdma-mcp.jsover stdio with the SDK client from that install, calltools/listandget-spec, compare tool names withmanifest.json, print version, tools and PASS/FAIL, exit non-zero on failure.packages/mcp/README.md— one added line in the Release checklist ("Bump + test") forpnpm smoke:pack..changeset/declare-mcp-zod.md— patch for@mobile-reality/mdma-mcp.Before / after
pnpm --filter @mobile-reality/mdma-mcp smoke:packon currentmaincode (before the fix):After the fix:
The new test before the fix:
expected [ 'zod' ] to deeply equal []; after: 53 of 53 pass.Verified with
pnpm install --frozen-lockfile,pnpm build,pnpm typecheck,pnpm lint,pnpm --filter @mobile-reality/mdma-mcp test,smoke:packand rootpnpm test, all green. Unreviewed fixes: none (the review verdict was merge-with-followups, BLOCKING 0; the only follow-up, a long commit subject, was fixed by amending before the push).Decisions
@mobile-reality/mdma-parser@0.3.1into an empty dir with a fresh cache and--prefer-online, then forced zod 4.6.7 to the top level (spec nests its zod 3): importing and processing anmdmablock throughremarkMdmaworks in both cases. All threezodimports inpackages/parser/srcareimport type, so the compiled JS never loads zod; only the.d.tsfiles referenceZodType. No runtime breakage, so no change (and no parser changeset).zodimport statement insrc; the only references are type-positionimport('zod').ZodTypecasts.import/export ... fromstatements only, so package names inside string literals (e.g.list-packages.tsusage text) are not counted.smoke-pack.mjschecks the served tool names against thetoolslist inmanifest.jsoninstead of a hard-coded count.Before publishing the patch
After the Version Packages PR bumps
@mobile-reality/mdma-mcp, align the version strings by hand before publishing:server.json(top-level andpackages[0].version),manifest.json(same two), and theMcpServer({ version })call insrc/index.ts. Then runpnpm smoke:packand expect PASS.