Skip to content

Conversation

@joan-anthropic
Copy link
Contributor

@joan-anthropic joan-anthropic commented Nov 1, 2025

Summary

Exports versioned manifest schemas and the VERSIONED_MANIFEST_SCHEMAS map in the browser bundle to enable runtime manifest validation across all supported versions (0.1, 0.2, 0.3).

Changes

  • Export VERSIONED_MANIFEST_SCHEMAS map from src/schemas/index.ts
  • Export schemas through src/browser.ts for browser bundle
  • Add McpbManifestAny type to represent union of all manifest versions
  • Update McpbManifest to alias McpbManifestLatest for clarity
  • Update getMcpConfigForManifest to accept McpbManifestAny type
  • Fix buildManifest return type to use v0.2 schema (matches DEFAULT_MANIFEST_VERSION)

Use Case

This enables browser-based tools to validate manifests of any version

joan-anthropic and others added 3 commits November 1, 2025 15:07
Reverts the preprocessing logic and type name changes to restore
the simpler union schema approach.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@joan-anthropic joan-anthropic changed the title Feat/browser export versioned schemas Feat: export versioned zod schemas in browser export Nov 1, 2025
joan-anthropic and others added 3 commits November 1, 2025 15:46
- Update browser.ts to export validation utilities
- Export McpbManifestSchema for backwards compatibility
- Update config.ts to accept McpbManifestAny for broader manifest version support
- Add validate.ts with version-aware validation functions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This removes the validateManifest utilities that were added to the browser bundle. These functions are not needed for the browser export.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@joan-anthropic joan-anthropic force-pushed the feat/browser-export-versioned-schemas branch from 90974d0 to c137df5 Compare November 2, 2025 02:49
joan-anthropic and others added 5 commits November 1, 2025 20:27
- Removed zod version resolution from package.json
- Bumped version from 1.1.5 to 1.2.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@joan-anthropic joan-anthropic changed the title Feat: export versioned zod schemas in browser export Feat: export versioned zod schemas in mcpb/browser Nov 2, 2025
Changed return type to use the specific v0.2 manifest schema type since the
function returns a manifest with DEFAULT_MANIFEST_VERSION (0.2).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@joan-anthropic joan-anthropic force-pushed the feat/browser-export-versioned-schemas branch from 2ad6761 to e7d6ea3 Compare November 2, 2025 03:38
- Remove unused McpbManifest import from config.ts
- Auto-fix formatting and import sorting

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
src/cli/init.ts Outdated
Comment on lines 4 to 882
@@ -878,7 +879,7 @@ export function buildManifest(
resources: string;
default_locale: string;
},
): McpbManifest {
): z.infer<typeof McpbManifestSchemaV0_2> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this need to be 0.2 specifically instead of the "any" schema type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just because we haven't yet merged #146, the CLI commands should technically only be producing 0.2 artifacts.

I could be doing this more robustly, but since this is a transitional state before we allow manifest version flexibility into our CLI tools - mostly just want to unblock versioned schema validation in claude desktop as quickly as possible

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I guess my thing was the ManifestAny type worked here, was there a reason for this change I'm missing other than just semantic correctness?

Copy link
Contributor Author

@joan-anthropic joan-anthropic Nov 3, 2025

Choose a reason for hiding this comment

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

McpbManifest is was actually an alias to "latest" for backwards compatibility

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, updated init to non-include v0.3 fields (ie localization) for now

Copy link
Contributor

Choose a reason for hiding this comment

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

can't init just start a 0.3 manifest? the new fields are optional anyway so they can be left out from init (but user can add them later if they want)

Copy link
Contributor

Choose a reason for hiding this comment

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

@asklar The issue here is this package should never produce a MCPB that can't be run on major clients. As such the release pattern should look like

  • Release version with new schema
  • Let clients adopt schema
  • At some point in the future change default schema to the newer schema version

Otherwise people will try to use this package and promptly get stuck because their generated MCPB is Wrong ™️

We have a fast-follow for allowing init to take a --schema-version flag or something so that you can opt into 0.3 for init ahead of time if you want to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're trying to decouple + stagger updates to manifest schemas (consumed by MCPB clients) from updates to mcpb build tooling (consumed by developers) so that we give clients a window to support vLatest before we get vLatest mcpb submissions - we're getting feedback from developers who are frustrated that they're unable to upload v0.3 mcpbs to claude desktop.

@MarshallOfSound 's PR here: #145 effectively downgrades our CLI tooling to generate 0.2-versioned manifests, but the contents still reflect v0.3 - it's important that they be in-sync.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

JYFI there's a PR open here to allow developers to specify the manifest version they build with that will follow this work - just want to make sure the declared manifest version actually matches the manifest content for now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry - just caught @MarshallOfSound 's comment, ditto everything he's saying

joan-anthropic and others added 4 commits November 3, 2025 15:30
Remove the concept of "vLatest" throughout the codebase to encourage use of McpbManifestAny which supports all manifest versions. Changes include:

- Delete src/schemas/latest.ts and src/schemas_loose/latest.ts
- Remove vLatest and latest-related exports from schema index files
- Remove McpbManifestLatest type, replace McpbManifest to point to McpbManifestAny
- Remove LATEST_MANIFEST_VERSION, LATEST_MANIFEST_SCHEMA constants
- Update all main export files (index.ts, cli.ts, node.ts) to export from 0.3.js instead of latest.js
- Update tests to use v0_3.McpbManifestSchema explicitly
- Add @deprecated annotation to McpbManifest directing users to McpbManifestAny

This encourages better version compatibility by using the union type that supports all manifest versions rather than assuming a single "latest" version.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change McpbManifest type to point to v0.2 schema instead of McpbManifestAny
- Add DEFAULT_MANIFEST_VERSION export to browser.ts
- Update test fixtures to use manifest_version "0.2" when using McpbManifest type
- Keep @deprecated annotation directing users to McpbManifestAny for multi-version support

This maintains backwards compatibility for existing code using McpbManifest while encouraging new code to use McpbManifestAny for broader version support.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Export LATEST_MANIFEST_VERSION to indicate the maximum supported manifest version by the vAny schema. This allows clients to know what the highest version is that they can use.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Create McpbManifestDefault type derived from VERSIONED_MANIFEST_SCHEMAS[DEFAULT_MANIFEST_VERSION]
- Update init.ts to use McpbManifestDefault instead of hardcoded v0.2 schema
- Import schema types from version matching DEFAULT_MANIFEST_VERSION (0.2)
- Update test to match commented-out localization field
- Make McpbManifest (deprecated) point to McpbManifestDefault

This makes the codebase more maintainable by deriving types from DEFAULT_MANIFEST_VERSION instead of hardcoding version references.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
? { screenshots: visualAssets.screenshots }
: {}),
...(localization ? { localization } : {}),
// ...(localization ? { localization } : {}),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove localization from init for now, this is a v0.3 field

src/cli/init.ts Outdated
default_locale: string;
},
): McpbManifest {
): McpbManifestDefault {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

make return type more resilient to changes to default

The build script was still importing from the deleted schemas/latest.js file.
Updated to import McpbSignatureInfoSchema from 0.3.js and removed the
mcpb-manifest-latest entry from versionedManifestSchemas.
- Use import type for VERSIONED_MANIFEST_SCHEMAS and DEFAULT_MANIFEST_VERSION
- Remove unnecessary any type annotations from test file
Changed all entry points (index.ts, cli.ts, node.ts) to export from schemas/index.js
instead of schemas/0.3.js. This provides access to all versioned schemas (v0_1, v0_2,
v0_3, vAny) and VERSIONED_MANIFEST_SCHEMAS without exposing a specific version.
@joan-anthropic joan-anthropic changed the title Feat: export versioned zod schemas in mcpb/browser Feat: export versioned zod schemas in mcpb/browser, remove vLatest Nov 4, 2025
@joan-anthropic joan-anthropic changed the title Feat: export versioned zod schemas in mcpb/browser, remove vLatest Feat: export versioned zod schemas in mcpb/browser, remove vLatest artifacts Nov 4, 2025
- Reorganize imports in types.ts to satisfy simple-import-sort
- Rename unused localization parameter to _localization in init.ts
joan-anthropic and others added 5 commits November 3, 2025 16:04
… call

The buildManifest function signature has the localization parameter
commented out (expecting 13 params), but the function call was still
passing it as the 14th argument, causing a type error.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The localization parameter is commented out in the buildManifest function
signature, so it should also be commented out in the test calls.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@MarshallOfSound MarshallOfSound changed the title Feat: export versioned zod schemas in mcpb/browser, remove vLatest artifacts feat: export versioned zod schemas in mcpb/browser, remove vLatest artifacts Nov 4, 2025
@joan-anthropic joan-anthropic merged commit 5079fcf into main Nov 4, 2025
7 checks passed
@MarshallOfSound MarshallOfSound deleted the feat/browser-export-versioned-schemas branch November 4, 2025 20:32
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.

5 participants