Skip to content

fix: update ZIP EOCD comment_length when signing#204

Open
bryan-anthropic wants to merge 1 commit intomainfrom
fix/eocd-comment-length
Open

fix: update ZIP EOCD comment_length when signing#204
bryan-anthropic wants to merge 1 commit intomainfrom
fix/eocd-comment-length

Conversation

@bryan-anthropic
Copy link
Collaborator

Summary

Fixes #194.

  • The signing function appends a signature block to the MCPB (ZIP) file without updating the EOCD comment_length field, causing strict ZIP parsers (including Claude Desktop's) to reject signed files.
  • Added findEocdOffset() helper to locate the EOCD record by scanning backwards for magic bytes 0x06054b50.
  • Before appending the signature block, the EOCD comment_length is now updated to include the signature block size.

Test plan

  • New test validates EOCD comment_length is correctly updated after signing
  • All existing signing tests continue to pass (110 total)
  • yarn build:code compiles cleanly
  • yarn lint passes

🤖 Generated with Claude Code

The signMcpbFile function appended a signature block to the ZIP file but
did not update the EOCD comment_length field. Strict ZIP parsers (like
Claude Desktop's) rejected these files because the declared comment
length didn't account for the appended signature data.

Now scans backwards for the EOCD magic bytes, reads the current
comment_length, and adds the signature block length before concatenating.

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.

Bug Report: Claude Desktop 1.1.3647 (8f7c53) 2026-02-19T15:02:19.000Z can't install signed extensions

1 participant