feat(coderd/x/chatd/mcpclient): migrate external MCP client to official Go SDK - #28058
Draft
ibetitsmike wants to merge 1 commit into
Draft
feat(coderd/x/chatd/mcpclient): migrate external MCP client to official Go SDK#28058ibetitsmike wants to merge 1 commit into
ibetitsmike wants to merge 1 commit into
Conversation
…al Go SDK Replace the mark3labs client with the official SDK client for chatd's external MCP server connections. All four auth modes (oauth2, api_key, custom_headers, user_oidc) now inject headers through an http.RoundTripper on the transport's HTTPClient instead of per-header transport options; header keys still pass through http.Header.Set so case-insensitive collisions stay deterministic. The SDK negotiates the protocol version internally (2026-07-28 down to 2024-11-05), so older external servers keep working. Tool name prefixing, allow/deny filtering, model-intent wrapping, and content conversion are behavior-identical; the SDK decodes base64 image, audio, and blob payloads during unmarshal, so the manual decode paths are gone.
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 3 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.Stack: #28056 -> #28057 -> #28058 -> #28059 -> #28060 -> #28061
Why
The chatd external MCP client (admin-configured MCP servers used by Agent chat) now holds
*mcp.ClientSessionconnections created viamcp.NewClientandClient.Connect, withStreamableClientTransportorSSEClientTransportper server config.http.RoundTripperbecause the official SDK has no per-header transport options.map[string]anydecoding.