Skip to content

ERR_PACKAGE_PATH_NOT_EXPORTED with @modelcontextprotocol/express #1858

@maximemoreillon

Description

@maximemoreillon

Describe the bug

I am getting a ERR_PACKAGE_PATH_NOT_EXPORTED with message No "exports" main defined in C:\Users\myusersmyproject\node_modules\@modelcontextprotocol\express\package.json when running the @modelcontextprotocol/express example as per the usage guide here

import { createMcpExpressApp } from '@modelcontextprotocol/express';
const app = createMcpExpressApp();

This looks similar to #726 , #427

To Reproduce

Node version 24.14.1 LTS on Windows 11.

Project initialized with

npm i -D typescript
npx tsc --init

verbatimModuleSyntax commented out in tsconfig

Expected behavior

Having no error

Additional context

Dependencies:

{
  // ...
  "dependencies": {
    "@modelcontextprotocol/express": "^2.0.0-alpha.2",
    "@modelcontextprotocol/node": "^2.0.0-alpha.2",
    "@modelcontextprotocol/server": "^2.0.0-alpha.2",
    "express": "^5.2.1"
  },
  "devDependencies": {
    "@types/express": "^5.0.6",
    "typescript": "^6.0.2"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions