Skip to content

mcp publish rejects any .mcpb bundle that declares tools (MCPB tools schema ⊥ registry Tool schema) #787

Description

@swperb

Summary

smithery mcp publish <bundle>.mcpb fails with a 400 from the registry whenever the bundle's manifest.json declares any tools. The CLI forwards MCPB tools to the registry as MCP Tool[] (which require inputSchema), but the MCPB manifest format forbids inputSchema on tool entries — so there is no manifest that satisfies both tools. The only way to publish a bundle is to omit tools entirely.

Reproduction

manifest.json (minimal node bundle) with one tool:

{
  "manifest_version": "0.3",
  "name": "repro-tools-schema",
  "version": "0.0.1",
  "description": "Minimal repro.",
  "author": { "name": "repro" },
  "server": {
    "type": "node",
    "entry_point": "index.js",
    "mcp_config": { "command": "node", "args": ["${__dirname}/index.js"] }
  },
  "tools": [
    { "name": "do_thing", "description": "does a thing" }
  ]
}
  1. mcpb pack .succeeds.
  2. smithery mcp publish ./repro.mcpb -n <ns>/repro
Publishing <ns>/repro (stdio) to Smithery Registry...
Deployment failed: 400 {"error":"Invalid input: expected object, received undefined"}

With N tools you get the error repeated N times (...; ...; ...) — one per tool, for the missing inputSchema object.

Trying to fix it by adding inputSchema to the tool makes the other tool reject the manifest:

$ mcpb pack .
Validating manifest...
ERROR: Manifest validation failed:
  - tools.0: Unrecognized key(s) in object: 'inputSchema'
ERROR: Cannot pack extension with invalid manifest

So mcpb pack and smithery mcp publish disagree on the tool schema, and there's no manifest that passes both.

Root cause

In getBundleDeployPayload() (src/lib/mcpb.ts), the MCPB manifest's tools are forwarded onto the serverCard with a cast that papers over the type mismatch:

...(manifest.tools
  ? { tools: manifest.tools as unknown as ServerCard["tools"] }
  : {}),

MCPB tool entries are { name, description? } (the MCPB schema sets additionalProperties: false, hence the inputSchema rejection in mcpb pack). But ServerCard["tools"] is MCP Tool[], where inputSchema is a required object. The registry then validates each forwarded tool and rejects the missing inputSchema with expected object, received undefined.

Suggested fix

When mapping MCPB toolsserverCard.tools, synthesize a permissive default for the field MCPB can't carry, e.g.:

tools: manifest.tools.map(t => ({
  name: t.name,
  description: t.description,
  inputSchema: { type: "object" },   // MCPB tools can't declare this; default it
})),

This preserves the tool names/descriptions in the registry listing instead of forcing publishers to drop tools. (Alternatively: don't forward MCPB tools at all and rely on runtime introspection — but that loses the listing metadata.)

Impact

Any .mcpb bundle that documents its tools — which the MCPB format explicitly encourages — cannot be published. The failure mode is opaque (expected object, received undefined, no field name), so it's hard to diagnose without reading the CLI source. Workaround today: delete tools from the manifest before mcpb pack.

Environment

  • @smithery/cli 4.11.1
  • @anthropic-ai/mcpb 2.1.2
  • manifest_version "0.3", node bundle, stdio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions