Skip to content

fix(docker): ship @appstrate/mcp-transport node_modules in runtime image#627

Merged
pierrecabriere merged 1 commit into
mainfrom
fix/dockerfile-mcp-transport-runtime-deps
Jun 9, 2026
Merged

fix(docker): ship @appstrate/mcp-transport node_modules in runtime image#627
pierrecabriere merged 1 commit into
mainfrom
fix/dockerfile-mcp-transport-runtime-deps

Conversation

@pierrecabriere

Copy link
Copy Markdown
Contributor

Problem

Production v1.0.0-beta.26 crash-loops at boot (HTTP 503):

error: Module "mcp" could not be loaded: Cannot find module
'@modelcontextprotocol/sdk/client/index.js' from
'/app/packages/mcp-transport/src/index.ts'
  at loadModules (apps/api/src/lib/modules/module-loader.ts:109)
  at async boot (apps/api/src/lib/boot.ts:91)

Root cause

  • The mcp built-in module (added to default MODULES) imports @appstrate/mcp-transport.
  • @modelcontextprotocol/sdk is nested under packages/mcp-transport/node_modules/ (bun did not hoist it to root).
  • The main Dockerfile runtime stage copies node_modules via a manual allowlist (explicitly not graph-derived). The list omitted mcp-transport, so its nested SDK never shipped → crash-loop. The allowlist's own comment predicts exactly this failure mode.
  • runtime-pi/Dockerfile already copies packages/mcp-transport/node_modules (L153) — only the main image had the gap.

Fix

One line added to the runtime allowlist:

COPY --from=deps /app/packages/mcp-transport/node_modules ./packages/mcp-transport/node_modules

Follow-up (not in this PR)

runtime-pi/sidecar/Dockerfile copies mcp-transport src + package.json but no node_modules — latent gap if the SDK isn't otherwise resolved there. Sidecar shipped mcp-transport since before beta.26 without issue, so likely fine; worth a separate verification.

🤖 Generated with Claude Code

The `mcp` built-in module (added to default MODULES) imports
@appstrate/mcp-transport, whose @modelcontextprotocol/sdk dependency is
nested under packages/mcp-transport/node_modules (not hoisted to root).
The runtime stage's manual node_modules allowlist never included
mcp-transport, so beta.26 crash-looped at boot:

  Module "mcp" could not be loaded: Cannot find module
  '@modelcontextprotocol/sdk/client/index.js' from
  '/app/packages/mcp-transport/src/index.ts'

runtime-pi/Dockerfile already copies this (L153); the main image did not.
Add the missing COPY to the allowlist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pierrecabriere pierrecabriere merged commit 6944030 into main Jun 9, 2026
9 checks passed
@pierrecabriere pierrecabriere deleted the fix/dockerfile-mcp-transport-runtime-deps branch June 9, 2026 03:26
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.

1 participant