Skip to content

Package attaches process signal handlers #817

Open

Description

@nikhilmat

Describe the bug
Installing the @modelcontextprotocol/sdk package will include examples, which add signal handlers to process of application.

To Reproduce
Steps to reproduce the behavior:

  1. Install version 1.16.0 of @modelcontextprotocol/sdk
  2. Examine installed node_module folder (node_modules/@modelcontextprotocol/sdk/dist/esm/examples)
  3. Notice that examples are loaded due to exports declaration

Expected behavior
Examples should not be included in production distribution and signal handlers should not be attached

Logs
If applicable, add logs to help explain your problem.

Additional context
This causes some downstream plugins (like our webserver signal processor) to have issues. Seems like these were included unintentionally during the packaging process.

Activity

  1. added
    ready for workEnough information for someone to start working on
    P1Significant bug affecting many users, highly requested feature
    on Oct 27, 2025
  2. added
    v2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes
    on Apr 1, 2026
  3. ghost added
    P2Moderate issues affecting some users, edge cases, potentially valuable feature
    on Apr 17, 2026
  4. ghost added
    fix proposedBot has a verified fix diff in the comment
    on Apr 17, 2026
  5. ghost removed
    P1Significant bug affecting many users, highly requested feature
    on Apr 17, 2026
  6. MustafaKemal0146 commented on Jul 16, 2026

    @MustafaKemal0146

    Hi, I verified this against the current v1.x branch. The v2 main layout no longer has this packaging path, but both tsconfig.prod.json and tsconfig.cjs.json on v1.x still compile src/examples/** into dist, and the wildcard package export makes those example entry points importable. Importing a server example can then attach process signal handlers as a module side effect.

    I can submit a focused v1.x fix that excludes src/examples/** from both production builds, with regression coverage that inspects the packed artifact to ensure example entry points are absent while supported SDK subpaths remain available. I also found no open or draft PR implementing this packaging change. Is this available for community contribution, and may I be assigned before starting implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingfix proposedBot has a verified fix diff in the commentready for workEnough information for someone to start working onv2Ideas, requests and plans for v2 of the SDK which will incorporate major changes and fixes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions