fix(mcp): keep null values inside a message payload - #544
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #517.
A message sent through the MCP
messagetool now keeps everynullin its JSON payload. Before, each null-valued key was removed at any depth of the payload whilesendstill 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
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.