CherryHQ/cherry-studio · error · Error

Invalid manifest: missing server.mcp_config.command

Error message

Invalid manifest: missing server.mcp_config.command

What it means

Thrown during MCP package (.dxt or .mcpb) installation when the extracted manifest.json lacks a `server.mcp_config.command` string. The command field tells the runtime which executable to launch (e.g. 'npx', 'uvx', 'node'). This is part of a sequential validation chain that checks name → version → server → mcp_config → command → args.

Source

Thrown at src/main/ai/mcp/McpPackageService.ts:562

        if (!parsedManifest.dxt_version) {
          throw new Error('Invalid manifest: missing dxt_version')
        }
        manifest = { ...parsedManifest, dxt_version: parsedManifest.dxt_version }
      }
      if (!manifest.name) {
        throw new Error('Invalid manifest: missing name')
      }
      if (!manifest.version) {
        throw new Error('Invalid manifest: missing version')
      }
      if (!manifest.server) {
        throw new Error('Invalid manifest: missing server configuration')
      }
      if (!manifest.server.mcp_config) {
        throw new Error('Invalid manifest: missing server.mcp_config')
      }
      if (!manifest.server.mcp_config.command) {
        throw new Error('Invalid manifest: missing server.mcp_config.command')
      }
      if (!Array.isArray(manifest.server.mcp_config.args)) {
        throw new Error('Invalid manifest: server.mcp_config.args must be an array')
      }

      // Use server name as the final extract directory for automatic version management
      const serverDirName = `server-${manifest.name}`
      const finalExtractDir = ensurePathWithin(this.mcpDir, path.join(this.mcpDir, serverDirName))

      // Stage the new package first, then swap directories so a failed install
      // does not destroy the last working version.
      await this.replacePackageDirectory(tempExtractDir, finalExtractDir, serverDirName)
      logger.debug(`${packageLabel} server extracted to: ${finalExtractDir}`)

      // Clean up the uploaded package file if it's in temp directory
      if (filePath.startsWith(this.tempDir)) {
        fs.unlinkSync(filePath)
      }

View on GitHub (pinned to 726446b54c)

Solutions

  1. Open the package archive and inspect manifest.json — confirm `server.mcp_config.command` exists and is a non-empty string
  2. If authoring the package, add the command: "server": { "mcp_config": { "command": "npx", "args": [] } }
  3. Verify the manifest version field (manifest_version for .mcpb, dxt_version for .dxt) matches the spec the validator expects
  4. Re-package the archive with the corrected manifest.json at the root level

Example fix

// before (manifest.json)
{
  "name": "my-server",
  "version": "1.0.0",
  "server": {
    "mcp_config": {
      "args": ["-y", "@my/mcp-server"]
    }
  }
}

// after
{
  "name": "my-server",
  "version": "1.0.0",
  "server": {
    "mcp_config": {
      "command": "npx",
      "args": ["-y", "@my/mcp-server"]
    }
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// Validate manifest before passing to the package processor
function validateManifest(manifest: unknown): asserts manifest is McpPackageManifest {
  const m = manifest as Record<string, any>
  if (!m?.server?.mcp_config?.command) {
    throw new Error('Manifest must include server.mcp_config.command')
  }
}

Type guard

function hasValidCommand(manifest: unknown): manifest is McpPackageManifest {
  return typeof (manifest as any)?.server?.mcp_config?.command === 'string'
    && (manifest as any).server.mcp_config.command.length > 0
}

Try / catch

try {
  await mcpPackageService.processUploadedPackage(filePath)
} catch (e) {
  if (e instanceof Error && e.message.includes('missing server.mcp_config.command')) {
    // Show user: package manifest is incomplete, cannot install
  }
  throw e
}

Prevention

When it happens

Trigger: Calling the package upload/processing method (processUploadedPackage) with an archive whose manifest.json has `server.mcp_config` defined but no `command` key, or `command` is an empty string/falsy value.

Common situations: Hand-authoring a manifest.json and forgetting the command field; using a wrong key name like 'cmd' or 'binary'; manifest follows an outdated or non-standard DXT/MCPB spec version; the package was generated by a tool that omits command.

Related errors


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/3d21b95d0153daa2. Report an issue: GitHub.