go-sdk/internal
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Maciej Kisiel 580f2a09be
mcp: verify 'Origin' and 'Content-Type' headers (#842)
This PR introduces protection against cross-origin requests by
installing `http.CrossOriginProtection`.
By default, the zero value is used which does not contain any trusted
origins or bypass patterns.
The protection can be customized by providing a custom
`http.CrossOriginProtection` in `mcp.StreamableHTTPOptions`. Currently,
the deny handler set on the protection is ignored.
This default has an MCPGODEBUG option (`disableoriginverification`) to
disable the default protection.
It will be available until `v1.6.0` of the SDK.
We also increase the Go version required by the SDK to 1.25, since this
is the version that introduced `http.CrossOriginProtection`. This is in
line with the SDK's policy of supporting two newest Go versions (1.26
was released in February 2026).

Additionally, we start validating if the `Content-Type` header for
`POST` requests is set to `application/json` to avoid accepting
CORS-safelisted requests.
2026-03-13 10:43:25 +00:00
..
docs mcp: verify 'Origin' and 'Content-Type' headers (#842) 2026-03-13 10:43:25 +00:00
json internal: fix Unicode zero character handling (#841) 2026-03-13 10:37:48 +00:00
jsonrpc2 all: use case-sensitive JSON unmarshaling (#807) 2026-02-18 16:38:36 +01:00
mcpgodebug mcp: update JSON marshaling to not HTML-escape messages (#769) 2026-01-30 17:13:30 +01:00
oauthtest all: client side OAuth support (#785) 2026-02-27 15:30:13 +01:00
readme all: client side OAuth support (#785) 2026-02-27 15:30:13 +01:00
util mcp: add automatic DNS rebinding protection for localhost servers (#760) 2026-02-13 16:23:32 +01:00
xcontext x/tools: modernize interface{} -> any 2025-02-19 15:14:27 -08:00