fix(mcp): declare @modelcontextprotocol/sdk as a root dependency (#231) - #232
Merged
Conversation
The hana-cli-mcp bin (mcp-server/build/index.js) imports @modelcontextprotocol/sdk, but it was only declared in the nested mcp-server/package.json. npm strips nested node_modules from the published tarball, so registry installs fail at module resolution with ERR_MODULE_NOT_FOUND before any config is read (npx, MCP clients). Add @modelcontextprotocol/sdk@^1.29.0 to root dependencies so Node's upward resolution from mcp-server/build/index.js finds it in the root node_modules of an install. Fixes #231
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.
Fixes #231.
Problem
The
hana-cli-mcpbin (./mcp-server/build/index.js) imports@modelcontextprotocol/sdk, but the package only declared it in the nestedmcp-server/package.json. npm strips nestednode_modulesfrom the published tarball, so registry installs can't resolve it and crash at module resolution — before any config or HANA connection:It only worked in a dev checkout, where the nested install made it reachable.
Fix
Add
@modelcontextprotocol/sdk@^1.29.0(the rangemcp-serverwas built against) to the rootdependencies. Node's upward module resolution frommcp-server/build/index.jsthen finds it in the rootnode_modulesof any install.npm-shrinkwrap.jsonupdated accordingly.Verification
Reproduced the published-tarball state by temporarily removing
mcp-server/node_modules, then ran the bin exactly as the issue does:Boots cleanly instead of throwing
ERR_MODULE_NOT_FOUND.