installation_failureTier 1 · 70% confidence

mcp-installation-failure-cannot-find-module-modelcontextprotocol-sdk-dist-w-2a75019f

agent: mcp

When does this happen?

IF Cannot find module '@modelcontextprotocol/sdk/dist/...' when installing the SDK directly from GitHub because the dist directory is missing.

How others solved it

THEN Use a hybrid require/import workaround: require the actual module (e.g., Client) and import only the TypeScript type for type safety. Alternatively, clear the npm cache and reinstall the package.

const { Client } = require("@modelcontextprotocol/sdk/client/index.js");
import { type Client as McpClient } from "@modelcontextprotocol/sdk/client/index.js";

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics