{"record":{"id":"203972968338ceba","repo":"CherryHQ/cherry-studio","slug":"invalid-manifest-missing-manifest-version","errorCode":null,"errorMessage":"Invalid manifest: missing manifest_version","messagePattern":"Invalid manifest: missing manifest_version","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ai/mcp/McpPackageService.ts","lineNumber":540,"sourceCode":"        await zip.extract(null, tempExtractDir)\n      } finally {\n        await zip.close()\n      }\n\n      // Read and validate the manifest.json\n      const manifestPath = path.join(tempExtractDir, 'manifest.json')\n      if (!fs.existsSync(manifestPath)) {\n        throw new Error(`manifest.json not found in ${packageLabel} file`)\n      }\n\n      const manifestContent = fs.readFileSync(manifestPath, 'utf-8')\n      const parsedManifest: ParsedMcpPackageManifest = JSON.parse(manifestContent)\n\n      // Validate required fields in manifest\n      let manifest: McpPackageManifest\n      if (packageFormat === 'mcpb') {\n        if (!parsedManifest.manifest_version) {\n          throw new Error('Invalid manifest: missing manifest_version')\n        }\n        manifest = { ...parsedManifest, manifest_version: parsedManifest.manifest_version }\n      } else {\n        if (!parsedManifest.dxt_version) {\n          throw new Error('Invalid manifest: missing dxt_version')\n        }\n        manifest = { ...parsedManifest, dxt_version: parsedManifest.dxt_version }\n      }\n      if (!manifest.name) {\n        throw new Error('Invalid manifest: missing name')\n      }\n      if (!manifest.version) {\n        throw new Error('Invalid manifest: missing version')\n      }\n      if (!manifest.server) {\n        throw new Error('Invalid manifest: missing server configuration')\n      }\n      if (!manifest.server.mcp_config) {","sourceCodeStart":522,"sourceCodeEnd":558,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/mcp/McpPackageService.ts#L522-L558","documentation":"Thrown during manifest validation when the package format is 'mcpb' and the parsed manifest has no manifest_version field. The mcpb format requires a top-level manifest_version string (analogous to dxt_version for the .dxt format). The check runs after JSON.parse succeeds, so this is specifically about a missing field, not a malformed JSON.","triggerScenarios":"An mcpb archive's manifest.json parses correctly but omits the top-level \"manifest_version\" key, or sets it to a falsy value (empty string, null).","commonSituations":"The author wrote a manifest for the older dxt format (using dxt_version) and renamed the file extension to .mcpb without changing the schema; the manifest template used did not include the version field; a field was misspelled (e.g. \"manifestVersion\").","solutions":["Open the package's manifest.json and add a top-level \"manifest_version\" field with a valid version string (e.g. \"1\").","Confirm the file uses the mcpb schema (manifest_version) and not the dxt schema (dxt_version); if it is a dxt manifest, upload it as a .dxt instead.","Repackage and re-upload."],"exampleFix":"// manifest.json - before (uploaded as .mcpb)\n{ \"dxt_version\": \"0.1\", \"name\": \"x\", ... }\n// after\n{ \"manifest_version\": \"1\", \"name\": \"x\", ... }","handlingStrategy":"validation","validationCode":"function mcpbManifestHasVersion(manifest: any): boolean {\n  return manifest && typeof manifest.manifest_version === 'string' && manifest.manifest_version.length > 0\n}","typeGuard":"function isMcpbManifestShape(m: any): m is { manifest_version: string } {\n  return !!m && typeof m.manifest_version === 'string' && m.manifest_version.length > 0\n}","tryCatchPattern":null,"preventionTips":["Use the correct schema for the format: mcpb → manifest_version, dxt → dxt_version. Do not mix.","Add a manifest linter to the package build that asserts the version field matches the file extension.","Start from an official mcpb manifest template so the version field is present by construction."],"tags":["mcp","manifest","validation","mcpb"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}