fix(container): build the image from source, publish to the MCP Registry - #51
Merged
Merged
Conversation
The Dockerfile copied `.smithery/hosted/server.mjs`, which nothing in this repo produces — `scripts/smithery-build.sh` writes `.smithery/stdio/index.js`, and `.smithery/hosted/` comes from Smithery's own CLI build. Every container build failed on the missing file, Fly included, regardless of Smithery's state. The image now builds from source in two stages: esbuild via scripts/build.sh, then a runtime layer carrying only the three packages left external to the bundle (libsodium-sumo, libsodium-wrappers-sumo, undici) plus dist/. Nothing outside this repo is needed to produce it. Added .dockerignore. The build context was 363 MB across 28,573 files — node_modules at 260 MB, a 64 MB local binary and .git at 26 MB, all uploaded to the builder on every deploy. The Smithery path is untouched: smithery.yaml and scripts/smithery-build.sh still produce the stdio MCPB bundle that `pnpm smithery:publish` uploads. Registry publishing: the MCP Registry entry has been pinned at 0.2.1 since 8 March while npm moved to 0.4.0, so the official listing has been pointing at a build whose read tools 404. server.json is corrected to 0.4.0, and CI now publishes to the registry on a `v*` tag, after the npm job — the registry verifies ownership through the package's `mcpName` field, so the version has to exist on npm first. Authentication is GitHub OIDC, so there is no token to expire the way NPM_TOKEN just did. README documents which build produces which artifact, since conflating them is what broke the Dockerfile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things, both about distribution. Neither touches the Smithery publishing path.
The container build has never worked
Nothing in this repo produces
.smithery/hosted/— that path comes from Smithery's own CLI build for its hosted runtime. Sodocker buildfails on a missing file, and sincefly.tomlhas an empty[build]section and defers to the Dockerfile,fly deployfails for the same reason. This is independent of Smithery credits or outages; it would fail with a full balance.The image now builds from source in two stages — esbuild via
scripts/build.sh, then a runtime layer with only the three packages left external to the bundle (libsodium-sumo,libsodium-wrappers-sumo,undici) plusdist/. Nothing outside this repo is required to produce it, so the same image works on Fly, on any container host, and locally.Also added
.dockerignore. The build context was 363 MB across 28,573 files —node_modules260 MB, a 64 MB localindigo-mcp-darwin-arm64binary,.git26 MB — uploaded to the builder on every deploy.Smithery is untouched.
smithery.yamlandscripts/smithery-build.shstill produce the stdio MCPB bundle thatpnpm smithery:publishuploads. The README now spells out which build produces which artifact, because conflating them is exactly what broke the Dockerfile.The MCP Registry listing is five months stale
server.jsonin this repoio.github.IndigoProtocol/indigo-mcpis active in the official registry — the one Claude, VS Code and other clients read — and it has been advertising a build from before the read tools moved to/api/v3. Anyone installing from there gets the version that 404s on everything.server.jsonis corrected to 0.4.0, and CI now publishes to the registry on av*tag so it cannot drift again. Two details worth reviewing:needs: publish. The registry verifies ownership by fetching the npm package and checking itsmcpNamefield, so the version has to be on npm before this runs.id-token: write), not a token. GivenNPM_TOKENexpired and silently broke the 0.4.0 release this morning, one less credential with an expiry date is the point.The job also rewrites
server.jsonfrom the tag before publishing, so the committed value is documentation rather than something that has to be remembered.Verification
Docker's daemon was not running locally, so both stages were reproduced by hand instead: a clean directory containing only the files the Dockerfile copies builds successfully and produces
dist/plus the three WASM files; a second directory withpnpm install --prodresolves to exactly the three runtime packages, andnode dist/index.jsboots and answers:Worth one real
docker buildbefore merging to confirm the container layer itself — everything inside it is verified.Suite: 144 passing; typecheck, lint and format clean.