fix: read server description from package.json instead of manifest.json - #55
Merged
Conversation
The server read ../manifest.json at startup, but package.json declares "files": ["dist"], so manifest.json is never included in the npm tarball. Running `npx pcm-mcp@0.4.0` crashed with ENOENT before the MCP handshake, so no pcm_* tool was ever registered. package.json is present in both the npm tarball and the .mcpb bundle and already carries the same description string, so read it from there. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes a startup crash in the published npm package by removing the runtime dependency on manifest.json (which is not included in the npm tarball) and instead reading the server metadata from package.json, which is always shipped.
Changes:
- Read both
versionanddescriptionfrom../package.jsonat startup. - Remove the startup-time read of
../manifest.jsonto preventENOENTwhen installed via npm.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Problem
npx pcm-mcp@0.4.0crashes immediately at startup, before any MCP exchange:No
pcm_*tool is ever registered, so the server is unusable when installed from npm.Cause
src/index.tsread../manifest.jsonat startup to get the server description, butpackage.jsondeclares"files": ["dist"].manifest.jsonlives at the repo root (for the.mcpbbundle) and is therefore never included in the published npm tarball, which only contains:The
.mcpbbundle was unaffected because it ships the repo root, which is why the regression went unnoticed. This is a 0.4.0 regression — 0.3.0 does not readmanifest.jsonat all and starts fine.Fix
Read both
versionanddescriptionfrompackage.json, which is always present in the npm tarball and in the.mcpbbundle, and already carries the exact same description string. The description exposed over MCP is unchanged.