Repository navigation
Upgrade MCP go-sdk to v1.8.0: serve protocol 2026-07-28 and its server/discover instructions - #2181
Conversation
PR Summary by QodoUpgrade MCP SDK to serve protocol 2026-07-28
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
Code Review by Qodo
1.
|
87756f8 to
9d97c77
Compare
go-sdk v1.7+ implements MCP protocol 2026-07-28, where server/discover replaces initialize. Radar's HTTP mounts are already stateless, so the SDK now serves 2026-07-28 and builds the server/discover result from ServerOptions.Instructions: the same instructions reach clients on either protocol. - Mark the private investigation scope connected on server/discover as well as initialize and tools/list. - Set cacheScope "private" on every cacheable result. The SDK now adds ttlMs/cacheScope to discover, list and resources/read results and defaults the scope to "public"; Radar answers with one caller's view of one cluster. - Raise the HTTP request body cap from the SDK's new 4 MiB default to 16 MiB, the SDK's stdio frame cap, so multi-document apply_resource calls that worked before still fit. - Tests speak raw JSON-RPC on every supported protocol version over HTTP and stdio framing, pin the SDK client's version where it matters (argument repair, the investigation mount), and check the read-only mount, cache scope and body cap on both protocols. - docs/mcp.md: supported protocol versions; instructions arrive on initialize or server/discover; diagnose's explicit false hints.
9d97c77 to
79c2e66
Compare
Replace five independently green Dependabot PRs with one reviewed, tested dependency update. No application source, public interfaces, workflow files, tags, or published artifacts change. Screening: **2026-10-18 09:27:22 UTC**. Exact 72-hour cutoff: **2026-10-15 09:27:22 UTC**. Ages below use that fixed screening instant, not PR creation time. Every changed resolved package is older than the cutoff. Base: `e47b1ee491cf8418e04ffc7d60a43e44171d39ee` (`origin/main`), fetched and reconciled again before QA; all ten original bot heads were unchanged. ## Included | PR | Dependency | Old → new | Upstream publication (UTC) | Age | Risk / verification | |---|---|---|---|---|---| | #2122 | [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/releases/tag/plugin-react%406.1.2) | 6.1.1 → 6.1.2 | 2026-10-05T10:08:27.143Z | 311.32 h | Default react() integration; optional compiler path unused. HMR fixes; build/type checks and browser journeys. | | #2119 | [prettier](https://github.com/prettier/prettier/releases/tag/3.9.10) | 3.9.9 → 3.9.10 | 2026-10-10T08:35:28.472Z | 192.86 h | Bundled Markdown parser performance fix; Prettier also powers Monaco YAML formatting. TS/TSX and standalone YAML before/after output parity verified. | | #2118 | [github.com/prometheus/common](https://github.com/prometheus/common/releases/tag/v0.72.1) | v0.72.0 → v0.72.1 | 2026-10-11T08:43:15Z | 168.74 h | Header clone correction is in config/, outside Radar runtime usage. Radar tests and upstream model/expfmt/config tests passed. | | #2116 | [golang.org/x/text](golang/text@v0.42.0...v0.43.0) | v0.42.0 → v0.43.0 | 2026-10-09T15:18:32Z | 210.15 h | Bidi complexity fix and lazy ASCII initialization; currency/bidi tests and Radar suites. | | #2115 | [golang.org/x/sys](golang/sys@v0.48.0...v0.49.0) | v0.48.0 → v0.49.0 | 2026-10-06T18:35:47Z | 278.86 h | Platform/syscall updates; all five release-platform builds plus native tests. | ## Resolved graph audit Only two npm packages change (`@vitejs/plugin-react`, `prettier`); no npm transitive changes, additions, or removals. The plugin's optional `oxc-transform-react` peer minimum rises to `^0.152.0`; Radar uses `react()` without the compiler option and does not install that peer. React, React DOM, React Flow, PostCSS, Vite, and Tailwind remain locked at the baseline. Prometheus common requires `x/net v0.61.0`, which raises crypto/sys/term/text. Text also raises sync/tools. These are native Go minimal-version-selection requirements, not a broad refresh. All eight Go module movements are accounted for: common/sys/text above, and the five additional entries below. No modules are added or removed; `pkg/go.mod` and `pkg/go.sum` remain unchanged. The root module resolves its shared-library imports under the new graph; the independently distributed shared module keeps its existing minimums. | Additional resolved movement | Publication (UTC) | Age | Review conclusion | |---|---|---|---| | [golang.org/x/net v0.60.0 → v0.61.0](golang/net@v0.60.0...v0.61.0) | 2026-10-09T17:07:24Z | 208.33 h | QUIC frame validation plus dependency updates; Radar uses HTTP2, proxy and IDNA, not QUIC. | | [golang.org/x/crypto v0.57.0 → v0.58.0](golang/crypto@v0.57.0...v0.58.0) | 2026-10-09T16:24:17Z | 209.05 h | SSH/ACME and LoongArch SIMD changes; Radar does not import SSH/ACME; release platforms are amd64/arm64. Existing crypto-dependent auth/storage tests cover used paths. | | [golang.org/x/term v0.46.0 → v0.47.0](golang/term@v0.46.0...v0.47.0) | 2026-10-09T15:22:17Z | 210.08 h | Dependency-only update; no term source changes. | | [golang.org/x/sync v0.23.0 → v0.24.0](golang/sync@v0.23.0...v0.24.0) | 2026-09-23T16:28:17Z | 592.98 h | Only errgroup test examples changed; singleflight/errgroup implementation is identical. | | [golang.org/x/tools v0.50.0 → v0.51.0](golang/tools@v0.50.0...v0.51.0) | 2026-10-02T18:49:45Z | 374.63 h | Tooling changes, not in Radar runtime dependency closure; pulled by text module requirements. | Release notes and complete upstream compare ranges were inspected for every included direct update. Go subrepositories without release notes were reviewed via their complete commit/file ranges. Exact npm times come from registry version/time metadata; Go times come from `proxy.golang.org/<module>/@v/<version>.info`. No deprecation/retraction or relevant target-version issue was found for the included set. The npm lockfile and `go list -m -json all` were compared against the base, not just the PR titles. ## Left open - **#2121 — PostCSS 8.5.29:** [upstream #2168](postcss/postcss#2168) documents a source-map regression introduced in this target (`generated.column: -1` when HTML escaping triggers). The issue is closed, but the target artifact still contains the described implementation. Hold for a fixed release / specific regression verification; this batch preserves 8.5.28. [Release/compare](postcss/postcss@8.5.28...8.5.29). - **#2120 — React Flow 12.12.0:** reviewed every 12.11.3–12.12.0 changelog entry and companion system 0.0.79–0.0.83. Radar uses it across topology, GitOps trees, and traffic. The local GitOps demo context points to an unavailable API server (`127.0.0.1:53287`, connection refused), so meaningful graph interaction/rendering verification was unavailable. Hold rather than approve with type checks alone. Reports [#6044](xyflow/xyflow#6044) and [#6063](xyflow/xyflow#6063) predate this bump and are not claimed as new regressions; the portal-window case in [#6053](xyflow/xyflow#6053) is not Radar's current usage. [Full range](https://github.com/xyflow/xyflow/compare/@xyflow/[email protected]...@xyflow/[email protected]). - **#2117 — godbus 5.2.3:** targeted package compilation failed on darwin/arm64: [`conn_darwin.go:29`](https://github.com/godbus/dbus/blob/v5.2.3/conn_darwin.go#L29) returns one value from a `(string, error)` function. Radar imports godbus only for Linux desktop theme detection, so this is an upstream release defect, not a claimed macOS Radar build break. Excluded under the safe-batch gate; keeps 5.2.2. [Full range](godbus/dbus@v5.2.2...v5.2.3). - **#1939 — Helmfile action 2.4.8:** original [Helm chart check](https://github.com/skyhook-io/radar/actions/runs/38315972386/job/115032561328) installs Helm 4.2.3 despite the Helm 3 pin, then fails because two plugins claim `unittest`. The complete 2.2.0–2.4.8 release history includes changed Helm plugin installation and a Node 24 runtime. This needs a separate workflow compatibility fix; no CI/release configuration is changed here. [Full range](helmfile/helmfile-action@v2.2.0...v2.4.8). **Already landed:** #1776 targets MCP SDK 1.8.0, already adopted with source compatibility work in [#2181](#2181), commit `05d99d5a7`. It was closed as stale, not included again. ## Verification - `make tsc` and `npm run tsc --workspace packages/k8s-ui`: passed. - `npm run test --workspaces --if-present`: web 268 files / 2,723 tests passed; k8s-ui 296 files / 5,001 tests passed, one existing skip. - `make build`: passed (frontend → embed → binary). - `make test`: passed with `GOMAXPROCS=4 GOFLAGS=-p=1`. PostgreSQL-backed tests enabled against an isolated local PostgreSQL 16 container; CI uses PostgreSQL 17. Initial concurrent run hit the five-second `TestGetShellEnv/bash` and `TestCursorForceGrantEndToEnd` subprocess deadlines; both passed serial reruns (1.382s and 0.613s), then the full suite passed. Existing environment/platform skips remain, including optional PromQL/VictoriaMetrics fixtures; PostgreSQL tests were enabled. - Upstream Prometheus `config`, `expfmt`, `model`, and `x/text` currency/bidirule/bidi tests: passed. `config` used a temporary modfile for its upstream test-only dependencies; Radar manifests were not expanded. - Full `cmd/explorer` builds passed for all five release targets: darwin/arm64, darwin/amd64, linux/amd64, linux/arm64, and windows/amd64 (`CGO_ENABLED=0`). Linux/amd64 `internal/version` test compilation and Windows/amd64 `internal/ai` and `internal/server` builds also passed. - Default React Refresh regression check: four cases passed (compound member and module export addition/removal). - Prettier 3.9.9 vs 3.9.10: identical output across all 1,576 tracked TS/TSX source files; no source rewrites. - Standalone Prettier runtime with YAML/estree plugins: five Kubernetes YAML cases produced identical output at Radar’s print width; both plugin artifacts are byte-identical. - Settings Chromium browser journeys: 140 passed. - `go mod verify`: passed. No retractions reported for the eight exact Go targets. `npm ci --ignore-scripts`: passed; `npm ls --all --package-lock-only` flags only the pre-existing DOMPurify 3.4.17 override against Monaco's 3.4.15 requirement, reproduced with the untouched base lockfile/manifests. No new integrity problem. Existing Dependabot alert #90 is for unchanged `postcss-selector-parser 6.0.10`; neither the included updates nor the held PostCSS-core bump resolves it. - `git diff --check`: passed; final graph is eight Go modules plus two npm packages, and only four dependency files changed. - Frontend checks ran with a checksum-verified official Node 24.22.0 runtime. The host's Node 22/24 aliases point to Node 25.9.0, outside the existing Vitest engine range. - Cross-model review: no blocking code findings; completed additional standalone YAML validation and expanded platform compilation after skeptical triage. visual-test: **skipped** — the rendered dependency update was held because the local demo cluster is unavailable. The included set changes backend dependencies, dev tooling, and the YAML formatter; standalone YAML output parity was tested and the YAML/estree parser artifacts are byte-identical. No live-cluster smoke test is claimed. Supersedes #2122, #2119, #2118, #2116, #2115. All five originals were closed after the replacement passed CI and automated review. The four held updates remain open. This PR remains unmerged and awaits human approval. Final checks on `5db4266cd49b6b3656c7dae6e9ec3f6f540485a7`: [CI](https://github.com/skyhook-io/radar/actions/runs/39116969852) passed Backend, Backend (internal/server), Frontend, Settings browser journeys, and k8s-ui. Path filters correctly skipped the unchanged independent pkg/Helm jobs and the redundant hygiene job. [CodeQL analysis](https://github.com/skyhook-io/radar/actions/runs/39116969847) passed. Qodo completed with zero bugs, rule violations, or requirement gaps; no inline review findings.
Summary
Upgrades
github.com/modelcontextprotocol/go-sdkfrom v1.6.1 to v1.8.0 so Radar serves MCP protocol2026-07-28, and with it the server instructions added in #2169.2026-07-28removesinitialize; a client learns the server's capabilities and instructions fromserver/discover. On v1.6.1 Radar answers every2026-07-28request with HTTP 400, so a client that only speaks that version gets neither tools nor instructions, and clients that fall back (Claude Code does today) pay a failed round trip first. Radar's HTTP mounts are already stateless, which is what the SDK needs to accept2026-07-28over HTTP, and the SDK builds theserver/discoverresult fromServerOptions.Instructions. So the same instructions now arrive on either protocol without Radar-side plumbing.Changes
/mcp-investigationmount marks a run "connected" onserver/discoveras well asinitializeandtools/list.ttlMsandcacheScopetoserver/discover, list andresources/readresults, on every protocol version, and defaults the scope to"public"(any intermediary may cache and serve it). Radar answers with one caller's RBAC-filtered view of one cluster, so it now sets"private"on all of them.ttlMsstays 0.apply_resourcecalls that work today (each object under the API server's limit, the bundle over 4 MiB). Radar sets the cap to 16 MiB, the SDK's cap on one stdio frame, so both transports accept the same calls.docs/mcp.mdlists the accepted protocol versions, says instructions arrive in theinitializeorserver/discoverresult, and statesdiagnose's explicitreadOnlyHint: false/destructiveHint: false.Wire changes clients can see
All come from the SDK; Radar keeps its defaults except cache scope and the body cap.
2026-07-28server/discoverreturns supported versions, capabilities, instructionsinitialize(2024-11-05 to 2025-11-25)Mcp-Session-Idresponse headerDELETE /mcp→ 405tools/list/mcp), 25 (/mcp-readonly)readOnlyHintandidempotentHint, includingfalse(same meaning as absent)resources/readresults"ttlMs":0,"cacheScope":"private"-32002-32602(same message)pingat2026-07-28-32601(removed from that protocol; legacypingunchanged)Testing
initializeat 2024-11-05, 2025-03-26, 2025-06-18 and 2025-11-25, andserver/discoverat 2026-07-28, on/mcp,/mcp-readonly(same instructions as before) and/mcp-investigation(none), over HTTP and over stdio framing.server/discover, so existing tests moved to2026-07-28silently. Tests that need both protocols pin the client version and assert the negotiated one: argument repair over HTTP, the investigation mount's evidence references, and the read-only mount refusing write tools.go test ./internal/mcp/ ./internal/ai/ ./internal/investigationrefs/and the MCP tests in./internal/server/pass.tools/listdiff;apply_resourcedry run;server/discoverat 2026-07-28; before this change it got a 400 and fell back toinitialize);initializeat 2025-06-18; unchanged).