Commit a82e67c
authored
chore: upgrade go-sdk to v1.5.0 and address go-fan review items (#3610)
The project was on `go-sdk` v1.4.1 while v1.5.0 was available, and two
fragility concerns were identified: session expiry detection via string
matching and SSE deprecation warnings bypassing the structured logger.
## Changes
- **`go.mod`/`go.sum`** — upgrade
`github.com/modelcontextprotocol/go-sdk` v1.4.1 → v1.5.0
- **`internal/mcp/http_transport.go`** — replace string-matching session
error detection with the typed sentinel introduced in v1.5.0, retaining
string-match as fallback for non-SDK (plain JSON-RPC) transports:
```go
// Before (fragile):
return strings.Contains(strings.ToLower(err.Error()), "session not
found")
// After (robust, with fallback):
if errors.Is(err, sdk.ErrSessionMissing) { return true }
return strings.Contains(strings.ToLower(err.Error()), "session not
found")
```
- **`internal/mcp/connection.go`** — route SSE deprecation `log.Printf`
calls through `logger.LogWarn` so they appear in `mcp-gateway.log`
instead of bypassing the structured logging pipeline
- **`internal/server/tool_registry.go`** — update
`registerToolWithoutValidation` comment to accurately reflect v1.5.0
`Server.AddTool` behaviour: now enforces `type: "object"` on the input
schema but still does not validate argument values at call time; notes
verification against v1.5.0 source
> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `example.com`
> - Triggering command: `/tmp/go-build347415617/b510/launcher.test
/tmp/go-build347415617/b510/launcher.test
-test.testlogfile=/tmp/go-build347415617/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/net -trimpath
de/node/bin/as -p io -lang=go1.25 o_main.o -I uf@v1.36.11/refl-errorsas
uf@v1.36.11/refl-ifaceassert x_amd64/vet --gdwarf-5 --64 -o x_amd64/vet`
(dns block)
> - Triggering command: `/tmp/go-build2356109318/b510/launcher.test
/tmp/go-build2356109318/b510/launcher.test
-test.testlogfile=/tmp/go-build2356109318/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true eFSy5PFyu cfg
64/pkg/tool/linux_amd64/vet --gdwarf-5 --64 -o 64/pkg/tool/linu--others
pkg/�� om/davecgh/go-spew@v1.1.1/spew/bypass.go cfg
64/pkg/tool/linux_amd64/vet -plugin-opt=-pasbash g/grpc/internal/--norc
-plugin-opt=-pas--noprofile 64/pkg/tool/linux_amd64/vet` (dns block)
> - Triggering command: `/tmp/go-build2885812085/b514/launcher.test
/tmp/go-build2885812085/b514/launcher.test
-test.testlogfile=/tmp/go-build2885812085/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� -bool -buildtags iginal
-errorsas -ifaceassert -nilfunc iginal -ato��
/launcher/connection_pool.go /launcher/health_monitor.go x_amd64/vet
-errorsas -ifaceassert -nilfunc x_amd64/vet` (dns block)
> - `invalid-host-that-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build347415617/b492/config.test
/tmp/go-build347415617/b492/config.test
-test.testlogfile=/tmp/go-build347415617/b492/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true o
/home/REDACTED/go/pkg/mod/github.c--64 x_amd64/compile
/home/REDACTED/go//opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linux_amd64/vet
fips140/ecdsa /home/REDACTED/go/-unreachable=false x_amd64/compile
ual_�� azero@v1.11.0/internal/wasmdebug-p
azero@v1.11.0/internal/wasmdebuggolang.org/x/net/http2 x_amd64/asm -p
crypto/internal/-atomic -lang=go1.25 x_amd64/asm` (dns block)
> - Triggering command: `/tmp/go-build2885812085/b496/config.test
/tmp/go-build2885812085/b496/config.test
-test.testlogfile=/tmp/go-build2885812085/b496/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -uns�� -unreachable=false
/tmp/go-build347415617/b075/vet.cfg ash g_.a gmYLA_3tW .13/x64/as
/opt/hostedtoolcache/go/1.25.8/x64/pkg/tool/linu--others -ato�� -bool
-buildtags 86_64/git -errorsas -ifaceassert -nilfunc iginal` (dns block)
> - `nonexistent.local`
> - Triggering command: `/tmp/go-build347415617/b510/launcher.test
/tmp/go-build347415617/b510/launcher.test
-test.testlogfile=/tmp/go-build347415617/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/net -trimpath
de/node/bin/as -p io -lang=go1.25 o_main.o -I uf@v1.36.11/refl-errorsas
uf@v1.36.11/refl-ifaceassert x_amd64/vet --gdwarf-5 --64 -o x_amd64/vet`
(dns block)
> - Triggering command: `/tmp/go-build2356109318/b510/launcher.test
/tmp/go-build2356109318/b510/launcher.test
-test.testlogfile=/tmp/go-build2356109318/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true eFSy5PFyu cfg
64/pkg/tool/linux_amd64/vet --gdwarf-5 --64 -o 64/pkg/tool/linu--others
pkg/�� om/davecgh/go-spew@v1.1.1/spew/bypass.go cfg
64/pkg/tool/linux_amd64/vet -plugin-opt=-pasbash g/grpc/internal/--norc
-plugin-opt=-pas--noprofile 64/pkg/tool/linux_amd64/vet` (dns block)
> - Triggering command: `/tmp/go-build2885812085/b514/launcher.test
/tmp/go-build2885812085/b514/launcher.test
-test.testlogfile=/tmp/go-build2885812085/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� -bool -buildtags iginal
-errorsas -ifaceassert -nilfunc iginal -ato��
/launcher/connection_pool.go /launcher/health_monitor.go x_amd64/vet
-errorsas -ifaceassert -nilfunc x_amd64/vet` (dns block)
> - `slow.example.com`
> - Triggering command: `/tmp/go-build347415617/b510/launcher.test
/tmp/go-build347415617/b510/launcher.test
-test.testlogfile=/tmp/go-build347415617/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true 64/src/net -trimpath
de/node/bin/as -p io -lang=go1.25 o_main.o -I uf@v1.36.11/refl-errorsas
uf@v1.36.11/refl-ifaceassert x_amd64/vet --gdwarf-5 --64 -o x_amd64/vet`
(dns block)
> - Triggering command: `/tmp/go-build2356109318/b510/launcher.test
/tmp/go-build2356109318/b510/launcher.test
-test.testlogfile=/tmp/go-build2356109318/b510/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true eFSy5PFyu cfg
64/pkg/tool/linux_amd64/vet --gdwarf-5 --64 -o 64/pkg/tool/linu--others
pkg/�� om/davecgh/go-spew@v1.1.1/spew/bypass.go cfg
64/pkg/tool/linux_amd64/vet -plugin-opt=-pasbash g/grpc/internal/--norc
-plugin-opt=-pas--noprofile 64/pkg/tool/linux_amd64/vet` (dns block)
> - Triggering command: `/tmp/go-build2885812085/b514/launcher.test
/tmp/go-build2885812085/b514/launcher.test
-test.testlogfile=/tmp/go-build2885812085/b514/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� -bool -buildtags iginal
-errorsas -ifaceassert -nilfunc iginal -ato��
/launcher/connection_pool.go /launcher/health_monitor.go x_amd64/vet
-errorsas -ifaceassert -nilfunc x_amd64/vet` (dns block)
> - `this-host-does-not-exist-12345.com`
> - Triggering command: `/tmp/go-build347415617/b519/mcp.test
/tmp/go-build347415617/b519/mcp.test
-test.testlogfile=/tmp/go-build347415617/b519/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true
1.80.0/internal/channelz/channel.go
1.80.0/internal/channelz/channelmap.go x_amd64/vet 305_amd64.s --64 -o
x_amd64/vet 0880�� m/grpc-gateway/v2@v2.28.0/runtim-errorsas
m/grpc-gateway/v2@v2.28.0/runtim-ifaceassert x_amd64/vet --gdwarf-5 --64
-o x_amd64/vet` (dns block)
> - Triggering command: `/tmp/go-build2356109318/b519/mcp.test
/tmp/go-build2356109318/b519/mcp.test
-test.testlogfile=/tmp/go-build2356109318/b519/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -test.v=true olang.org/grpc@v-p
cfg 64/pkg/tool/linu-lang=go1.25 0880581/b288/ --64` (dns block)
> - Triggering command: `/tmp/go-build2885812085/b523/mcp.test
/tmp/go-build2885812085/b523/mcp.test
-test.testlogfile=/tmp/go-build2885812085/b523/testlog.txt
-test.paniconexit0 -test.timeout=10m0s -ato�� -bool -buildtags
x_amd64/vet -errorsas -ifaceassert -nilfunc x_amd64/vet /usr�� --version
-tests x_amd64/vet balancer/weight/grep` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/github/gh-aw-mcpg/settings/copilot/coding_agent)
(admins only)
>
> </details>File tree
6 files changed
+24
-13
lines changed- internal
- mcp
- server
6 files changed
+24
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
76 | 81 | | |
77 | 82 | | |
78 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
875 | 876 | | |
876 | 877 | | |
877 | 878 | | |
| 879 | + | |
| 880 | + | |
878 | 881 | | |
879 | 882 | | |
880 | 883 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | 54 | | |
52 | 55 | | |
| |||
0 commit comments