all scenarios

Truncated / malformed JSON

malformed-json · Transport & framing

Endpoint (Streamable HTTP)
https://chaos-mcp.thomascdnns.com/s/malformed-json/mcp
On the wire — recorded from a real request
your clientchaos-mcp01initializePOST /s/malformed-json/mcp200 OK · application/json · 8 ms{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2024-11-0! body does not parse as JSON — unterminated string starting at! no Content-Length — body delimited by connection closetools/list answers identically — every request does

Symptom

what you'll observe

Client errors with 'Unexpected end of JSON input' or a parse error on every call.

Cause

what this reproduces

Response serialization bug, a panic mid-write, or a proxy that truncates the body.

Fix

how you'd resolve it

Marshal the full object before writing; never stream partial JSON; check upstream proxy buffering.

Try it with curl
bash
curl -sS -X POST \
  https://chaos-mcp.thomascdnns.com/s/malformed-json/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '
"jsonrpc""2.0"
"id"1
"method""initialize"
"params"
"protocolVersion""2024-11-05"
"capabilities"
"clientInfo""name""curl""version""1"

'