Skip to content

fix(mcp): keep null values inside a message payload - #544

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

kevintseng merged 2 commits into
mainfrom
fix/mcp-message-payload-nulls

Conversation

@kevintseng

Copy link
Copy Markdown
Contributor

Closes #517.

A message sent through the MCP message tool now keeps every null in its JSON payload. Before, each null-valued key was removed at any depth of the payload while send still reported success, so the recipient got different data than the CLI or HTTP stores. A null-valued top-level tool parameter still means "left blank" (clients that fill blank optional parameters with null keep working).

Tests

  • New tests/transports/mcp-payload-nulls.test.ts: send/fetch keeps nulls at every depth; MCP and the HTTP/CLI path store the same payload; a null top-level optional parameter is still treated as blank. Fails without the fix (2 of 3).
  • npm run verify: green.

The MCP message tool dropped every null-valued key at any depth of the
payload while send still reported success, so the recipient got different
data than the CLI or HTTP would store. Only a null-valued top-level tool
parameter is now treated as left blank; what a parameter carries is
passed on as sent.

Closes #517
The first MCP call of a process can append an update notice as a second
content block, so joining every block before parsing failed on Windows.
@kevintseng
kevintseng merged commit 957d2e7 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.

MCP message send silently drops null values from the payload

1 participant