Skip to content

Align vMCP with the final MCP 2026-07-28 spec - #7032

Merged
jhrozek merged 5 commits into
mainfrom
vmcp-modern-spec-cleanup
Nov 4, 2026
Merged

jhrozek merged 5 commits into
mainfrom
vmcp-modern-spec-cleanup

Conversation

@jhrozek

@jhrozek jhrozek commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The 2026-07-28 MCP revision is final, but vMCP still returned HTTP 200 for several errors and its comments and documentation described the revision or go-sdk behavior as outdated. This PR aligns the Modern error statuses with the final spec and refreshes the related compatibility notes.

  • Return HTTP 404 for -32601 and HTTP 400 for -32602, -32020, -32021, and -32022.
  • Add a go-sdk v1.8.0 integration assertion that the client can continue using the same session after receiving a JSON-RPC error over HTTP 400.
  • Update stale spec-version and SDK compatibility references in source comments and architecture documentation.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test attempted; did not pass: TestNewClientWithSocketPathPodman and TestCheckHealth_UnixSocket_Success failed with bind: invalid argument while binding Unix sockets under the current test temp path. A retry with TMPDIR=/tmp was canceled before tests completed.)
  • E2E tests (task test-e2e)
  • Linting (task lint-fix; passed with 0 issues)
  • Manual testing (describe below)

Changes

File group Change
pkg/vmcp/server/modern_dispatch.go, modern_envelope.go, and tests Apply spec-required HTTP status mappings and test same-session recovery with go-sdk v1.8.0.
pkg/mcp/, pkg/runner/, pkg/transport/proxy/streamable/, and pkg/vmcp/ Replace stale draft/version claims and update compatibility rationale and related tests.
docs/arch/03-transport-architecture.md, docs/arch/10-virtual-mcp-architecture.md, docs/arch/16-vmcp-mrtr.md, docs/remote-mcp-authentication.md Align architecture and protocol references with the finalized spec and current SDK behavior.
test/e2e/ Refresh stale spec and SDK references.

Does this introduce a user-facing change?

Yes. Before, the Modern server returned HTTP 200 for these protocol errors. Now -32601 returns 404 and -32602, -32020, -32021, and -32022 return 400, as required by the final MCP spec. Authorization denials remain HTTP 403; unrelated coded errors, including the vMCP-owned -32603 unsupported-MRTR response, remain HTTP 200.

Implementation plan

Approved implementation plan
  • Correct the HTTP mappings for the spec-defined error codes and verify client recovery with go-sdk v1.8.0.
  • Update stale draft labels, SDK-version claims, and rationale in the relevant code comments and documentation.
  • Leave the existing Modern dispatch architecture and client replacement out of scope.

Special notes for reviewers

The status change is intentionally limited to the specified error codes; it does not alter authorization-denial or unrelated application-error handling. The review also noted a few non-blocking comment wording clarifications around the pagination SHOULD language and the current scope of Modern push-stream handling.

@github-actions github-actions Bot added the size/XL Extra large PR: 1000+ lines changed label Nov 3, 2026
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.57%. Comparing base (190dde8) to head (d4cd7b6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7032      +/-   ##
==========================================
+ Coverage   80.53%   80.57%   +0.03%     
==========================================
  Files         856      856              
  Lines       87374    87378       +4     
==========================================
+ Hits        70366    70402      +36     
+ Misses      17003    16971      -32     
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

reyortiz3
reyortiz3 previously approved these changes Nov 3, 2026
tgrunnagle
tgrunnagle previously approved these changes Nov 3, 2026
jhrozek and others added 5 commits November 3, 2026 21:47
Comments and docs cited the go-sdk and toolhive-core versions next to
every SDK behaviour they described. Those pins go stale on the next
bump, and the real version already lives in go.mod. Name the behaviour
and the SDK type instead.

Where a version marked a threshold, the wording now says "current"
or "earlier" rather than naming the release.

Co-authored-by: Mecatl <[email protected]>
@jhrozek
jhrozek dismissed stale reviews from tgrunnagle and reyortiz3 via d4cd7b6 November 3, 2026 20:59
@jhrozek
jhrozek force-pushed the vmcp-modern-spec-cleanup branch from fa20080 to d4cd7b6 Compare November 3, 2026 20:59
@jhrozek

jhrozek commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@reyortiz3 rebased this onto current main, the conflicts were in the Modern dispatch/envelope code and the vMCP arch docs. Also took your go-sdk version question: dropped the version pins from the comments and docs in this PR (separate commit d4cd7b6), since the real version lives in go.mod. I also grepped the rest of the repo, there are about 40 more pins on main in files this PR doesn't touch, so I left those for a follow-up.

@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Nov 3, 2026

@rdimitrov rdimitrov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The only runtime change is the status switch in writeModernCodedError. In today's code, the only coded error that reaches it after dispatch is the rate limiter's, which keeps HTTP 200. Classification errors and -32021 were already 400. Legacy clients are unaffected, and the new go-sdk test covers session recovery after a 400. Everything else is comments and docs.

@jhrozek
jhrozek merged commit d817350 into main Nov 4, 2026
47 checks passed
@jhrozek
jhrozek deleted the vmcp-modern-spec-cleanup branch November 4, 2026 13:23
@github-actions github-actions Bot mentioned this pull request Nov 4, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large PR: 600-999 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants