Keep invalid UTF-8 header values out of the header mismatch message

Merged
LA
16d ago
+88-3

An Mcp-Name header like =?base64?/w==?= decodes to a lone 0xFF byte, and the mismatch message echoed that decoded value. response()->json() then fails on the malformed UTF-8 and the request ends as a 500 instead of the -32020 error.

The message now uses the header's string form, which keeps printable ASCII values as they are and re-encodes anything else with the base64 sentinel, so the response is always valid JSON. The legacy unsupported version error had the same problem with a raw MCP-Protocol-Version header in data.requested, so it gets the same treatment.

Fixes #390