feat(mcpbstage): add mcpb bundle staging CLI#9
Merged
Conversation
Address PR review findings: - findArtifact: match on goos/goarch, then disambiguate multiple Binary artifacts (multiple builds or goamd64/goarm variants) by the manifest's binary name; refuse to guess — zero or an irreducibly-ambiguous match set is a loud error, never a silently-wrong binary staged under the target name. - parseTargets: a present-but-empty command now fails loudly, naming the platform, instead of silently dropping it from the bundle. - copyTree: a nested asset directory is an unsupported layout and errors rather than being silently omitted from the bundle. - Docs: CLAUDE.md and README no longer claim "no main/cmd"; both note the cmd/mcpbstage build-time CLI and its Architecture entry. - Tests: cover the sibling-asset copy (previously masked), nested-dir error, empty-override and unparseable-command rejections, nested-key preservation in stampVersion, idempotency, and findArtifact's variant/multi-build paths.
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.
Adds
cmd/mcpbstage, a small stdlib + kong CLI that stages the contents of an.mcpbbundle for the realmcpb packto validate + zip.Why
The go-scaffolds
go-mcptemplate packs.mcpbbundles with an inline shell block (brittle globs,jqversion-stamp, per-platformcp) copied into every generated MCP server. This factors the fragile staging half into one versioned, testable tool;mcpb packstill owns validation + zipping.What it does
mcpbstage --dist dist --manifest mcpb/manifest.json --out dist/mcpb:dist/metadata.json;server.mcp_config(command +platform_overrides) to learn which platform binaries the bundle declares — manifest-driven, no hardcoded platform list;dist/artifacts.json(Binaryentries) — no globbing;<out>/manifest.jsonwith the version stamped in (preserving all other keys), and copies each binary to<out>/server/<name>at mode0755.Fails loudly if any input is missing or a declared platform has no matching artifact.
Tests
go test ./cmd/mcpbstage/— 3/3 (layout + version stamp + 0755, missing-binary, missing-metadata).task ciclean.kongis imported only bycmd/mcpbstage.Release note
Intended to ship as v0.6.0 (new feature). The go-scaffolds template PR pins this version and can't be verified end-to-end until v0.6.0 is tagged/published.
Spec + plan:
docs/superpowers/{specs,plans}/2026-07-07-shared-mcpb-staging*.🤖 Generated with Claude Code