fix: resolve sandbox_proxy.html path in Docker container - #1736
Conversation
The compiled server looks for sandbox_proxy.html at join(__dirname, '..', 'static', ...) which resolves to /app/server/static/ in Docker. However, the Dockerfile only copies server/build/ to the production image, not server/static/. Fix: reference static files relative to the build output (join(__dirname, 'static', ...)) since the build process already copies static/ into build/static/. Also add explicit COPY of server/static/ in the Dockerfile as a safety net. Fixes modelcontextprotocol#1082
|
Closing: v1 is deprecated. Thank you for this contribution, and apologies for the long wait for a response. v1 will receive security fixes only. We reviewed every open v1 PR for security impact before closing — see the backlog triage in #1819 — and a small number were retained for a final If the underlying problem still exists in v2, we'd genuinely like to know. Please open an issue describing it against v2. Note that we accept external contributions as issues rather than pull requests — maintainers handle design and implementation through a prompt-driven workflow. See Thanks again for taking the time to contribute to the Inspector. |
Summary
The compiled server looks for sandbox_proxy.html at join(__dirname, '..', 'static', ...) which resolves to /app/server/static/ in Docker. However, the Dockerfile only copies server/build/ to the production image, not server/static/.
reference static files relative to the build output (join(__dirname, 'static', ...)) since the build process already copies static/ into build/static/. Also add explicit COPY of server/static/ in the Dockerfile for insurance
Type of Change
Changes Made
Related Issues
Testing
Test Results and/or Instructions
use curl -v http://localhost:6277/sandbox when you started docker container with network host,normally it return html
Screenshots are encouraged to share your testing results for this change.
Checklist
npm run prettier-fix)Breaking Changes
None
Additional Context
None