Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
98fc900
WIP
joan-anthropic Nov 1, 2025
f3ac79a
update browser exports to incl. vAny schema
joan-anthropic Nov 1, 2025
8616663
revert: undo preprocessing changes to any.ts and types.ts
joan-anthropic Nov 1, 2025
5fb25a2
add McpbManifestAny type
joan-anthropic Nov 1, 2025
2d76201
Export versioned schemas and validation utilities in browser bundle
joan-anthropic Nov 1, 2025
c137df5
Remove validate utilities from browser exports
joan-anthropic Nov 2, 2025
05187d7
Remove zod resolution and bump version to 1.2.0
joan-anthropic Nov 2, 2025
2d6dd39
Merge remote-tracking branch 'origin/main' into feat/browser-export-v…
joan-anthropic Nov 2, 2025
3538bd4
Bump version to 1.3.0
joan-anthropic Nov 2, 2025
753f27e
Revert yarn.lock to match main (zod 3.25.67)
joan-anthropic Nov 2, 2025
7f40d5b
rm McpbUserConfigValuesSchema export
joan-anthropic Nov 2, 2025
e7d6ea3
Fix type error in buildManifest return type
joan-anthropic Nov 2, 2025
d7f76fc
Fix linting issues
joan-anthropic Nov 2, 2025
30a3b8e
Remove vLatest concept and associated files
joan-anthropic Nov 3, 2025
efe9e33
Make McpbManifest point to v0.2 for backwards compatibility
joan-anthropic Nov 3, 2025
70c3615
Add LATEST_MANIFEST_VERSION export (hardcoded to 0.3)
joan-anthropic Nov 3, 2025
3fffc30
Use McpbManifestDefault derived from DEFAULT_MANIFEST_VERSION
joan-anthropic Nov 3, 2025
8018a9a
Remove latest schema reference from build script
joan-anthropic Nov 3, 2025
21c9710
Fix lint errors in types.ts and remove any casts
joan-anthropic Nov 3, 2025
3a9ee6e
Export schemas/index instead of specific version
joan-anthropic Nov 3, 2025
07b7743
Fix lint errors: sort imports and rename unused parameter
joan-anthropic Nov 4, 2025
e59797f
chore: major version bump
joan-anthropic Nov 4, 2025
08cb52b
remove localization param
joan-anthropic Nov 4, 2025
e4f1236
Fix TypeScript error: remove localization argument from buildManifest…
joan-anthropic Nov 4, 2025
5f87ea5
Comment out localization parameter in tests
joan-anthropic Nov 4, 2025
5f6b15b
remove da bad tings
MarshallOfSound Nov 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"eslint.validate": ["typescript"],
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
}
},
"typescript.tsdk": "node_modules/typescript/lib"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@anthropic-ai/mcpb",
"description": "Tools for building MCP Bundles",
"version": "1.2.0",
"version": "2.0.0",
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
Expand Down Expand Up @@ -99,4 +99,4 @@
"@babel/parser": "7.27.3"
},
"packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f"
}
}
6 changes: 1 addition & 5 deletions scripts/build-mcpb-schema.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import {
McpbManifestSchema as McpbManifestSchemaLatest,
McpbSignatureInfoSchema,
} from "../dist/schemas/latest.js";
import { McpbManifestSchema as McpbManifestSchema_v0_1 } from "../dist/schemas/0.1.js";
import { McpbManifestSchema as McpbManifestSchema_v0_2 } from "../dist/schemas/0.2.js";
import { McpbManifestSchema as McpbManifestSchema_v0_3 } from "../dist/schemas/0.3.js";
import { McpbSignatureInfoSchema } from "../dist/shared/common.js";
import { zodToJsonSchema } from "zod-to-json-schema";
import fs from "node:fs/promises";
import path from "node:path";
Expand All @@ -17,7 +14,6 @@ const versionedManifestSchemas = {
"mcpb-manifest-v0.1": McpbManifestSchema_v0_1,
"mcpb-manifest-v0.2": McpbManifestSchema_v0_2,
"mcpb-manifest-v0.3": McpbManifestSchema_v0_3,
"mcpb-manifest-latest": McpbManifestSchemaLatest,
};

// Other schemas
Expand Down
3 changes: 1 addition & 2 deletions src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Browser-compatible exports
export * from "./schemas/latest.js";
export * from "./schemas/index.js";
export * from "./shared/config.js";
export * from "./shared/constants.js";
export * from "./types.js";
3 changes: 1 addition & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ export * from "./cli/init.js";
export * from "./cli/pack.js";

// Include all shared exports
export * from "./schemas/latest.js";
export * from "./schemas/index.js";
export * from "./shared/config.js";
export * from "./shared/constants.js";
export * from "./types.js";

// Include node exports since CLI needs them
export * from "./node/files.js";
Expand Down
24 changes: 13 additions & 11 deletions src/cli/init.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { confirm, input, select } from "@inquirer/prompts";
import { existsSync, readFileSync, writeFileSync } from "fs";
import { basename, join, resolve } from "path";
import type { z } from "zod";

// Import the schema for DEFAULT_MANIFEST_VERSION
// TODO: Allow dynamic manifest version choice
import type { McpbManifestSchema } from "../schemas/0.2.js";
import { DEFAULT_MANIFEST_VERSION } from "../shared/constants.js";
import type { McpbManifest } from "../types.js";

interface PackageJson {
name?: string;
Expand Down Expand Up @@ -874,11 +877,11 @@ export function buildManifest(
license: string;
repository?: { type: string; url: string };
},
localization?: {
resources: string;
default_locale: string;
},
): McpbManifest {
// localization?: {
// resources: string;
// default_locale: string;
// },
): z.infer<typeof McpbManifestSchema> {
const { name, displayName, version, description, authorName } = basicInfo;
const { authorEmail, authorUrl } = authorInfo;
const { serverType, entryPoint, mcp_config } = serverConfig;
Expand Down Expand Up @@ -906,7 +909,7 @@ export function buildManifest(
...(visualAssets.screenshots.length > 0
? { 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

server: {
type: serverType,
entry_point: entryPoint,
Expand Down Expand Up @@ -991,9 +994,9 @@ export async function initExtension(
const visualAssets = nonInteractive
? { icon: "", icons: [], screenshots: [] }
: await promptVisualAssets();
const localization = nonInteractive
? undefined
: await promptLocalization();
// const localization = nonInteractive
// ? undefined
// : await promptLocalization();
const serverConfig = nonInteractive
? getDefaultServerConfig(packageData)
: await promptServerConfig(packageData);
Expand Down Expand Up @@ -1026,7 +1029,6 @@ export async function initExtension(
compatibility,
userConfig,
optionalFields,
localization,
);

// Write manifest
Expand Down
3 changes: 1 addition & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export * from "./cli/unpack.js";
export * from "./node/files.js";
export * from "./node/sign.js";
export * from "./node/validate.js";
export * from "./schemas/latest.js";
export * from "./schemas/index.js";
export * from "./shared/config.js";
export * from "./shared/constants.js";
export * from "./types.js";
3 changes: 1 addition & 2 deletions src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export * from "./node/sign.js";
export * from "./node/validate.js";

// Include all shared exports
export * from "./schemas/latest.js";
export * from "./schemas/index.js";
export * from "./shared/config.js";
export * from "./shared/constants.js";
export * from "./types.js";
5 changes: 3 additions & 2 deletions src/node/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import forge from "node-forge";
import { tmpdir } from "os";
import { join } from "path";
import { promisify } from "util";
import type { z } from "zod";

import type { McpbSignatureInfo } from "../types.js";
import type { McpbSignatureInfoSchema } from "../shared/common.js";

// Signature block markers
const SIGNATURE_HEADER = "MCPB_SIG_V1";
Expand Down Expand Up @@ -101,7 +102,7 @@ export function signMcpbFile(
*/
export async function verifyMcpbFile(
mcpbPath: string,
): Promise<McpbSignatureInfo> {
): Promise<z.infer<typeof McpbSignatureInfoSchema>> {
try {
const fileContent = readFileSync(mcpbPath);

Expand Down
14 changes: 0 additions & 14 deletions src/schemas/0.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ export const McpbUserConfigurationOptionSchema = z.strictObject({
max: z.number().optional(),
});

export const McpbUserConfigValuesSchema = z.record(
z.string(),
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
);

export const McpbManifestSchema = z
.strictObject({
$schema: z.string().optional(),
Expand Down Expand Up @@ -113,12 +108,3 @@ export const McpbManifestSchema = z
message:
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
});

export const McpbSignatureInfoSchema = z.strictObject({
status: z.enum(["signed", "unsigned", "self-signed"]),
publisher: z.string().optional(),
issuer: z.string().optional(),
valid_from: z.string().optional(),
valid_to: z.string().optional(),
fingerprint: z.string().optional(),
});
14 changes: 0 additions & 14 deletions src/schemas/0.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ export const McpbUserConfigurationOptionSchema = z.strictObject({
max: z.number().optional(),
});

export const McpbUserConfigValuesSchema = z.record(
z.string(),
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
);

export const McpbManifestSchema = z
.strictObject({
$schema: z.string().optional(),
Expand Down Expand Up @@ -113,12 +108,3 @@ export const McpbManifestSchema = z
message:
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
});

export const McpbSignatureInfoSchema = z.strictObject({
status: z.enum(["signed", "unsigned", "self-signed"]),
publisher: z.string().optional(),
issuer: z.string().optional(),
valid_from: z.string().optional(),
valid_to: z.string().optional(),
fingerprint: z.string().optional(),
});
14 changes: 0 additions & 14 deletions src/schemas/0.3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ export const McpbUserConfigurationOptionSchema = z.strictObject({
max: z.number().optional(),
});

export const McpbUserConfigValuesSchema = z.record(
z.string(),
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
);

export const McpbManifestLocalizationSchema = z.strictObject({
resources: z
.string()
Expand Down Expand Up @@ -147,12 +142,3 @@ export const McpbManifestSchema = z
message:
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
});

export const McpbSignatureInfoSchema = z.strictObject({
status: z.enum(["signed", "unsigned", "self-signed"]),
publisher: z.string().optional(),
issuer: z.string().optional(),
valid_from: z.string().optional(),
valid_to: z.string().optional(),
fingerprint: z.string().optional(),
});
20 changes: 14 additions & 6 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { McpbManifestSchema as ManifestSchemaV0_1 } from "./0.1.js";
import { McpbManifestSchema as ManifestSchemaV0_2 } from "./0.2.js";
import { McpbManifestSchema as ManifestSchemaV0_3 } from "./0.3.js";

export * as v0_1 from "./0.1.js";
export * as v0_2 from "./0.2.js";
export * as v0_3 from "./0.3.js";
export * as any from "./any.js";
export * as latest from "./latest.js";
export {
MANIFEST_VERSION as LATEST_MANIFEST_VERSION,
McpbManifestSchema,
} from "./latest.js";
export * as vAny from "./any.js";

/**
* Map of manifest versions to their strict schemas
*/
export const VERSIONED_MANIFEST_SCHEMAS = {
"0.1": ManifestSchemaV0_1,
"0.2": ManifestSchemaV0_2,
"0.3": ManifestSchemaV0_3,
} as const;
1 change: 0 additions & 1 deletion src/schemas/latest.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/schemas_loose/0.1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ export const McpbUserConfigurationOptionSchema = z.object({
max: z.number().optional(),
});

export const McpbUserConfigValuesSchema = z.record(
z.string(),
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
);

export const McpbManifestSchema = z
.object({
$schema: z.string().optional(),
Expand Down Expand Up @@ -115,12 +110,3 @@ export const McpbManifestSchema = z
message:
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
});

export const McpbSignatureInfoSchema = z.object({
status: z.enum(["signed", "unsigned", "self-signed"]),
publisher: z.string().optional(),
issuer: z.string().optional(),
valid_from: z.string().optional(),
valid_to: z.string().optional(),
fingerprint: z.string().optional(),
});
14 changes: 0 additions & 14 deletions src/schemas_loose/0.2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ export const McpbUserConfigurationOptionSchema = z.object({
max: z.number().optional(),
});

export const McpbUserConfigValuesSchema = z.record(
z.string(),
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
);

export const McpbManifestSchema = z
.object({
$schema: z.string().optional(),
Expand Down Expand Up @@ -116,12 +111,3 @@ export const McpbManifestSchema = z
message:
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
});

export const McpbSignatureInfoSchema = z.object({
status: z.enum(["signed", "unsigned", "self-signed"]),
publisher: z.string().optional(),
issuer: z.string().optional(),
valid_from: z.string().optional(),
valid_to: z.string().optional(),
fingerprint: z.string().optional(),
});
14 changes: 0 additions & 14 deletions src/schemas_loose/0.3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ export const McpbUserConfigurationOptionSchema = z.object({
max: z.number().optional(),
});

export const McpbUserConfigValuesSchema = z.record(
z.string(),
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
);

export const McpbManifestLocalizationSchema = z
.object({
resources: z
Expand Down Expand Up @@ -153,12 +148,3 @@ export const McpbManifestSchema = z
message:
"Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
});

export const McpbSignatureInfoSchema = z.object({
status: z.enum(["signed", "unsigned", "self-signed"]),
publisher: z.string().optional(),
issuer: z.string().optional(),
valid_from: z.string().optional(),
valid_to: z.string().optional(),
fingerprint: z.string().optional(),
});
1 change: 0 additions & 1 deletion src/schemas_loose/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * as v0_1 from "./0.1.js";
export * as v0_2 from "./0.2.js";
export * as v0_3 from "./0.3.js";
export * as latest from "./latest.js";
1 change: 0 additions & 1 deletion src/schemas_loose/latest.ts

This file was deleted.

15 changes: 15 additions & 0 deletions src/shared/common.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { z } from "zod";

export const McpbUserConfigValuesSchema = z.record(
z.string(),
z.union([z.string(), z.number(), z.boolean(), z.array(z.string())]),
);

export const McpbSignatureInfoSchema = z.strictObject({
status: z.enum(["signed", "unsigned", "self-signed"]),
publisher: z.string().optional(),
issuer: z.string().optional(),
valid_from: z.string().optional(),
valid_to: z.string().optional(),
fingerprint: z.string().optional(),
});
Loading