Skip to content

feat: enhanced structural validation for validate command#209

Open
bryan-anthropic wants to merge 1 commit intomainfrom
feat/enhanced-validate
Open

feat: enhanced structural validation for validate command#209
bryan-anthropic wants to merge 1 commit intomainfrom
feat/enhanced-validate

Conversation

@bryan-anthropic
Copy link
Collaborator

Summary

  • Adds three pre-pack structural validators to mcpb validate that catch common runtime failures early:
    • Entry point: verifies file exists, extension matches server type, binary has executable bit
    • Command variables: scans mcp_config for unrecognized ${...} patterns (e.g. ${BUNDLE_ROOT} which silently fails at runtime)
    • Sensitive files: warns about credentials.json, *.pem, *.key, .ssh/ etc. that would be bundled
  • Errors fail validation; warnings print but pass
  • validateManifest() accepts optional { projectDir } to support external manifest paths

Closes #57

Test plan

  • yarn build — clean
  • yarn lint — clean
  • yarn test — 229 pass (218 existing + 11 new)
  • E2E: validate catches ${BUNDLE_ROOT} → fix to ${__dirname} → pack → MCP initialize succeeds
  • E2E: missing entry_point → exits 1; binary not executable → exits 1
  • E2E: credentials.json in subdir → warning (exits 0)

🤖 Generated with Claude Code

Add three pre-pack validators to catch common runtime failures early:

- validateEntryPoint: checks file exists, extension matches server type,
  binary has executable bit (Unix)
- validateCommandVariables: scans mcp_config for unrecognized ${...}
  variables against the runtime allowlist
- validateSensitiveFiles: warns about credentials.json, *.pem, *.key,
  .ssh/, etc. that would be bundled

validateManifest() now accepts optional { projectDir } to separate the
manifest directory from the source file directory.

Co-Authored-By: Claude Opus 4.6 (1M context) <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.

Provide a Validation/Debug Tool for Verifying DXT File

1 participant