MCPcopy
hub / github.com/codeaashu/claude-code / validateManifest

Function validateManifest

src/utils/dxt/helpers.ts:13–34  ·  view source on GitHub ↗
(
  manifestJson: unknown,
)

Source from the content-addressed store, hash-verified

11 * closures out of the startup heap for sessions that never touch .dxt/.mcpb.
12 */
13export async function validateManifest(
14 manifestJson: unknown,
15): Promise<McpbManifest> {
16 const { McpbManifestSchema } = await import('@anthropic-ai/mcpb')
17 const parseResult = McpbManifestSchema.safeParse(manifestJson)
18
19 if (!parseResult.success) {
20 const errors = parseResult.error.flatten()
21 const errorMessages = [
22 ...Object.entries(errors.fieldErrors).map(
23 ([field, errs]) => `${field}: ${errs?.join(', ')}`,
24 ),
25 ...(errors.formErrors || []),
26 ]
27 .filter(Boolean)
28 .join('; ')
29
30 throw new Error(`Invalid manifest: ${errorMessages}`)
31 }
32
33 return parseResult.data
34}
35
36/**
37 * Parses and validates a DXT manifest from raw text data.

Callers 3

runValidationFunction · 0.50
pluginValidateHandlerFunction · 0.50

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected