go-sdk
go-sdk copied to clipboard
mcp: an empty x-mcp-header argument or name is rejected as a missing header
On a 2026-07-28 session, a tool call whose x-mcp-header argument is "" fails between this SDK's own client and server. The client sends Mcp-Param-Region with an empty value. That is correct, since only a null or omitted argument omits the header, and the conformance suite's http-custom-headers scenario checks it with empty_val: ''. The server tests presence with Header.Get, which returns "" for an empty value and for a missing header alike. So it answers 400 with header mismatch: missing Mcp-Param-Region header for parameter "region".
The Mcp-Name check has the same problem: a prompt or tool named "" works on 2025-11-25 and gets a 400 on 2026-07-28. I have a small fix with tests and will open a PR.