Skip to content

Upgrade MCP go-sdk to v1.8.0: serve protocol 2026-07-28 and its server/discover instructions - #2181

Merged
nadaverell merged 1 commit into
mainfrom
deps/mcp-go-sdk-1.8
Oct 17, 2026
Merged

nadaverell merged 1 commit into
mainfrom
deps/mcp-go-sdk-1.8

Conversation

@nadaverell

Copy link
Copy Markdown
Contributor

Summary

Upgrades github.com/modelcontextprotocol/go-sdk from v1.6.1 to v1.8.0 so Radar serves MCP protocol 2026-07-28, and with it the server instructions added in #2169.

2026-07-28 removes initialize; a client learns the server's capabilities and instructions from server/discover. On v1.6.1 Radar answers every 2026-07-28 request 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 accept 2026-07-28 over HTTP, and the SDK builds the server/discover result from ServerOptions.Instructions. So the same instructions now arrive on either protocol without Radar-side plumbing.

Changes

  • Dependency: go-sdk v1.8.0. No other module versions change.
  • Investigation mount: the private /mcp-investigation mount marks a run "connected" on server/discover as well as initialize and tools/list.
  • Cache scope: v1.7 adds ttlMs and cacheScope to server/discover, list and resources/read results, 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. ttlMs stays 0.
  • Request size: v1.8 caps an HTTP request body at 4 MiB by default, which would refuse multi-document apply_resource calls 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: docs/mcp.md lists the accepted protocol versions, says instructions arrive in the initialize or server/discover result, and states diagnose's explicit readOnlyHint: false / destructiveHint: false.

Wire changes clients can see

All come from the SDK; Radar keeps its defaults except cache scope and the body cap.

Surface Before After
Any request at 2026-07-28 HTTP 400 served; server/discover returns supported versions, capabilities, instructions
initialize (2024-11-05 to 2025-11-25) instructions same instructions, byte for byte
Mcp-Session-Id response header set not set (stateless servers no longer issue one); DELETE /mcp → 405
tools/list 32 tools (/mcp), 25 (/mcp-readonly) same tools, schemas and descriptions; annotations now always carry readOnlyHint and idempotentHint, including false (same meaning as absent)
List and resources/read results — "ttlMs":0,"cacheScope":"private"
Unknown resource URI -32002 -32602 (same message)
ping at 2026-07-28 — -32601 (removed from that protocol; legacy ping unchanged)
HTTP request body no cap 16 MiB; larger bodies get HTTP 413 before any tool runs

Testing

  • New tests speak raw JSON-RPC: initialize at 2024-11-05, 2025-03-26, 2025-06-18 and 2025-11-25, and server/discover at 2026-07-28, on /mcp, /mcp-readonly (same instructions as before) and /mcp-investigation (none), over HTTP and over stdio framing.
  • The SDK's own client now opens with server/discover, so existing tests moved to 2026-07-28 silently. 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.
  • Cache scope is checked on every cacheable result on both protocols, and a 6 MiB tool call goes through while a body over 16 MiB gets 413.
  • go test ./internal/mcp/ ./internal/ai/ ./internal/investigationrefs/ and the MCP tests in ./internal/server/ pass.
  • Live, against a test EKS cluster, the v1.6.1 and v1.8.0 builds side by side:
    • raw JSON-RPC on every protocol version over HTTP and stdio;
    • a tools/list diff;
    • real tool calls, including argument repair and a 4.6 MiB multi-document apply_resource dry run;
    • Claude Code 2.1.302 (opens with server/discover at 2026-07-28; before this change it got a 400 and fell back to initialize);
    • Codex 0.163 (initialize at 2025-06-18; unchanged).

@nadaverell
nadaverell requested a review from hisco as a code owner October 17, 2026 21:46
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Upgrade MCP SDK to serve protocol 2026-07-28

✨ Enhancement 🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Serve MCP 2026-07-28 clients through server/discover while preserving instructions for older
 clients.
• Keep caller-specific results private and accept multi-document tool calls up to 16 MiB over HTTP.
• Test protocol compatibility across transports and mounts, and document the client-visible
 behavior.
Diagram

sequenceDiagram
    participant C as MCP Client
    participant T as HTTP or stdio
    participant S as go-sdk v1.8
    participant R as Radar Server
    participant I as Investigation refs
    C->>T: initialize or server/discover
    T->>S: JSON-RPC request
    S->>R: handle request
    R->>I: mark discover connected
    R-->>S: instructions and private scope
    S-->>T: protocol response
    T-->>C: capabilities and instructions
Loading
High-Level Assessment

Use the SDK's native 2026-07-28 support, with Radar-specific cache and body-limit configuration. A custom protocol adapter would duplicate SDK behavior, while relying on client fallback would leave 2026-07-28-only clients unable to connect.

Files changed (7) +525 / -22

Enhancement (1) +28 / -4
server.goKeep cache results private and preserve large HTTP calls +28/-4

Keep cache results private and preserve large HTTP calls

• Configures cacheable results with private scope and raises the HTTP request-body cap to the SDK's 16 MiB stdio-frame limit. Marks scoped investigations connected when a client uses server/discover.

internal/mcp/server.go

Tests (2) +478 / -1
protocol_versions_test.goTest MCP compatibility across versions and transports +465/-0

Test MCP compatibility across versions and transports

• Adds raw JSON-RPC tests for legacy initialization and 2026-07-28 discovery over HTTP and stdio. Also checks instructions, argument repair, private cache scope, read-only tool restrictions, and the HTTP body limit.

internal/mcp/protocol_versions_test.go

server_investigation_test.goVerify investigation behavior on both handshake protocols +13/-1

Verify investigation behavior on both handshake protocols

• Runs evidence-reference checks with pinned legacy and 2026-07-28 clients and asserts the negotiated version. Adds server/discover to the middleware connection tests.

internal/mcp/server_investigation_test.go

Documentation (2) +16 / -14
mcp.mdDocument protocol support and instruction delivery +3/-3

Document protocol support and instruction delivery

• Describes stateless HTTP support through 2026-07-28 and explains that the new protocol delivers instructions through server/discover. Clarifies diagnose's explicit false safety hints.

docs/mcp.md

instructions.goClarify when server instructions are delivered +13/-11

Clarify when server instructions are delivered

• Updates comments to cover delivery through either initialize or server/discover. The instruction text itself is unchanged.

internal/mcp/instructions.go

Other (2) +3 / -3
go.modUpgrade MCP go-sdk to v1.8.0 +1/-1

Upgrade MCP go-sdk to v1.8.0

• Raises the direct SDK dependency from v1.6.1 to v1.8.0, enabling support for protocol 2026-07-28.

go.mod

go.sumRefresh MCP SDK checksums +2/-2

Refresh MCP SDK checksums

• Replaces the v1.6.1 module checksums with those for v1.8.0.

go.sum

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Hosted MCP rejects large manifests ⊘ Outdated
Description
handlerForServer raises Radar's HTTP body limit to 16 MiB, but radar-hub's
mcpClientDetectMiddleware still returns HTTP 413 for MCP POST bodies over 1 MiB. A
PAT-authenticated apply_resource call with a multi-document manifest can therefore pass the new
Radar limit but fail before reaching it through either hosted MCP route.
Code

internal/mcp/server.go[172]

+		MaxRequestBodyBytes: maxRequestBodyBytes,
Evidence
The PR raises Radar's limit, while Hub mounts a middleware on both hosted MCP routes that rejects
PAT requests exceeding 1 MiB before forwarding them.

radar -> radar-hub
internal/mcp/server.go[162-173]
External repo: skyhook-dev/radar-hub, internal/server/mcp_client_detect.go [41-85]
External repo: skyhook-dev/radar-hub, internal/server/server.go [1246-1258]
External repo: skyhook-dev/radar-hub, internal/server/server.go [1180-1208]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Radar now accepts MCP requests up to 16 MiB, but radar-hub rejects PAT-authenticated requests above 1 MiB before forwarding them.
## Fix Focus Areas
- internal/mcp/server.go[162-173]
- /cross_repos/radar-hub/internal/server/mcp_client_detect.go[60-85]
- /cross_repos/radar-hub/internal/server/mcp_cluster_intercept.go[189-211]
## Recommended Fix
Update radar-hub's MCP body-peeking limits to accommodate the intended request size without losing its body inspection and restoration. Check the per-cluster read-only interception limit separately, and test a large request through the hosted route.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can see how risky a PR is at a glance with blast radius labels

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread internal/mcp/server.go Resolved
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.
@nadaverell
nadaverell merged commit 05d99d5 into main Oct 17, 2026
9 checks passed
nadaverell added a commit that referenced this pull request Oct 18, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant