feat(agent/x/agentmcp): migrate workspace agent MCP client to official Go SDK - #28059
Draft
ibetitsmike wants to merge 1 commit into
Draft
feat(agent/x/agentmcp): migrate workspace agent MCP client to official Go SDK#28059ibetitsmike wants to merge 1 commit into
ibetitsmike wants to merge 1 commit into
Conversation
…l Go SDK Replace the mark3labs client with the official SDK client for .mcp.json-configured servers. Stdio servers run via CommandTransport with the same execer-built command and enriched environment; the subprocess still outlives the connect handshake because the command context is the manager's, not the bounded connect context. HTTP and SSE headers move to an http.RoundTripper on the transport's client. Config parsing, transport inference, tool-name prefixing, catalog snapshots, and the agent call-tool API keep their external shapes. The SDK re-encodes binary content as base64 for the agent API and, unlike mark3labs, closes stdio connections on non-protocol stdout output, which is what the spec requires of servers.
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 4 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 workspace agent MCP manager now stores
*mcp.ClientSessionper configured server.mcp.CommandTransportwith anexec.Cmdbuilt from Coder'sagentexec.Execer, preserving environment enrichment; the command uses the manager's parent context so a stdio subprocess outlives the connect handshake and stops when the session closes.-test.vmade the fake server chatty).