Skip to content

Commit 82b12a4

Browse files
Merge pull request #140 from anthropics/feat/use-latest-schema-only
feat: export McpbManifestAny type, use latest MCPB schema for BUILD manifest validation
2 parents ba74af5 + 7ecb050 commit 82b12a4

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@anthropic-ai/mcpb",
33
"description": "Tools for building MCP Bundles",
4-
"version": "1.1.3",
4+
"version": "1.1.4",
55
"type": "module",
66
"main": "dist/index.js",
77
"module": "dist/index.js",

src/cli/init.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { existsSync, readFileSync, writeFileSync } from "fs";
33
import { basename, join, resolve } from "path";
44

55
import { LATEST_MANIFEST_VERSION } from "../shared/constants.js";
6-
import type { McpbManifest } from "../types.js";
6+
import type { McpbManifestLatest } from "../types.js";
77

88
interface PackageJson {
99
name?: string;
@@ -878,7 +878,7 @@ export function buildManifest(
878878
resources: string;
879879
default_locale: string;
880880
},
881-
): McpbManifest {
881+
): McpbManifestLatest {
882882
const { name, displayName, version, description, authorName } = basicInfo;
883883
const { authorEmail, authorUrl } = authorInfo;
884884
const { serverType, entryPoint, mcp_config } = serverConfig;

src/types.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type * as z from "zod";
22

3+
import type { McpbManifestSchema as McpbManifestSchemaAny } from "./schemas/any.js";
34
import type {
45
McpbManifestAuthorSchema,
56
McpbManifestCompatibilitySchema,
@@ -46,7 +47,17 @@ export type McpbUserConfigurationOption = z.infer<
4647

4748
export type McpbUserConfigValues = z.infer<typeof McpbUserConfigValuesSchema>;
4849

49-
export type McpbManifest = z.infer<typeof McpbManifestSchema>;
50+
/**
51+
* McpbManifest type that accepts any supported manifest version
52+
* This is the default manifest type that should be used for maximum compatibility.
53+
*/
54+
export type McpbManifest = z.infer<typeof McpbManifestSchemaAny>;
55+
56+
/**
57+
* McpbManifest type for the latest manifest version only
58+
* Use this when you specifically need the latest version.
59+
*/
60+
export type McpbManifestLatest = z.infer<typeof McpbManifestSchema>;
5061

5162
/**
5263
* Information about a MCPB package signature

0 commit comments

Comments
 (0)