{"record":{"id":"5e2c29ad125beaf5","repo":"CherryHQ/cherry-studio","slug":"invalid-manifest-missing-dxt-version","errorCode":null,"errorMessage":"Invalid manifest: missing dxt_version","messagePattern":"Invalid manifest: missing dxt_version","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ai/mcp/McpPackageService.ts","lineNumber":545,"sourceCode":"      // 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) {\n        throw new Error('Invalid manifest: missing server.mcp_config')\n      }\n      if (!manifest.server.mcp_config.command) {\n        throw new Error('Invalid manifest: missing server.mcp_config.command')\n      }","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/mcp/McpPackageService.ts#L527-L563","documentation":"Thrown during manifest validation when the package format is 'dxt' and the parsed manifest has no dxt_version field. The dxt format requires a top-level dxt_version string. The check is the dxt branch of the format-specific validation; the mcpb branch checks manifest_version instead. Runs after JSON.parse, so a missing field, not malformed JSON.","triggerScenarios":"A .dxt archive's manifest.json omits \"dxt_version\" or sets it to a falsy value. Often the author used the newer mcpb schema (manifest_version) but named the file .dxt.","commonSituations":"Schema drift: a manifest written for the mcpb format was uploaded as .dxt; the manifest template was incomplete; the field was renamed in a tool but the version key was not updated.","solutions":["Add a top-level \"dxt_version\" field to manifest.json (e.g. \"0.1\").","If the manifest actually uses manifest_version, either re-upload as .mcpb or convert the manifest to the dxt schema.","Repackage and re-upload."],"exampleFix":"// manifest.json - before (uploaded as .dxt)\n{ \"manifest_version\": \"1\", \"name\": \"x\", ... }\n// after\n{ \"dxt_version\": \"0.1\", \"name\": \"x\", ... }","handlingStrategy":"validation","validationCode":"function dxtManifestHasVersion(manifest: any): boolean {\n  return manifest && typeof manifest.dxt_version === 'string' && manifest.dxt_version.length > 0\n}","typeGuard":"function isDxtManifestShape(m: any): m is { dxt_version: string } {\n  return !!m && typeof m.dxt_version === 'string' && m.dxt_version.length > 0\n}","tryCatchPattern":null,"preventionTips":["Match the manifest schema to the file extension: .dxt → dxt_version, .mcpb → manifest_version.","Pin a known-good dxt_version in your manifest template and copy from it for new packages.","Lint the manifest in CI against the dxt schema before publishing."],"tags":["mcp","manifest","validation","dxt"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}