Skip to content

Fix sandbox_proxy.html static file location in MCP inspector server#1086

Open
jimmydief wants to merge 1 commit intomodelcontextprotocol:mainfrom
jimmydief:fix_mcp_apps_sandbox
Open

Fix sandbox_proxy.html static file location in MCP inspector server#1086
jimmydief wants to merge 1 commit intomodelcontextprotocol:mainfrom
jimmydief:fix_mcp_apps_sandbox

Conversation

@jimmydief
Copy link

Summary

Note: Inspector V2 is under development to address architectural and UX improvements. During this time, V1 contributions should focus on bug fixes and MCP spec compliance. See CONTRIBUTING.md for more details.

This PR fixes #1082 which prevents the MCP App sandbox from working.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Refactoring (no functional changes)
  • Test updates
  • Build/CI improvements

Changes Made

Update the static resource path so that it can be loaded correctly on the inspector server.

Related Issues

Fixes #1082.

Testing

  • Tested in UI mode
  • Tested in CLI mode
  • Tested with STDIO transport
  • Tested with SSE transport
  • Tested with Streamable HTTP transport
  • Added/updated automated tests
  • Manual testing performed

Test Results and/or Instructions

Screenshots are encouraged to share your testing results for this change.

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

Additional Context

Copy link
Member

@olaservo olaservo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I think this breaks dev mode? Maybe something like this instead:

import { existsSync } from "fs";

// Inside the route handler (or better, at module scope):
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

// Production: static/ is copied into build/ alongside index.js
let filePath = join(__dirname, "static", "sandbox_proxy.html");

// Dev (tsx): static/ is a sibling of src/, one level up from __dirname
if (!existsSync(filePath)) {
  filePath = join(__dirname, "..", "static", "sandbox_proxy.html");
}

@jimmydief jimmydief force-pushed the fix_mcp_apps_sandbox branch from e56c2db to 2b409cd Compare February 20, 2026 00:51
@jimmydief
Copy link
Author

@olaservo Thanks! Pushed.

@jimmydief jimmydief force-pushed the fix_mcp_apps_sandbox branch from 2b409cd to ddbf22a Compare February 20, 2026 01:00
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.

MCP App rendering fails with invalid static resource path

2 participants

Comments