mcp: update JSON marshaling to not HTML-escape messages (#769)

It's causing some servers to fail: #767. I checked with Typescript
implementation and it doesn't do any escaping.

It's still a behavior change, so we'll expose a way to bring back the previous behavior via an env var.

Fixes #238 
Fixes #767
This commit is contained in:
Maciej Kisiel 2026-01-30 17:13:30 +01:00 • committed by GitHub
commit bba5acdc8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,8 +17,7 @@ import (
func TestCopyrightHeaders(t *testing.T) {
var re = regexp.MustCompile(`Copyright \d{4} The Go MCP SDK Authors. All rights reserved.
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file.`)
Use of this source code is governed by (the license\n|an MIT-style\nlicense )that can be found in the LICENSE file.`)
err := filepath.WalkDir(".", func(path string, d fs.DirEntry, err error) error {
if err != nil {