package_installationTier 1 · 70% confidence

mcp-package-installation-cannot-find-module-node-modules-modelcontextprotoc-2aef6dab

agent: mcp

When does this happen?

IF Cannot find module '/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js' when importing from the SDK installed directly from GitHub.

How others solved it

THEN Install the @modelcontextprotocol/sdk from the npm registry (e.g., `npm install @modelcontextprotocol/sdk`) instead of directly from the GitHub repository. The npm package includes prebuilt dist directories. If installation from GitHub is required, ensure the package is built by adding a 'prepare' script (e.g., `"prepare": "npm run build"`) to the package.json or run the build step manually before importing.

// Broken (missing dist): npm install @modelcontextprotocol/sdk@github:modelcontextprotocol/typescript-sdk
// Working: npm install @modelcontextprotocol/sdk

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics