Short answer: the checkout builds, protocol choice changes deployment advice
Our November 13 run built go-sdk successfully in 58 seconds, then the test command exited 1 after 57 seconds. Use it if you want official Go MCP client and server APIs and can own their integration. Teams that need demonstrated interoperability and restart continuity before selecting a library should defer adoption. The v1.8.0 lifecycle example describes protocol 2026-07-28 without an initialize/initialized handshake, which changes how to read older session-recovery advice.
modelcontextprotocol/go-sdk is the official Go SDK for MCP clients and servers. The main import is github.com/modelcontextprotocol/go-sdk/mcp. The measured checkout was commit 0fa5e84; the documentation discussed here is v1.8.0. Those identifiers distinguish the source build from the documented release. They also give readers a precise project to evaluate: several unrelated libraries use the name go-sdk, including Docker and OpenRouter projects.
What people use go-sdk for
Reported uses include gh-aw inspection clients, a search-tool deployment and GitHub MCP Server's user-specific tool lists. The April 15 automated Go Fan audit describes server and client use across 24 non-test Go files. Contributor accounts add examples of stateless deployment and externally managed identity. Together, these show the SDK being used both to expose application functions and to inspect tools offered by other MCP servers.
| Who used it | What they did | Reported outcome |
|---|---|---|
| github/gh-aw, in the April 15 Go Fan automated audit | Exposed tools and inspected other MCP servers | The audit describes 24 non-test Go files, typed registration and stdio or HTTP connections. |
| GitHub user ln-12 | Forwarded search-tool calls to backend APIs | ln-12 reported successful deployment of a stateless fork, while preferring persistent storage longer term. |
| GitHub MCP Server contributors | Created a server per request to vary tools by user | Issue #666 describes licensing, client identity, staff status and feature flags. |
| GitHub user ohmpatel1997 | Built a showroom server for Claude Desktop | The author reported success after upgrading to v0.3.0. |
GitHub MCP Server's account gives a concrete reason for constructing different tool collections: a user's license, client identity, staff status and feature flags affected which tools appeared. The contributors described session information handled outside the SDK and a branch experiment for notifying clients after tool changes. Their architecture connects authorization to tool discovery, rather than treating every connected user as entitled to the same catalog.
What happened when we ran it
Our November 22 Compose attempt stopped because the required Compose file was absent. The failed safety step names compose.yaml, compose.yml, docker-compose.yaml and docker-compose.yml. The run summary dates the attempt November 22, and teardown reported ok. The summary describes deployment, but the recorded prerequisite failure determines the outcome: execution stopped before application work.
The safety step's phrase "unsafe repo" labels the missing Compose prerequisite. It is not a security finding about the SDK. The README starts with a Go executable communicating over standard input and output, rather than a Compose deployment. In our separate November 13 source run at commit 0fa5e84, installation and build succeeded before the test command failed. The recorded steps are below.
| Recorded step | Outcome | Duration |
|---|---|---|
| Dependency installation | Succeeded; 17 dependencies recorded | 18 seconds |
| Build | Succeeded | 58 seconds |
| Tests | Failed, exit 1; parser reports 13 passed and 1 failed of 14 | 57 seconds |
Our measurement setup recorded 3 CPUs, 8 GB RAM and image label golang:1.24-bookworm. The checkout scan recorded 236 files, approximately 70,459 source lines, 2.8 MB and eight CI workflow files. It found no Dockerfile and no tests directory. Go tests can live beside implementation files; the failing log contains test results, so the directory scan and execution results describe different aspects of the checkout.
The test tail names TestStreamableTransports and TestStreamableStateful_DiscoverDoesNotLeakSession as failures. It records github.com/modelcontextprotocol/go-sdk/mcp as FAIL after 36.239 seconds and oauthex as ok after 0.139 seconds, following successful internal-package results. The parser's 13 passed and 1 failed of 14 is therefore not an individual test-function count: the tail names two failing functions. The overall test command ended in FAIL.
Where people get stuck: legacy sessions and the 2026-07-28 change
Legacy session recovery can fail when a request reaches a process without the session's in-memory state, as issue #148 reports. The thread's April 28, 2026 update describes removing transport-level sessions and changing server-to-client communication. The v1.8.0 lifecycle example says protocol 2026-07-28 has no initialize/initialized handshake. The negotiated protocol determines which lifecycle an integration needs to handle.
In the full issue #148 discussion, participants distinguish storing session information from distributing messages between server instances. A handler awaiting an elicitation response on one process presents a different problem from retrieving identity or client capabilities on another. Maintainers connected closure to the protocol changes, and the issue closed on August 20, 2026. The thread explains why a shared identifier alone was insufficient for the older lifecycle.
| Problem in the thread | Reported approach | What you should take from it |
|---|---|---|
| Requests land on different processes | One host or sticky routing | This addresses routing to legacy in-memory sessions while the original process lives. |
| Tool calls contain everything needed | ln-12's stateless fork | The reported search wrapper carried its inputs in tool arguments. |
| Existing sessions need to survive restarts | Shared storage and session-hydration proposals | These proposals concern the older session lifecycle; 2026-07-28 changes the protocol model. |
Tool-list changes raised a related deployment question. Contributors in issue #666 described expiring sessions breaking some clients, including Claude Code, and tested a notification mechanism on a branch. On October 27, 2026, issue #666 closed with the comment "Obsolete under 2026-07-28". That closure belongs beside the proposal it changes, rather than beside every later reference to the contributors' architecture.
The documentation also lists a distributed-server example. Its multi-round-trip example explains how a tool can return requests for additional input and receive responses through a retried call. For 2026-07-28 and later, client middleware fulfils those requests; earlier versions use the legacy server-to-client API. This provides a specific protocol distinction for elicitation and other multi-step interactions.
Authentication needs request scope and durable tokens
Register shared middleware once and keep each invocation's identity scoped to that invocation. In issue #174, the reporter acknowledged repeatedly adding middleware in the HTTP handler; one tool call produced 12 middleware log entries. The maintainer explained that MCP middleware supports transports beyond HTTP. The thread's server-selection advice was to examine HTTP headers and select an appropriate server, including separate servers for different tool collections.
Issue #243 discusses request wrappers carrying information beyond protocol parameters, including authentication information and HTTP headers. The documented tool handler receives *mcp.CallToolRequest. These sources separate the HTTP request from transport-independent MCP handling. In issue #174, repeatedly registered closures captured request information, and the reporter observed token values being overwritten during the repeated middleware calls. That example explains the registration mistake without requiring a new header-access API example.
OAuth persistence advanced beyond the May prototype: issue #901 records PR #1058, commit beb3d1a and closure on July 13, 2026. The discussion separates constructing a token source after authorization from supplying restored credentials. Contributor smlx also reported successful real-client testing on the earlier branch. Application code still chooses how to store credentials and how to rebuild the token source used during a later connection.
Credential injection raises a separate HTTP concern. In issue #522, neild warns that adding Authorization inside a RoundTripper can send that header after a redirect. The discussion favored retaining *http.Client and adding request modification. Token persistence concerns the credential lifecycle; redirect behavior concerns where those credentials travel. Both affect authentication design, but they require different implementation decisions.
At volume, enumerate every page and preserve cancellation
Use the catalog iterators, preserve caller cancellation and shut HTTP servers down gracefully. The April 15 automated audit reports that gh-aw's inspector called session.ListTools() once without pagination and recommends session.Tools and session.Resources. A returned page can contain fewer entries than the server's complete catalog. This is an attributed finding about the consumer's enumeration code, with the iterators identified as the proposed remedy.
The same audit describes connection timeouts derived from a fresh background context, losing caller cancellation, and recommends graceful HTTP shutdown rather than dropping in-flight calls on termination. The package documentation's cancellation example shows cancellation reaching a tool handler. These sources identify three code paths to inspect together: the context used for connection work, the catalog enumeration API and the HTTP shutdown path.
For changing catalogs, issue #666 records a branch experiment that delivered a tool-list notification. Its per-request-server use case explains why deployment could change the tools a user should discover even without changing a long-lived server object. The protocol transition is discussed in the session section above; the operational question here is whether catalog enumeration and subsequent changes reach the client your application uses.
go-sdk vs mcp-go and the TypeScript MCP SDK
Choose the official SDK for its Go client and server APIs, retain an existing Go dependency when its API fits, and consider TypeScript when language choice is flexible. The official documentation acknowledges mcp-go, mcp-golang and go-mcp as viable alternatives. Contributors in issue #148 consulted TypeScript deployment examples while discussing equivalent Go architectures, giving that SDK a concrete place in the comparison.
| Candidate | Why it belongs on your shortlist | Basis for choosing |
|---|---|---|
| modelcontextprotocol/go-sdk | Official Go client and server APIs | Compare its documented protocol behavior and typed APIs with your integration requirements. |
| mark3labs/mcp-go | A Go alternative acknowledged by upstream | Existing integrations may depend on its API; contributors reported using SendNotificationToClient. |
| Official TypeScript MCP SDK | Deployment examples referenced by Go users | Issue #148 discusses its stateless and persistent approaches. Consider those designs when language choice is flexible. |
| metoro-io/mcp-golang | Another Go implementation named by upstream | The official documentation names it alongside other SDKs. Compare the API your application needs. |
For an existing service, tool registration, result handling, notifications and transport integration form a useful migration checklist. For a new Go project, the official README supplies a typed tool and a stdio client as the starting point. The upstream acknowledgements establish that the named Go alternatives remain candidates; the TypeScript references explain which deployment designs participants consulted when working through distributed-session questions.
What the other reviews get wrong
The April 6 Go Fan audit calls v1.4.1 spec-complete for MCP 2025-11-25, while the official compatibility table marks client OAuth experimental. The April 6 audit's description therefore needs the module documentation's OAuth qualification. Supporting a protocol version and describing every associated feature as stable are different claims. The compatibility table supplies the more specific wording for that version range.
The April 15 Go Fan audit says client OAuth became stable in v1.5.0, conflicting with the compatibility footnote. OAuth persistence has a separate implementation history in issue #901. The review should keep those subjects separate: maturity wording describes support status, the July issue closure records implementation history, and an application's storage design determines how it retains credentials across its own restarts.
Custom-method advice also needs updating. Issue #954 describes implementing registration in a vendored SDK, while the v1.8.0 module documentation lists server/custom-method. The custom-method example demonstrates registering and calling a custom JSON-RPC method outside the standard MCP specification. This correction concerns an older issue report, rather than either Go Fan review, and the current documented example is the relevant starting point for extension authors.
The import path identifies this project better than its name
github.com/modelcontextprotocol/go-sdk/mcp identifies the MCP library reviewed here. Docker's go-sdk describes Docker configuration and context data, while OpenRouter's go-sdk describes an OpenRouter client. Their similarly named repositories serve different purposes. The official MCP repository and import path give a first-time reader enough information to select the intended module without borrowing requirements or behavior from those other projects.
Toolchain compatibility belongs to the selected release. Muse Code's September 24 evaluation reports that a pinned workspace toolchain blocked adoption. The official README says new SDK releases target supported Go versions. The practical comparison is between the application's pinned toolchain and its chosen dependency's requirements. A policy statement, an individual workspace report and our recorded source build each answer a different part of that question.
FAQ
Import github.com/modelcontextprotocol/go-sdk/mcp for the primary MCP client and server APIs. The module overview identifies that package and separates it from transport and OAuth packages. Contributor discussions then address the decisions that follow an import: session lifecycle, authentication, tool output, custom methods and client behavior. The answers below retain the versions and reported outcomes that make those discussions useful.
Which package should I import to build MCP clients and servers with go-sdk?
Use github.com/modelcontextprotocol/go-sdk/mcp. The module overview identifies it as the primary client and server API, with jsonrpc for transport authors, auth for OAuth primitives and oauthex for protocol extensions. The README's server registers a typed greeting tool, and its client launches a server executable through CommandTransport. Both examples import the same mcp package.
How can I recover sessions across multiple MCP server instances and redeployments?
Protocol 2026-07-28 has no initialize/initialized handshake in the v1.8.0 lifecycle example. Issue #148 addresses initialized-session recovery under older protocols. Its April update describes removing transport sessions and changing server-to-client communication. Begin the architecture decision with the negotiated protocol, then distinguish application state from the transport lifecycle and the routing of responses between server instances.
Can I turn off session handling for a stateless Go MCP server?
GitHub MCP Server contributors ultimately described running with Stateless: true and handling session information externally in issue #666. Their final clarification corrected earlier contradictory comments about the option. In issue #148, ln-12 separately reported deploying a stateless fork for a search wrapper whose tool arguments carried the information needed for each call. These are two concrete application architectures.
How do I access HTTP headers and user authentication information on every tool invocation?
Issue #174's maintainer recommends examining HTTP headers in the server-selection function to choose an appropriate server. The thread explains why transport-independent middleware lacks an HTTP request parameter, and issue #243 discusses additional request information. The README's typed handler receives *mcp.CallToolRequest; the temporary modified handler shown in the older thread was the reporter's application code.
Why does one tool call execute the same middleware repeatedly?
In issue #174, middleware registration happened repeatedly inside the HTTP handler. The reporter acknowledged that cause after observing 12 middleware log entries. Registering middleware on the shared server once avoids accumulating that sequence of handlers. The example also captured HTTP request information in closures, explaining why the reported invocation encountered token values from repeatedly installed middleware.
How do I save and restore OAuth2 sessions so users do not need to authorize again after a restart?
Issue #901 records OAuth2 session persistence through PR #1058 and commit beb3d1a, with closure on July 13, 2026. Its design discussion separates a restored initial token source from creating a token source after authorization. The application supplies storage and token lifecycle handling. The earlier successful client test was reported by contributor smlx on an implementation branch.
Should a tool return data through CallToolResult or the typed output return value?
The README's greeting example returns nil for CallToolResult and a populated typed output value. The package documentation says generic AddTool generates schemas and validates inputs; output type any suppresses output-schema generation. Issue #396 records confusion about these result paths. The typed greeting provides a concrete reference for returning structured data through the second return value.
Is there a simpler AddTool handler signature that only takes input and returns output and an error?
The README demonstrates a handler taking context.Context, *mcp.CallToolRequest and input, with three return values. Issue #396 proposes simpler signatures and discusses alternative function names. The documented AddTool example supplies the signature used here. Its request and result parameters also explain why the discussion considered retaining the more general handler form.
Can I register custom JSON-RPC methods for experimental MCP extensions?
Yes: the v1.8.0 module documentation lists server/custom-method, an example for registering and calling a custom JSON-RPC method outside the standard MCP specification. The package index also lists custom-method functions. This answers the registration question raised in issue #954, where extension contributors described a vendored implementation. Extension authors have a documented example to consult alongside that implementation history.
Can Streamable HTTP return application/json instead of an event stream for Cursor?
Issue #211 discusses a JSONResponse setting after a user reported that Cursor displayed no tools. The report describes text/event-stream responses and requests an application/json option. Maintainers discussed TypeScript's enableJsonResponse as a model for Go. That exchange identifies the response-format problem behind the user's question and the proposed control, rather than supplying a current copyable configuration.
Why does Claude Desktop fail to detect my Go MCP tools?
The original reporter in issue #395 said upgrading to v0.3.0 resolved their case. Another participant described disappearing tools and method "tools/call" is invalid during session initialization through an HTTP connection using mcp-remote; restarting usually helped that participant. The upgrade outcome and the bridge report describe separate cases, with different transport details and symptoms.
How can I configure request timeouts when Claude cancels requests?
The maintainer in issue #395 identifies the reported timeout as a client-side setting. The SDK cancellation example separately demonstrates a handler observing cancellation through its context. One mechanism determines when the client abandons a request; the other lets server work respond after cancellation reaches it. The example's documented output includes context canceled and tool canceled.
What we have not tested yet
Our execution covers source installation, build and the failed test command at 0fa5e84, plus the blocked November 22 Compose attempt. We have not tested current Claude Desktop, Cursor or bridge compatibility, negotiation of 2026-07-28, or restart continuity. The Compose attempt produced no application task results or screenshots. The README and package examples describe API patterns; this review does not claim that we executed those examples or tested the v1.8.0 release tag.
Actual Go and operating-system versions require raw toolchain logs rather than the sandbox image label. The failing test tail provides function names without assertion details or a cause. Shared storage, legacy session hydration, cross-user isolation, redirect handling and OAuth token restoration remain outside our execution. Issue #901 records implementation history, but the exact release introducing persistence and its runtime behavior are unresolved here. The introduction release for custom methods is also unresolved.
The historical audits supply no comparative throughput result, and the discussions supply no current interoperability matrix or complete shared-session deployment recipe. The exact current header-access recipe, release status of the simpler handler proposal and public configuration outcome for issue #211 are not demonstrated by these extracts. OAuth maturity wording also conflicts between the automated audit and official table. Discovery, an authenticated call, cancellation and a deployment transition form useful next acceptance tasks, recording client responses beside server logs; those are proposed tasks, not new results.


