Skip to content

fix: include server/static in published package files#1113

Merged
olaservo merged 1 commit intomodelcontextprotocol:mainfrom
jwoods02:fix/sandbox-proxy-missing-static
Feb 25, 2026
Merged

fix: include server/static in published package files#1113
olaservo merged 1 commit intomodelcontextprotocol:mainfrom
jwoods02:fix/sandbox-proxy-missing-static

Conversation

@jwoods02
Copy link
Contributor

@jwoods02 jwoods02 commented Feb 24, 2026

Summary

The MCP Apps sandbox proxy fails to load when the inspector is installed from npm. The /sandbox endpoint returns:

MCP Apps sandbox not loaded: Error: ENOENT: no such file or directory, open '.../server/static/sandbox_proxy.html'

The files arrays in package.json and server/package.json only include build/, so server/static/ is excluded from the published package. The server resolves the file via join(__dirname, "..", "static", "sandbox_proxy.html") — which works from a repo checkout (where server/static/ exists alongside server/src/), but not from the npm package where only server/build/ is shipped.

This doesn't surface during development because the source directory layout satisfies the path. It only breaks for consumers installing from npm.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Changes Made

Added "server/static" to the root files array and "static" to server/package.json files array. No code changes.

Related Issues

Couldn't find an existing issue — happy to open one if preferred.

Testing

  • Tested in UI mode
  • Tested with Streamable HTTP transport
  • Manual testing performed

Test Results and/or Instructions

Reproduce: Install the inspector from npm, connect to an MCP server with tools that have _meta.ui.resourceUri, open the Apps tab — sandbox fails with ENOENT.

Verify: npm pack --dry-run should now include server/static/sandbox_proxy.html in the tarball. Before this change it only included server/build/static/sandbox_proxy.html (which the code never resolves to).

Checklist

  • Code follows the style guidelines (ran npm run prettier-fix)
  • Self-review completed
  • Code is commented where necessary
  • Documentation updated (README, comments, etc.)

Breaking Changes

None.

The sandbox_proxy.html file was not shipped in the npm package because
the files arrays in both package.json and server/package.json only
included the build directory. The server code resolves the file via
join(__dirname, '..', 'static', 'sandbox_proxy.html') which expects
static/ as a sibling of build/, but it was missing from the package.
@olaservo olaservo merged commit bb791cd into modelcontextprotocol:main Feb 25, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants