Skip to content

fix(mcp): accept a null message payload, as the schema and the HTTP API do - #557

Merged
kevintseng merged 2 commits into
mainfrom
fix/mcp-null-payload
Sep 30, 2026
Merged

kevintseng merged 2 commits into
mainfrom
fix/mcp-null-payload

Conversation

@kevintseng

Copy link
Copy Markdown
Contributor

Refs #553.

What was wrong

The MCP message tool refused send with payload: null ("payload: Invalid input"), although the tool's own schema lists null and the HTTP API and the CLI accept it and store it.

What changed

  • payload: null on send is accepted over MCP and stored as null; fetch returns it. A top-level null on any other parameter still means "left blank", and a payload on any action other than send is still refused.

Tests

  • tests/transports/mcp-payload-nulls.test.ts covers the MCP handler, and tests/transports/mcp-null-payload-stdio.test.ts drives the packaged MCP server over stdio. Both fail without the fix and pass with it.
  • npm run verify is green.

…PI do

`message` `send` over MCP refused `payload: null` with "payload: Invalid
input", although the tool's schema lists null and `POST /v1/message` and the
CLI store it. The MCP boundary drops null-valued top-level parameters as
"left blank"; for `payload` a null is the value itself, so it is kept.

Refs #553
A regression test drives the built MCP server over stdio: `send` with
`payload: null` succeeds, `fetch` returns `payload: null`, and a send with
no payload, or a payload on `fetch`, is still refused. The boundary comment
and the changelog now say that a null `payload` is a value, the one
exception to "a null top-level parameter means left blank".

Refs #553
@kevintseng
kevintseng merged commit 3c8cda5 into main Sep 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant