Skip to content

fix(install): install runtime dependencies only (--omit=dev) (#203) - #209

Open
MikeBishop wants to merge 1 commit into
obra:mainfrom
MikeBishop:fix/install-omit-dev
Open

MikeBishop wants to merge 1 commit into
obra:mainfrom
MikeBishop:fix/install-omit-dev

Conversation

@MikeBishop

Copy link
Copy Markdown

Summary

The first-run self-heal install (runNpmInstall() in cli/install-runner.js) runs a plain npm install, which also installs devDependencies: tsx, esbuild, vitest, typescript and their dependencies. The plugin runs the prebuilt dist/, so none of them are used at runtime.

They aren't just dead weight. On my machine, esbuild's postinstall (tsx/node_modules/esbuild/bin/esbuild --version) died with SIGSEGV, failing the whole npm install, so the runtime dependencies were never installed and the MCP server could never start. Details in #203.

Fix

Pass --omit=dev to the install. One argument in cli/install-runner.js, with a comment saying why. #195 already uses npm ci --omit=dev for provisioning.

This doesn't address #203's main point, moving the install out of the MCP handshake. That's a design decision about what the user sees in the meantime, and I've left it to you.

Test plan

  • New test in test/mcp-install-runner.test.ts: runNpmInstall() spawns npm install with --omit=dev in the plugin root. It fails against main.
  • npm test (full suite): 351/351 pass, 63 test files.
  • End to end: exported the branch to an empty directory (no node_modules) and started cli/mcp-server-wrapper.js with an MCP initialize + tools/list on stdin. The wrapper detected the missing dependencies, installed 184 packages (242 without --omit=dev), scripts/postinstall.js passed, node_modules held no tsx/esbuild/vitest/typescript, and the server answered with search and read. Wall time was about 2.5 minutes either way; the large runtime packages dominate, so this is about reliability, not speed.

Refs #203.


Drafted with AI assistance (Claude Code). I reviewed the change and ran the end-to-end install on my own machine.

🤖 Generated with Claude Code

The self-heal install in cli/install-runner.js ran a plain `npm install`,
which also installs devDependencies (tsx, esbuild, vitest, typescript).
The plugin runs the prebuilt dist/, so none of them are used at runtime.
They add ~58 packages to every first-run install, and esbuild's own
postinstall binary check can fail the whole install: on my machine it
died with SIGSEGV and the runtime dependencies were never installed.

Pass --omit=dev. A fresh checkout started through mcp-server-wrapper.js
now installs 184 packages instead of 242, contains no dev tooling, and
answers initialize and tools/list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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