Skip to content

feat: add --manifest flag to pack command#208

Open
bryan-anthropic wants to merge 1 commit intomainfrom
feat/pack-manifest-flag
Open

feat: add --manifest flag to pack command#208
bryan-anthropic wants to merge 1 commit intomainfrom
feat/pack-manifest-flag

Conversation

@bryan-anthropic
Copy link
Collaborator

Summary

  • Adds -m, --manifest <path> option to mcpb pack so users can specify a manifest file outside the project directory
  • Manifest resolves relative to CWD, is validated, and injected into the bundle
  • Errors immediately with "Manifest file not found" when the explicit path doesn't exist (no interactive prompt)
  • Backward compatible — cleanMcpb() and other callers work unchanged

Closes #87

Test plan

  • yarn build — clean
  • yarn lint — clean
  • yarn test — 220 pass (218 existing + 2 new)
  • E2E: pack with --manifest → unpack → MCP initialize + tools/list → responds correctly
  • E2E: --manifest /nonexistent → exits 1

🤖 Generated with Claude Code

Allow specifying an external manifest file path with `mcpb pack --manifest <path>`.
The manifest resolves relative to CWD, is validated, injected into the bundle,
and errors immediately if the specified file is not found.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Collaborator Author

@bryan-anthropic bryan-anthropic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by Claude Code

Small, clean feature addition. Observations:

  • Commander integration is clean — .option('-m, --manifest <path>', ...) follows the existing CLI patterns in cli.ts.
  • resolve(customManifestPath) ensures the manifest path resolves relative to CWD, which is the expected behavior for a CLI flag (as opposed to relative to the project directory).
  • Manifest injection via files["manifest.json"] = { data, mode } correctly overwrites any manifest that may exist in the project directory. This is intentional — an explicit --manifest flag should take precedence over auto-discovered manifests.
  • Error handling is appropriate: when an explicit path is provided but not found, the command errors immediately rather than falling back to interactive prompts. This is the right UX for a flag-driven workflow.
  • Both test cases (valid manifest path succeeds, invalid path fails) follow the existing test patterns and cover the key scenarios.
  • Fully backward compatible — omitting --manifest preserves existing behavior.

No issues found.

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.

[Feature Request]: manifest.json file location could be specifiable in the pack command

1 participant