feat: migrate coderd MCP server to official MCP Go SDK - #28056
Draft
ibetitsmike wants to merge 1 commit into
Draft
feat: migrate coderd MCP server to official MCP Go SDK#28056ibetitsmike wants to merge 1 commit into
ibetitsmike wants to merge 1 commit into
Conversation
Replace mark3labs/mcp-go with modelcontextprotocol/go-sdk v1.7.0 for the /api/experimental/mcp/http endpoint. The server now speaks MCP 2026-07-28 (stateless lifecycle, server/discover, -32022 rejection) while still negotiating down to 2024-11-05 for legacy clients. The endpoint was already effectively stateless (a fresh server per request, format-only session validation), so the SDK's stateless mode changes only spec-permitted surface behavior: no Mcp-Session-Id header and 405 for GET/DELETE. Tool schemas, annotations, and text result content are wire-identical (golden-diffed against the old server). mark3labs remains in go.mod for the not-yet-migrated surfaces and as the legacy test client.
This was referenced Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack Context
PR 1 of 6 in a stack that migrates every Coder MCP surface from the archived
github.com/mark3labs/mcp-golibrary to the officialgithub.com/modelcontextprotocol/go-sdkv1.7.0, adding MCP 2026-07-28 support while keeping compatibility with clients speaking 2024-11-05 through 2025-06-18.Stack: #28056 -> #28057 -> #28058 -> #28059 -> #28060 -> #28061
Why
The coderd Streamable HTTP MCP server (
/api/experimental/mcp/http) is the foundation layer: it introduces the official SDK dependency and the sharedRegisterSDKToolhelper the CLI server reuses.JSONResponse: true, preserving the previousapplication/jsonPOST wire format. GET and DELETE return 405, and noMcp-Session-Idis issued, both permitted by the Streamable HTTP spec.DisableLocalhostProtectionis set because coderd commonly listens on loopback behind a reverse proxy with a public Host header; the endpoint's bearer authentication is the relevant access control.required, keepingtools/listoutput byte-identical to the previous server (verified with a golden comparison).cdr.dev/slog/v3; only warnings and errors are forwarded because the SDK logs several INFO lines per stateless request.-32022), and non-POST method behavior.