Revert "feat: replace manifest_version with $schema field"
This reverts commit 7997e72758.
This commit is contained in:
parent
1de373a9c9
commit
5a46a05108
14 changed files with 30 additions and 94 deletions
|
|
@ -11,7 +11,7 @@ A basic `manifest.json` with just the required fields looks like this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json", // JSON Schema URL for validation
|
"manifest_version": "0.1", // Manifest spec version this manifest conforms to
|
||||||
"name": "my-extension", // Machine-readable name (used for CLI, APIs)
|
"name": "my-extension", // Machine-readable name (used for CLI, APIs)
|
||||||
"version": "1.0.0", // Semantic version of your extension
|
"version": "1.0.0", // Semantic version of your extension
|
||||||
"description": "A simple MCP extension", // Brief description of what the extension does
|
"description": "A simple MCP extension", // Brief description of what the extension does
|
||||||
|
|
@ -37,7 +37,7 @@ A basic `manifest.json` with just the required fields looks like this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"manifest_version": "0.1",
|
||||||
"name": "my-extension",
|
"name": "my-extension",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A simple MCP extension",
|
"description": "A simple MCP extension",
|
||||||
|
|
@ -71,7 +71,7 @@ A full `manifest.json` with most of the optional fields looks like this:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"manifest_version": "0.1",
|
||||||
"name": "My MCP Extension",
|
"name": "My MCP Extension",
|
||||||
"display_name": "My Awesome MCP Extension",
|
"display_name": "My Awesome MCP Extension",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|
@ -162,7 +162,7 @@ A full `manifest.json` with most of the optional fields looks like this:
|
||||||
|
|
||||||
### Required Fields
|
### Required Fields
|
||||||
|
|
||||||
- **$schema**: JSON Schema URL for validation (defaults to https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json)
|
- **manifest_version**: Specification version this extension conforms to
|
||||||
- **name**: Machine-readable name (used for CLI, APIs)
|
- **name**: Machine-readable name (used for CLI, APIs)
|
||||||
- **version**: Semantic version (semver)
|
- **version**: Semantic version (semver)
|
||||||
- **description**: Brief description
|
- **description**: Brief description
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"$schema": "../../dist/mcpb-manifest.schema.json",
|
||||||
|
"manifest_version": "0.1",
|
||||||
"name": "chrome-applescript",
|
"name": "chrome-applescript",
|
||||||
"display_name": "Control Chrome with AppleScript",
|
"display_name": "Control Chrome with AppleScript",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"$schema": "../../dist/mcpb-manifest.schema.json",
|
||||||
|
"manifest_version": "0.1",
|
||||||
"name": "file-manager-python",
|
"name": "file-manager-python",
|
||||||
"display_name": "Python File Manager MCP",
|
"display_name": "Python File Manager MCP",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"manifest_version": "0.1",
|
||||||
"id": "anthropic.demo.filesystem",
|
"id": "anthropic.demo.filesystem",
|
||||||
"name": "Filesystem",
|
"name": "Filesystem",
|
||||||
"display_name": "Filesystem",
|
"display_name": "Filesystem",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"$schema": "../../dist/mcpb-manifest.schema.json",
|
||||||
|
"manifest_version": "0.1",
|
||||||
"name": "hello-world-node",
|
"name": "hello-world-node",
|
||||||
"display_name": "Hello World MCP Server (Reference Extension)",
|
"display_name": "Hello World MCP Server (Reference Extension)",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
|
|
|
||||||
|
|
@ -773,7 +773,7 @@ export function buildManifest(
|
||||||
const { keywords, license, repository } = optionalFields;
|
const { keywords, license, repository } = optionalFields;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "0.1",
|
||||||
name,
|
name,
|
||||||
...(displayName && displayName !== name
|
...(displayName && displayName !== name
|
||||||
? { display_name: displayName }
|
? { display_name: displayName }
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,8 @@ export const McpbUserConfigValuesSchema = z.record(
|
||||||
export const McpbManifestSchema = z
|
export const McpbManifestSchema = z
|
||||||
.object({
|
.object({
|
||||||
$schema: z.string().optional(),
|
$schema: z.string().optional(),
|
||||||
dxt_version: z.string().optional().describe("@deprecated - Use $schema instead"),
|
dxt_version: z.string().optional().describe("@deprecated Use manifest_version instead"),
|
||||||
|
manifest_version: z.string().optional(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
display_name: z.string().optional(),
|
display_name: z.string().optional(),
|
||||||
version: z.string(),
|
version: z.string(),
|
||||||
|
|
@ -105,9 +106,9 @@ export const McpbManifestSchema = z
|
||||||
.optional(),
|
.optional(),
|
||||||
})
|
})
|
||||||
.refine(
|
.refine(
|
||||||
(data) => !!(data.$schema || data.dxt_version),
|
(data) => !!(data.dxt_version || data.manifest_version),
|
||||||
{
|
{
|
||||||
message: "Either '$schema' or 'dxt_version' (deprecated) must be provided",
|
message: "Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,8 @@ export const McpbUserConfigValuesSchema = z.record(
|
||||||
export const McpbManifestSchema = z
|
export const McpbManifestSchema = z
|
||||||
.strictObject({
|
.strictObject({
|
||||||
$schema: z.string().optional(),
|
$schema: z.string().optional(),
|
||||||
dxt_version: z.string().optional().describe("@deprecated - Use $schema instead"),
|
dxt_version: z.string().optional().describe("@deprecated Use manifest_version instead"),
|
||||||
|
manifest_version: z.string().optional(),
|
||||||
name: z.string(),
|
name: z.string(),
|
||||||
display_name: z.string().optional(),
|
display_name: z.string().optional(),
|
||||||
version: z.string(),
|
version: z.string(),
|
||||||
|
|
@ -105,9 +106,9 @@ export const McpbManifestSchema = z
|
||||||
.optional(),
|
.optional(),
|
||||||
})
|
})
|
||||||
.refine(
|
.refine(
|
||||||
(data) => !!(data.$schema || data.dxt_version),
|
(data) => !!(data.dxt_version || data.manifest_version),
|
||||||
{
|
{
|
||||||
message: "Either '$schema' or 'dxt_version' (deprecated) must be provided",
|
message: "Either 'dxt_version' (deprecated) or 'manifest_version' must be provided",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ describe("DXT CLI", () => {
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
join(tempDir, "manifest.json"),
|
join(tempDir, "manifest.json"),
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "1.0",
|
||||||
name: "Test Extension",
|
name: "Test Extension",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
description: "A test extension",
|
description: "A test extension",
|
||||||
|
|
@ -188,7 +188,7 @@ describe("DXT CLI", () => {
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
join(tempExecDir, "manifest.json"),
|
join(tempExecDir, "manifest.json"),
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "1.0",
|
||||||
name: "Test Executable Extension",
|
name: "Test Executable Extension",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
description: "A test extension with executable files",
|
description: "A test extension with executable files",
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ describe("getMcpConfigForManifest", () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const baseManifest: McpbManifest = {
|
const baseManifest: McpbManifest = {
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "1.0.0",
|
||||||
name: "test-extension",
|
name: "test-extension",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
description: "Test extension",
|
description: "Test extension",
|
||||||
|
|
@ -305,7 +305,7 @@ describe("getMcpConfigForManifest", () => {
|
||||||
|
|
||||||
describe("hasRequiredConfigMissing", () => {
|
describe("hasRequiredConfigMissing", () => {
|
||||||
const baseManifest: McpbManifest = {
|
const baseManifest: McpbManifest = {
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "1.0.0",
|
||||||
name: "test-extension",
|
name: "test-extension",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
description: "Test extension",
|
description: "Test extension",
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,7 @@ describe("init functions", () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(manifest).toEqual({
|
expect(manifest).toEqual({
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "0.1",
|
||||||
name: "test-extension",
|
name: "test-extension",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
description: "Test description",
|
description: "Test description",
|
||||||
|
|
@ -303,7 +303,7 @@ describe("init functions", () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(manifest).toEqual({
|
expect(manifest).toEqual({
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "0.1",
|
||||||
name: "test-extension",
|
name: "test-extension",
|
||||||
display_name: "Test Extension",
|
display_name: "Test Extension",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"manifest_version": "1.0",
|
||||||
"name": "test-extension",
|
"name": "test-extension",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A test DXT extension",
|
"description": "A test DXT extension",
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ describe("McpbManifestSchema", () => {
|
||||||
|
|
||||||
it("should validate manifest with all optional fields", () => {
|
it("should validate manifest with all optional fields", () => {
|
||||||
const fullManifest = {
|
const fullManifest = {
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "1.0",
|
||||||
name: "full-extension",
|
name: "full-extension",
|
||||||
display_name: "Full Featured Extension",
|
display_name: "Full Featured Extension",
|
||||||
version: "2.0.0",
|
version: "2.0.0",
|
||||||
|
|
@ -117,7 +117,7 @@ describe("McpbManifestSchema", () => {
|
||||||
|
|
||||||
serverTypes.forEach((type) => {
|
serverTypes.forEach((type) => {
|
||||||
const manifest = {
|
const manifest = {
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
manifest_version: "1.0",
|
||||||
name: "test",
|
name: "test",
|
||||||
version: "1.0.0",
|
version: "1.0.0",
|
||||||
description: "Test",
|
description: "Test",
|
||||||
|
|
@ -136,73 +136,4 @@ describe("McpbManifestSchema", () => {
|
||||||
expect(result.success).toBe(true);
|
expect(result.success).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("backward compatibility", () => {
|
|
||||||
it("should accept manifest with dxt_version instead of $schema", () => {
|
|
||||||
const legacyManifest = {
|
|
||||||
dxt_version: "0.1",
|
|
||||||
name: "legacy-extension",
|
|
||||||
version: "1.0.0",
|
|
||||||
description: "Legacy extension",
|
|
||||||
author: { name: "Test Author" },
|
|
||||||
server: {
|
|
||||||
type: "node",
|
|
||||||
entry_point: "server.js",
|
|
||||||
mcp_config: {
|
|
||||||
command: "node",
|
|
||||||
args: ["server.js"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = McpbManifestSchema.safeParse(legacyManifest);
|
|
||||||
expect(result.success).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should accept manifest with $schema", () => {
|
|
||||||
const modernManifest = {
|
|
||||||
$schema: "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
|
||||||
name: "modern-extension",
|
|
||||||
version: "1.0.0",
|
|
||||||
description: "Modern extension",
|
|
||||||
author: { name: "Test Author" },
|
|
||||||
server: {
|
|
||||||
type: "node",
|
|
||||||
entry_point: "server.js",
|
|
||||||
mcp_config: {
|
|
||||||
command: "node",
|
|
||||||
args: ["server.js"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = McpbManifestSchema.safeParse(modernManifest);
|
|
||||||
expect(result.success).toBe(true);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("should reject manifest without $schema or dxt_version", () => {
|
|
||||||
const invalidManifest = {
|
|
||||||
name: "invalid-extension",
|
|
||||||
version: "1.0.0",
|
|
||||||
description: "Invalid extension",
|
|
||||||
author: { name: "Test Author" },
|
|
||||||
server: {
|
|
||||||
type: "node",
|
|
||||||
entry_point: "server.js",
|
|
||||||
mcp_config: {
|
|
||||||
command: "node",
|
|
||||||
args: ["server.js"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const result = McpbManifestSchema.safeParse(invalidManifest);
|
|
||||||
expect(result.success).toBe(false);
|
|
||||||
if (!result.success) {
|
|
||||||
expect(result.error.issues[0].message).toContain(
|
|
||||||
"Either '$schema' or 'dxt_version' (deprecated) must be provided"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-08-26/mcpb.manifest.schema.json",
|
"manifest_version": "1.0",
|
||||||
"name": "test-extension",
|
"name": "test-extension",
|
||||||
"display_name": "Test Extension",
|
"display_name": "Test Extension",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue