You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug mcpb sign appends the signature block (MCPB_SIG_V1 + 4-byte LE length + DER PKCS#7 + MCPB_SIG_END) after the zip's end-of-central-directory (EOCD) record without declaring those bytes in the EOCD comment-length field. The result is not a strictly valid zip: the EOCD declares a 0-byte comment, but trailing data follows. Lenient parsers (Python zipfile, Info-ZIP unzip) tolerate this; strict parsers (yauzl) reject the file outright. Claude Desktop uses a strict parser, so a signed .mcpb cannot be previewed or installed in Claude Desktop at all - signing a bundle currently breaks it for the flagship consumer of the format.
In Claude Desktop: Settings -> Extensions -> Install Extension -> select test.mcpb
The extension preview fails with an "Invalid comment length" unzip error (see Logs). The same bundle installs fine before signing.
Expected behavior
Signed bundles remain installable in Claude Desktop (and parseable by any spec-strict zip reader). Trailing data can be made zip-legal by declaring it as the archive comment: patch the 2-byte comment-length field at EOCD offset +20 to the size of the appended signature block. Verified empirically: with that one patch, the same signed bundle previews and installs correctly in Claude Desktop, and extractSignatureBlock still finds the signature (it scans backwards for MCPB_SIG_END and is unaffected by the EOCD field).
Logs
Failed to preview extension: Failed to read or unzip file: Invalid comment length.
Expected: 2264. Found: 0. Are there extra bytes at the end of the file?
Or is the end of central dir signature `PK☺☻` in the comment?
2264 is exactly the appended signature block in this repro: 11-byte header + 4-byte length + 2237-byte DER + 12-byte footer.
Additional context
@anthropic-ai/mcpb 2.1.2; Claude Desktop for Windows (current as of June 2026).
Implementation wrinkle for the fix: the signature digest is computed over the pre-signature bytes, so the EOCD patch must happen before signing or the digest goes stale. The signature length for a given cert/key is deterministic, so a two-pass sign (or patching with the known length upfront) resolves the chicken-and-egg.
Zip comments cap at 65,535 bytes, which comfortably fits typical PKCS#7 blocks (~2-6 KB).
Describe the bug
mcpb signappends the signature block (MCPB_SIG_V1+ 4-byte LE length + DER PKCS#7 +MCPB_SIG_END) after the zip's end-of-central-directory (EOCD) record without declaring those bytes in the EOCD comment-length field. The result is not a strictly valid zip: the EOCD declares a 0-byte comment, but trailing data follows. Lenient parsers (Pythonzipfile, Info-ZIPunzip) tolerate this; strict parsers (yauzl) reject the file outright. Claude Desktop uses a strict parser, so a signed.mcpbcannot be previewed or installed in Claude Desktop at all - signing a bundle currently breaks it for the flagship consumer of the format.To Reproduce
Steps to reproduce the behavior:
npx --yes @anthropic-ai/mcpb pack my-extension/ test.mcpbnpx --yes @anthropic-ai/mcpb sign test.mcpb --self-signedtest.mcpbExpected behavior
Signed bundles remain installable in Claude Desktop (and parseable by any spec-strict zip reader). Trailing data can be made zip-legal by declaring it as the archive comment: patch the 2-byte comment-length field at EOCD offset +20 to the size of the appended signature block. Verified empirically: with that one patch, the same signed bundle previews and installs correctly in Claude Desktop, and
extractSignatureBlockstill finds the signature (it scans backwards forMCPB_SIG_ENDand is unaffected by the EOCD field).Logs
2264 is exactly the appended signature block in this repro: 11-byte header + 4-byte length + 2237-byte DER + 12-byte footer.
Additional context
@anthropic-ai/mcpb2.1.2; Claude Desktop for Windows (current as of June 2026).mcpb verifyreports every signed bundle as "Extension is not signed" (node-forgep7.verifyis unimplemented) #277 (mcpb verifyalways reports unsigned), the signing feature is currently not usable end to end: signed bundles fail verification in the CLI and fail installation in Claude Desktop.