openclaw - ✅(Solved) Fix [Bug]: MCP server fails to load — invalid_value expected "object" in inputSchema.type [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63602Fetched 2026-04-10 03:42:34
View on GitHub
Comments
1
Participants
2
Timeline
12
Reactions
0
Timeline (top)
referenced ×8labeled ×2commented ×1cross-referenced ×1

OpenClaw fails to load any MCP server with error: bundle-mcp: failed to start server — Invalid input: expected "object" (tools[x].inputSchema.type). All modern MCP servers use this format per the MCP spec.

Error Message

OpenClaw fails to load any MCP server with error: bundle-mcp: failed to start server — Invalid input: expected "object" (tools[x].inputSchema.type). All modern MCP servers use this format per the MCP spec. Error: Invalid input: expected "object" at tools[0..24].inputSchema.type

Root Cause

OpenClaw fails to load any MCP server with error: bundle-mcp: failed to start server — Invalid input: expected "object" (tools[x].inputSchema.type). All modern MCP servers use this format per the MCP spec.

Fix Action

Fixed

PR fix notes

PR #63634: fix: accept valid MCP tool schemas without strict inputSchema.type check

Description (problem / solution / changelog)

Summary

Fixes MCP server loading failure when tools have inputSchema without explicit type: "object".

Closes #63602

Changes

  • Replace client.listTools() with client.request() using a lenient Zod schema (LenientListToolsResultSchema) that accepts inputSchema as any record rather than requiring type: z.literal("object")
  • Add normalizeInputSchema() to ensure the catalog always contains type: "object" after listing, so downstream LLM providers receive valid tool definitions
  • Existing tools with type: "object" are passed through unchanged (no-op path)

Root Cause

The MCP SDK v1.29.0 ToolSchema validates inputSchema.type as z.literal("object"). Some MCP servers (especially those using older SDKs or custom implementations) omit the type field from their inputSchema, returning e.g. { properties: { ... } } without type: "object". This causes a Zod validation error: invalid_value expected "object" in inputSchema.type.

Testing

  • All 23 existing tests across 4 test files pass (runtime, materialize, plugin-tools-serve, schema)
  • The fix is backward-compatible: servers that already return type: "object" are unaffected
  • TypeScript compilation passes with no errors

This PR was generated with AI assistance (Claude).

Changed files

  • src/agents/pi-bundle-mcp-runtime.test.ts (modified, +28/-0)
  • src/agents/pi-bundle-mcp-runtime.ts (modified, +45/-5)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

OpenClaw fails to load any MCP server with error: bundle-mcp: failed to start server — Invalid input: expected "object" (tools[x].inputSchema.type). All modern MCP servers use this format per the MCP spec.

Steps to reproduce

  1. openclaw mcp set playwright '{"command":"npx","args":["@playwright/mcp@latest"]}'
  2. openclaw gateway restart
  3. Check logs: bundle-mcp: failed to start server "playwright" — Invalid input: expected "object"

Expected behavior

MCP server loads successfully and browser automation tools become available in the agent session.

Actual behavior

bundle-mcp: failed to start server "playwright" (npx @playwright/mcp@latest) Error: Invalid input: expected "object" at tools[0..24].inputSchema.type

Tested: @playwright/[email protected], @playwright/[email protected], @playwright/mcp@latest, @modelcontextprotocol/server-puppeteer — all fail identically.

OpenClaw version

2026.4.9 (0512059)

Operating system

macOS Darwin 25.3.0 arm64

Install method

No response

Model

anthropic/claude-sonnet-4-6

Provider / routing chain

openclaw -> anthropic

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

Node: v24.14.0 Install: npm global Model: anthropic/claude-sonnet-4-6

This appears to be a breaking change in how OpenClaw validates MCP tool schemas — all MCP servers using modern inputSchema format are affected.

extent analysis

TL;DR

Update OpenClaw to a version that supports the modern MCP server inputSchema format or modify the MCP server configuration to match the expected input format.

Guidance

  • Verify the OpenClaw version and check if there are any updates available that address the inputSchema format issue.
  • Review the MCP server configuration and check if the inputSchema type can be modified to match the expected "object" format.
  • Test the MCP server with a different inputSchema format to isolate the issue and confirm that it's related to the format change.
  • Consider reaching out to the OpenClaw or MCP server maintainers for guidance on resolving the compatibility issue.

Example

No code snippet is provided as the issue is related to configuration and compatibility rather than code.

Notes

The issue appears to be related to a breaking change in OpenClaw's validation of MCP tool schemas, and resolving it may require updating OpenClaw or modifying the MCP server configuration.

Recommendation

Apply a workaround by modifying the MCP server configuration to match the expected input format, as updating OpenClaw may not be feasible or available at this time.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

MCP server loads successfully and browser automation tools become available in the agent session.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING