You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my typescript ESM module project (https://github.com/compiler-explorer/compiler-explorer) I tried to install and use this package, and it picks up @modelcontextprotocol/sdk@1.11.0. That package appears to come from git+ssh://git@github.com/modelcontextprotocol/typescript-sdk.git#621ccea...
This git package is missing the dist subdirectory.
// Simple file to test MCP SDK import
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
console.log('McpServer successfully imported:', McpServer);
Run the file with tsx: npx tsx mcp-repro.ts
Expected behavior
The script should successfully import the McpServer class from the SDK and output its details.
Actual behavior
$ npx tsx mcp-repro.ts
node:internal/modules/cjs/loader:1281
const err = new Error(`Cannot find module '${request}'`);
^
Error: Cannot find module '/tmp/mcp-repro/node_modules/@modelcontextprotocol/sdk/dist/cjs/server/mcp.js'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1281:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1269:15)
at resolveExports (node:internal/modules/cjs/loader:638:14)
at Function._findPath (node:internal/modules/cjs/loader:743:31)
at node:internal/modules/cjs/loader:1230:27
at nextResolveSimple (/tmp/mcp-repro/node_modules/tsx/dist/register-D2KMMyKp.cjs:3:942)
at /tmp/mcp-repro/node_modules/tsx/dist/register-D2KMMyKp.cjs:2:2550
at /tmp/mcp-repro/node_modules/tsx/dist/register-D2KMMyKp.cjs:2:1624
at resolveTsPaths (/tmp/mcp-repro/node_modules/tsx/dist/register-D2KMMyKp.cjs:3:760)
at /tmp/mcp-repro/node_modules/tsx/dist/register-D2KMMyKp.cjs:3:1038 {
code: 'MODULE_NOT_FOUND',
path: '/tmp/mcp-repro/node_modules/@modelcontextprotocol/sdk/package.json'
}
Describe the bug
In my typescript ESM module project (https://github.com/compiler-explorer/compiler-explorer) I tried to install and use this package, and it picks up
@modelcontextprotocol/sdk@1.11.0
. That package appears to come fromgit+ssh://git@github.com/modelcontextprotocol/typescript-sdk.git#621ccea...
This git package is missing the
dist
subdirectory.To Reproduce
npx tsx mcp-repro.ts
Expected behavior
The script should successfully import the McpServer class from the SDK and output its details.
Actual behavior
Node.js v22.13.1
Additional context
Related issues:
- Nearly identical to our error - package can't find the specified paths
- Problem with the exports field in package.json not correctly mapping to dist files
- Similar module not found error
- Workaround: add .js extension to imports (though this won't help in our case)
- Another module resolution issue in ESM context
- Very similar error pattern to what we're experiencing
The core issue appears to be in how the SDK is packaged and exported:
"exports": {
"./": {
"import": "./dist/esm/",
"require": "./dist/cjs/*"
}
}
to fail with ERR_MODULE_NOT_FOUND
without being properly built first.
The text was updated successfully, but these errors were encountered: