From 96016ad36a631ef827da277928b35f5184a8c972 Mon Sep 17 00:00:00 2001 From: Richa Dua Date: Thu, 29 Jan 2026 16:04:18 -0800 Subject: [PATCH 1/3] Added support for MCP Tool input schema --- schemas/mcpb-manifest-v0.1.schema.json | 50 ++++++++++++++++++++++++++ schemas/mcpb-manifest-v0.2.schema.json | 50 ++++++++++++++++++++++++++ schemas/mcpb-manifest-v0.3.schema.json | 50 ++++++++++++++++++++++++++ schemas/mcpb-manifest-v0.4.schema.json | 50 ++++++++++++++++++++++++++ src/schemas/0.1.ts | 17 +++++++++ src/schemas/0.2.ts | 18 ++++++++++ src/schemas/0.3.ts | 17 +++++++++ src/schemas/0.4.ts | 17 +++++++++ src/schemas_loose/0.1.ts | 27 +++++++++++--- src/schemas_loose/0.2.ts | 27 +++++++++++--- src/schemas_loose/0.3.ts | 27 +++++++++++--- src/schemas_loose/0.4.ts | 27 +++++++++++--- 12 files changed, 361 insertions(+), 16 deletions(-) diff --git a/schemas/mcpb-manifest-v0.1.schema.json b/schemas/mcpb-manifest-v0.1.schema.json index 821a00a..8babf19 100644 --- a/schemas/mcpb-manifest-v0.1.schema.json +++ b/schemas/mcpb-manifest-v0.1.schema.json @@ -160,6 +160,56 @@ }, "description": { "type": "string" + }, + "inputSchema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": true + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": true } }, "required": [ diff --git a/schemas/mcpb-manifest-v0.2.schema.json b/schemas/mcpb-manifest-v0.2.schema.json index fc522b9..d40a9e2 100644 --- a/schemas/mcpb-manifest-v0.2.schema.json +++ b/schemas/mcpb-manifest-v0.2.schema.json @@ -160,6 +160,56 @@ }, "description": { "type": "string" + }, + "inputSchema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": true + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": true } }, "required": [ diff --git a/schemas/mcpb-manifest-v0.3.schema.json b/schemas/mcpb-manifest-v0.3.schema.json index 64471c5..1ba2ea0 100644 --- a/schemas/mcpb-manifest-v0.3.schema.json +++ b/schemas/mcpb-manifest-v0.3.schema.json @@ -202,6 +202,56 @@ }, "description": { "type": "string" + }, + "inputSchema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": true + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": true } }, "required": [ diff --git a/schemas/mcpb-manifest-v0.4.schema.json b/schemas/mcpb-manifest-v0.4.schema.json index 5917415..76bc330 100644 --- a/schemas/mcpb-manifest-v0.4.schema.json +++ b/schemas/mcpb-manifest-v0.4.schema.json @@ -203,6 +203,56 @@ }, "description": { "type": "string" + }, + "inputSchema": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "object" + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "type": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "description": { + "type": "string" + }, + "format": { + "type": "string" + } + }, + "required": [ + "type" + ], + "additionalProperties": true + } + }, + "required": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "type" + ], + "additionalProperties": true } }, "required": [ diff --git a/src/schemas/0.1.ts b/src/schemas/0.1.ts index 9922195..4ba0405 100644 --- a/src/schemas/0.1.ts +++ b/src/schemas/0.1.ts @@ -45,9 +45,26 @@ export const McpbManifestCompatibilitySchema = z.strictObject({ .optional(), }); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ diff --git a/src/schemas/0.2.ts b/src/schemas/0.2.ts index bb1de16..74f1f67 100644 --- a/src/schemas/0.2.ts +++ b/src/schemas/0.2.ts @@ -45,9 +45,27 @@ export const McpbManifestCompatibilitySchema = z.strictObject({ .optional(), }); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), + // Support for full MCP tool definition + inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ diff --git a/src/schemas/0.3.ts b/src/schemas/0.3.ts index 2ca0206..b9ba725 100644 --- a/src/schemas/0.3.ts +++ b/src/schemas/0.3.ts @@ -50,9 +50,26 @@ export const McpbManifestCompatibilitySchema = z.strictObject({ .optional(), }); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ diff --git a/src/schemas/0.4.ts b/src/schemas/0.4.ts index e044b91..77f5e05 100644 --- a/src/schemas/0.4.ts +++ b/src/schemas/0.4.ts @@ -51,9 +51,26 @@ export const McpbManifestCompatibilitySchema = z.strictObject({ .optional(), }); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ diff --git a/src/schemas_loose/0.1.ts b/src/schemas_loose/0.1.ts index ab7f69c..90e4680 100644 --- a/src/schemas_loose/0.1.ts +++ b/src/schemas_loose/0.1.ts @@ -47,10 +47,29 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -export const McpbManifestToolSchema = z.object({ - name: z.string(), - description: z.string().optional(), -}); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + +export const McpbManifestToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), + }) + .passthrough(); export const McpbManifestPromptSchema = z.object({ name: z.string(), diff --git a/src/schemas_loose/0.2.ts b/src/schemas_loose/0.2.ts index bc177d2..2ee9865 100644 --- a/src/schemas_loose/0.2.ts +++ b/src/schemas_loose/0.2.ts @@ -47,10 +47,29 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -export const McpbManifestToolSchema = z.object({ - name: z.string(), - description: z.string().optional(), -}); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + +export const McpbManifestToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), + }) + .passthrough(); export const McpbManifestPromptSchema = z.object({ name: z.string(), diff --git a/src/schemas_loose/0.3.ts b/src/schemas_loose/0.3.ts index a96894b..fd006bc 100644 --- a/src/schemas_loose/0.3.ts +++ b/src/schemas_loose/0.3.ts @@ -51,10 +51,29 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -export const McpbManifestToolSchema = z.object({ - name: z.string(), - description: z.string().optional(), -}); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + +export const McpbManifestToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), + }) + .passthrough(); export const McpbManifestPromptSchema = z.object({ name: z.string(), diff --git a/src/schemas_loose/0.4.ts b/src/schemas_loose/0.4.ts index d75eed3..4393ca4 100644 --- a/src/schemas_loose/0.4.ts +++ b/src/schemas_loose/0.4.ts @@ -54,10 +54,29 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -export const McpbManifestToolSchema = z.object({ - name: z.string(), - description: z.string().optional(), -}); +const JSONSchemaPropertySchema = z + .object({ + type: z.union([z.string(), z.array(z.string())]), + description: z.string().optional(), + format: z.string().optional(), + }) + .passthrough(); + +const McpToolInputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + }) + .passthrough(); + +export const McpbManifestToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), + }) + .passthrough(); export const McpbManifestPromptSchema = z.object({ name: z.string(), From 9c420f33a6d28a5cefbd8a379758952ce68a6672 Mon Sep 17 00:00:00 2001 From: Richa Dua Date: Thu, 29 Jan 2026 17:15:10 -0800 Subject: [PATCH 2/3] Fix only microsoft specific extension --- schemas/mcpb-manifest-v0.1.schema.json | 50 --------------- schemas/mcpb-manifest-v0.2.schema.json | 50 --------------- schemas/mcpb-manifest-v0.3.schema.json | 50 --------------- schemas/mcpb-manifest-v0.4.schema.json | 50 --------------- src/schemas/0.1.ts | 17 ------ src/schemas/0.2.ts | 18 ------ src/schemas/0.3.ts | 81 ++++++++++++++++++++---- src/schemas/0.4.ts | 81 ++++++++++++++++++++---- src/schemas_loose/0.1.ts | 17 ------ src/schemas_loose/0.2.ts | 17 ------ src/schemas_loose/0.3.ts | 85 +++++++++++++++++++++----- src/schemas_loose/0.4.ts | 85 +++++++++++++++++++++----- 12 files changed, 276 insertions(+), 325 deletions(-) diff --git a/schemas/mcpb-manifest-v0.1.schema.json b/schemas/mcpb-manifest-v0.1.schema.json index 8babf19..821a00a 100644 --- a/schemas/mcpb-manifest-v0.1.schema.json +++ b/schemas/mcpb-manifest-v0.1.schema.json @@ -160,56 +160,6 @@ }, "description": { "type": "string" - }, - "inputSchema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "object" - }, - "properties": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "description": { - "type": "string" - }, - "format": { - "type": "string" - } - }, - "required": [ - "type" - ], - "additionalProperties": true - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": true } }, "required": [ diff --git a/schemas/mcpb-manifest-v0.2.schema.json b/schemas/mcpb-manifest-v0.2.schema.json index d40a9e2..fc522b9 100644 --- a/schemas/mcpb-manifest-v0.2.schema.json +++ b/schemas/mcpb-manifest-v0.2.schema.json @@ -160,56 +160,6 @@ }, "description": { "type": "string" - }, - "inputSchema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "object" - }, - "properties": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "description": { - "type": "string" - }, - "format": { - "type": "string" - } - }, - "required": [ - "type" - ], - "additionalProperties": true - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": true } }, "required": [ diff --git a/schemas/mcpb-manifest-v0.3.schema.json b/schemas/mcpb-manifest-v0.3.schema.json index 1ba2ea0..64471c5 100644 --- a/schemas/mcpb-manifest-v0.3.schema.json +++ b/schemas/mcpb-manifest-v0.3.schema.json @@ -202,56 +202,6 @@ }, "description": { "type": "string" - }, - "inputSchema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "object" - }, - "properties": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "description": { - "type": "string" - }, - "format": { - "type": "string" - } - }, - "required": [ - "type" - ], - "additionalProperties": true - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": true } }, "required": [ diff --git a/schemas/mcpb-manifest-v0.4.schema.json b/schemas/mcpb-manifest-v0.4.schema.json index 76bc330..5917415 100644 --- a/schemas/mcpb-manifest-v0.4.schema.json +++ b/schemas/mcpb-manifest-v0.4.schema.json @@ -203,56 +203,6 @@ }, "description": { "type": "string" - }, - "inputSchema": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "object" - }, - "properties": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "type": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "description": { - "type": "string" - }, - "format": { - "type": "string" - } - }, - "required": [ - "type" - ], - "additionalProperties": true - } - }, - "required": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": [ - "type" - ], - "additionalProperties": true } }, "required": [ diff --git a/src/schemas/0.1.ts b/src/schemas/0.1.ts index 4ba0405..9922195 100644 --- a/src/schemas/0.1.ts +++ b/src/schemas/0.1.ts @@ -45,26 +45,9 @@ export const McpbManifestCompatibilitySchema = z.strictObject({ .optional(), }); -const JSONSchemaPropertySchema = z - .object({ - type: z.union([z.string(), z.array(z.string())]), - description: z.string().optional(), - format: z.string().optional(), - }) - .passthrough(); - -const McpToolInputSchema = z - .object({ - type: z.literal("object"), - properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), - required: z.array(z.string()).optional(), - }) - .passthrough(); - export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), - inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ diff --git a/src/schemas/0.2.ts b/src/schemas/0.2.ts index 74f1f67..bb1de16 100644 --- a/src/schemas/0.2.ts +++ b/src/schemas/0.2.ts @@ -45,27 +45,9 @@ export const McpbManifestCompatibilitySchema = z.strictObject({ .optional(), }); -const JSONSchemaPropertySchema = z - .object({ - type: z.union([z.string(), z.array(z.string())]), - description: z.string().optional(), - format: z.string().optional(), - }) - .passthrough(); - -const McpToolInputSchema = z - .object({ - type: z.literal("object"), - properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), - required: z.array(z.string()).optional(), - }) - .passthrough(); - export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), - // Support for full MCP tool definition - inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ diff --git a/src/schemas/0.3.ts b/src/schemas/0.3.ts index b9ba725..0897e6f 100644 --- a/src/schemas/0.3.ts +++ b/src/schemas/0.3.ts @@ -39,22 +39,18 @@ export const McpbManifestServerSchema = z.strictObject({ mcp_config: McpbManifestMcpConfigSchema, }); -export const McpbManifestCompatibilitySchema = z.strictObject({ - claude_desktop: z.string().optional(), - platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), - runtimes: z - .strictObject({ - python: z.string().optional(), - node: z.string().optional(), - }) - .optional(), -}); - +// Microsoft Windows extension schemas for _meta validation const JSONSchemaPropertySchema = z .object({ type: z.union([z.string(), z.array(z.string())]), description: z.string().optional(), format: z.string().optional(), + enum: z.array(z.string()).optional(), + items: z.any().optional(), + properties: z.record(z.string(), z.any()).optional(), + additionalProperties: z.any().optional(), + required: z.array(z.string()).optional(), + minItems: z.number().optional(), }) .passthrough(); @@ -66,10 +62,64 @@ const McpToolInputSchema = z }) .passthrough(); +const McpToolOutputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + additionalProperties: z.any().optional(), + }) + .passthrough(); + +const McpToolAnnotationsSchema = z + .object({ + destructiveHint: z.boolean().optional(), + idempotentHint: z.boolean().optional(), + readOnlyHint: z.boolean().optional(), + }) + .passthrough(); + +const McpExtendedToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), + outputSchema: McpToolOutputSchema.optional(), + annotations: McpToolAnnotationsSchema.optional(), + }) + .passthrough(); + +const MicrosoftWindowsExtensionSchema = z + .object({ + static_responses: z + .object({ + initialize: z.any().optional(), + "tools/list": z + .object({ + tools: z.array(McpExtendedToolSchema).optional(), + }) + .passthrough() + .optional(), + }) + .passthrough() + .optional(), + }) + .passthrough(); + +export const McpbManifestCompatibilitySchema = z.strictObject({ + claude_desktop: z.string().optional(), + platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), + runtimes: z + .strictObject({ + python: z.string().optional(), + node: z.string().optional(), + }) + .optional(), +}); + export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), - inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ @@ -153,7 +203,12 @@ export const McpbManifestSchema = z user_config: z .record(z.string(), McpbUserConfigurationOptionSchema) .optional(), - _meta: z.record(z.string(), z.record(z.string(), z.any())).optional(), + _meta: z + .object({ + "com.microsoft.windows": MicrosoftWindowsExtensionSchema.optional(), + }) + .and(z.record(z.string(), z.record(z.string(), z.any()))) + .optional(), }) .refine((data) => !!(data.dxt_version || data.manifest_version), { message: diff --git a/src/schemas/0.4.ts b/src/schemas/0.4.ts index 77f5e05..47217ff 100644 --- a/src/schemas/0.4.ts +++ b/src/schemas/0.4.ts @@ -40,22 +40,18 @@ export const McpbManifestServerSchema = z.strictObject({ mcp_config: McpbManifestMcpConfigSchema, }); -export const McpbManifestCompatibilitySchema = z.strictObject({ - claude_desktop: z.string().optional(), - platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), - runtimes: z - .strictObject({ - python: z.string().optional(), - node: z.string().optional(), - }) - .optional(), -}); - +// Microsoft Windows extension schemas for _meta validation const JSONSchemaPropertySchema = z .object({ type: z.union([z.string(), z.array(z.string())]), description: z.string().optional(), format: z.string().optional(), + enum: z.array(z.string()).optional(), + items: z.any().optional(), + properties: z.record(z.string(), z.any()).optional(), + additionalProperties: z.any().optional(), + required: z.array(z.string()).optional(), + minItems: z.number().optional(), }) .passthrough(); @@ -67,10 +63,64 @@ const McpToolInputSchema = z }) .passthrough(); +const McpToolOutputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + additionalProperties: z.any().optional(), + }) + .passthrough(); + +const McpToolAnnotationsSchema = z + .object({ + destructiveHint: z.boolean().optional(), + idempotentHint: z.boolean().optional(), + readOnlyHint: z.boolean().optional(), + }) + .passthrough(); + +const McpExtendedToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), + inputSchema: McpToolInputSchema.optional(), + outputSchema: McpToolOutputSchema.optional(), + annotations: McpToolAnnotationsSchema.optional(), + }) + .passthrough(); + +const MicrosoftWindowsExtensionSchema = z + .object({ + static_responses: z + .object({ + initialize: z.any().optional(), + "tools/list": z + .object({ + tools: z.array(McpExtendedToolSchema).optional(), + }) + .passthrough() + .optional(), + }) + .passthrough() + .optional(), + }) + .passthrough(); + +export const McpbManifestCompatibilitySchema = z.strictObject({ + claude_desktop: z.string().optional(), + platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), + runtimes: z + .strictObject({ + python: z.string().optional(), + node: z.string().optional(), + }) + .optional(), +}); + export const McpbManifestToolSchema = z.strictObject({ name: z.string(), description: z.string().optional(), - inputSchema: McpToolInputSchema.optional(), }); export const McpbManifestPromptSchema = z.strictObject({ @@ -154,7 +204,12 @@ export const McpbManifestSchema = z user_config: z .record(z.string(), McpbUserConfigurationOptionSchema) .optional(), - _meta: z.record(z.string(), z.record(z.string(), z.any())).optional(), + _meta: z + .object({ + "com.microsoft.windows": MicrosoftWindowsExtensionSchema.optional(), + }) + .and(z.record(z.string(), z.record(z.string(), z.any()))) + .optional(), }) .refine((data) => !!(data.dxt_version || data.manifest_version), { message: diff --git a/src/schemas_loose/0.1.ts b/src/schemas_loose/0.1.ts index 90e4680..22a507c 100644 --- a/src/schemas_loose/0.1.ts +++ b/src/schemas_loose/0.1.ts @@ -47,27 +47,10 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -const JSONSchemaPropertySchema = z - .object({ - type: z.union([z.string(), z.array(z.string())]), - description: z.string().optional(), - format: z.string().optional(), - }) - .passthrough(); - -const McpToolInputSchema = z - .object({ - type: z.literal("object"), - properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), - required: z.array(z.string()).optional(), - }) - .passthrough(); - export const McpbManifestToolSchema = z .object({ name: z.string(), description: z.string().optional(), - inputSchema: McpToolInputSchema.optional(), }) .passthrough(); diff --git a/src/schemas_loose/0.2.ts b/src/schemas_loose/0.2.ts index 2ee9865..e57893e 100644 --- a/src/schemas_loose/0.2.ts +++ b/src/schemas_loose/0.2.ts @@ -47,27 +47,10 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -const JSONSchemaPropertySchema = z - .object({ - type: z.union([z.string(), z.array(z.string())]), - description: z.string().optional(), - format: z.string().optional(), - }) - .passthrough(); - -const McpToolInputSchema = z - .object({ - type: z.literal("object"), - properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), - required: z.array(z.string()).optional(), - }) - .passthrough(); - export const McpbManifestToolSchema = z .object({ name: z.string(), description: z.string().optional(), - inputSchema: McpToolInputSchema.optional(), }) .passthrough(); diff --git a/src/schemas_loose/0.3.ts b/src/schemas_loose/0.3.ts index fd006bc..350d39f 100644 --- a/src/schemas_loose/0.3.ts +++ b/src/schemas_loose/0.3.ts @@ -38,24 +38,18 @@ export const McpbManifestServerSchema = z.object({ mcp_config: McpbManifestMcpConfigSchema, }); -export const McpbManifestCompatibilitySchema = z - .object({ - claude_desktop: z.string().optional(), - platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), - runtimes: z - .object({ - python: z.string().optional(), - node: z.string().optional(), - }) - .optional(), - }) - .passthrough(); - +// Microsoft Windows extension schemas for _meta validation const JSONSchemaPropertySchema = z .object({ type: z.union([z.string(), z.array(z.string())]), description: z.string().optional(), format: z.string().optional(), + enum: z.array(z.string()).optional(), + items: z.any().optional(), + properties: z.record(z.string(), z.any()).optional(), + additionalProperties: z.any().optional(), + required: z.array(z.string()).optional(), + minItems: z.number().optional(), }) .passthrough(); @@ -67,11 +61,67 @@ const McpToolInputSchema = z }) .passthrough(); -export const McpbManifestToolSchema = z +const McpToolOutputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + additionalProperties: z.any().optional(), + }) + .passthrough(); + +const McpToolAnnotationsSchema = z + .object({ + destructiveHint: z.boolean().optional(), + idempotentHint: z.boolean().optional(), + readOnlyHint: z.boolean().optional(), + }) + .passthrough(); + +const McpExtendedToolSchema = z .object({ name: z.string(), description: z.string().optional(), inputSchema: McpToolInputSchema.optional(), + outputSchema: McpToolOutputSchema.optional(), + annotations: McpToolAnnotationsSchema.optional(), + }) + .passthrough(); + +const MicrosoftWindowsExtensionSchema = z + .object({ + static_responses: z + .object({ + initialize: z.any().optional(), + "tools/list": z + .object({ + tools: z.array(McpExtendedToolSchema).optional(), + }) + .passthrough() + .optional(), + }) + .passthrough() + .optional(), + }) + .passthrough(); + +export const McpbManifestCompatibilitySchema = z + .object({ + claude_desktop: z.string().optional(), + platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), + runtimes: z + .object({ + python: z.string().optional(), + node: z.string().optional(), + }) + .optional(), + }) + .passthrough(); + +export const McpbManifestToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), }) .passthrough(); @@ -160,7 +210,12 @@ export const McpbManifestSchema = z user_config: z .record(z.string(), McpbUserConfigurationOptionSchema) .optional(), - _meta: z.record(z.string(), z.record(z.string(), z.any())).optional(), + _meta: z + .object({ + "com.microsoft.windows": MicrosoftWindowsExtensionSchema.optional(), + }) + .and(z.record(z.string(), z.record(z.string(), z.any()))) + .optional(), }) .passthrough() .refine((data) => !!(data.dxt_version || data.manifest_version), { diff --git a/src/schemas_loose/0.4.ts b/src/schemas_loose/0.4.ts index 4393ca4..b9bc4f6 100644 --- a/src/schemas_loose/0.4.ts +++ b/src/schemas_loose/0.4.ts @@ -41,24 +41,18 @@ export const McpbManifestServerSchema = z.object({ mcp_config: McpbManifestMcpConfigSchema.optional(), }); -export const McpbManifestCompatibilitySchema = z - .object({ - claude_desktop: z.string().optional(), - platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), - runtimes: z - .object({ - python: z.string().optional(), - node: z.string().optional(), - }) - .optional(), - }) - .passthrough(); - +// Microsoft Windows extension schemas for _meta validation const JSONSchemaPropertySchema = z .object({ type: z.union([z.string(), z.array(z.string())]), description: z.string().optional(), format: z.string().optional(), + enum: z.array(z.string()).optional(), + items: z.any().optional(), + properties: z.record(z.string(), z.any()).optional(), + additionalProperties: z.any().optional(), + required: z.array(z.string()).optional(), + minItems: z.number().optional(), }) .passthrough(); @@ -70,11 +64,67 @@ const McpToolInputSchema = z }) .passthrough(); -export const McpbManifestToolSchema = z +const McpToolOutputSchema = z + .object({ + type: z.literal("object"), + properties: z.record(z.string(), JSONSchemaPropertySchema).optional(), + required: z.array(z.string()).optional(), + additionalProperties: z.any().optional(), + }) + .passthrough(); + +const McpToolAnnotationsSchema = z + .object({ + destructiveHint: z.boolean().optional(), + idempotentHint: z.boolean().optional(), + readOnlyHint: z.boolean().optional(), + }) + .passthrough(); + +const McpExtendedToolSchema = z .object({ name: z.string(), description: z.string().optional(), inputSchema: McpToolInputSchema.optional(), + outputSchema: McpToolOutputSchema.optional(), + annotations: McpToolAnnotationsSchema.optional(), + }) + .passthrough(); + +const MicrosoftWindowsExtensionSchema = z + .object({ + static_responses: z + .object({ + initialize: z.any().optional(), + "tools/list": z + .object({ + tools: z.array(McpExtendedToolSchema).optional(), + }) + .passthrough() + .optional(), + }) + .passthrough() + .optional(), + }) + .passthrough(); + +export const McpbManifestCompatibilitySchema = z + .object({ + claude_desktop: z.string().optional(), + platforms: z.array(z.enum(["darwin", "win32", "linux"])).optional(), + runtimes: z + .object({ + python: z.string().optional(), + node: z.string().optional(), + }) + .optional(), + }) + .passthrough(); + +export const McpbManifestToolSchema = z + .object({ + name: z.string(), + description: z.string().optional(), }) .passthrough(); @@ -163,7 +213,12 @@ export const McpbManifestSchema = z user_config: z .record(z.string(), McpbUserConfigurationOptionSchema) .optional(), - _meta: z.record(z.string(), z.record(z.string(), z.any())).optional(), + _meta: z + .object({ + "com.microsoft.windows": MicrosoftWindowsExtensionSchema.optional(), + }) + .and(z.record(z.string(), z.record(z.string(), z.any()))) + .optional(), }) .passthrough() .refine((data) => !!(data.dxt_version || data.manifest_version), { From 8dd0a7accb80c1f7745bd6ef0d284609b53b6bec Mon Sep 17 00:00:00 2001 From: Richa Dua Date: Thu, 29 Jan 2026 17:23:31 -0800 Subject: [PATCH 3/3] Undo extra lines --- src/schemas_loose/0.1.ts | 10 ++++------ src/schemas_loose/0.2.ts | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/schemas_loose/0.1.ts b/src/schemas_loose/0.1.ts index 22a507c..ab7f69c 100644 --- a/src/schemas_loose/0.1.ts +++ b/src/schemas_loose/0.1.ts @@ -47,12 +47,10 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -export const McpbManifestToolSchema = z - .object({ - name: z.string(), - description: z.string().optional(), - }) - .passthrough(); +export const McpbManifestToolSchema = z.object({ + name: z.string(), + description: z.string().optional(), +}); export const McpbManifestPromptSchema = z.object({ name: z.string(), diff --git a/src/schemas_loose/0.2.ts b/src/schemas_loose/0.2.ts index e57893e..bc177d2 100644 --- a/src/schemas_loose/0.2.ts +++ b/src/schemas_loose/0.2.ts @@ -47,12 +47,10 @@ export const McpbManifestCompatibilitySchema = z }) .passthrough(); -export const McpbManifestToolSchema = z - .object({ - name: z.string(), - description: z.string().optional(), - }) - .passthrough(); +export const McpbManifestToolSchema = z.object({ + name: z.string(), + description: z.string().optional(), +}); export const McpbManifestPromptSchema = z.object({ name: z.string(),