Skip to content

MCP: answer a POST without content with a parse error (#1768) - #1769

Merged
jlouvel merged 2 commits into
3.0from
fix/mcp-empty-body
Nov 30, 2026
Merged

jlouvel merged 2 commits into
3.0from
fix/mcp-empty-body

Conversation

@jlouvel

@jlouvel jlouvel commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1768.

McpMessages.read now reads an entity without a stream as an empty message, so a POST with no content takes the parse-error path instead of failing with a NullPointerException and a 503.

Test: McpServerAdapterTestCase.aRequestWithoutContentIsAParseError, for a 2025-11-25 and a 2026-07-28 request. ./mvnw verify -P default,test -pl org.restlet.ext.mcp: 253 tests, JaCoCo, SpotBugs.

🤖 Generated with Claude Code

@jlouvel jlouvel left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is correct for the server paths: the modern exchange, the legacy server, the unsupported-version reply and the STDIO helper all take a sensible path on an empty message. Two points need action.

@sonarqubecloud

Copy link
Copy Markdown

@jlouvel
jlouvel merged commit 57221d4 into 3.0 Nov 30, 2026
3 checks passed
@jlouvel
jlouvel deleted the fix/mcp-empty-body branch November 30, 2026 02:39
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