[go-fan] Go Module Review: modelcontextprotocol/go-sdk
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 68/100
Línea de trabajo
Empieza en pkg/cli/mcp_inspect_mcp.go e inspecciona cómo se configuran CommandTransport y StreamableClientTransport. Establece límites de entrada mediante las opciones MaxLineLength y MaxEventSize del SDK y luego revisa las pruebas de transporte pertinentes o ejecuta las pruebas del inspector. Se considera terminado cuando ambos caminos tienen límites para que una entrada del servidor demasiado grande no pueda hacer crecer sin límite la memoria del inspector.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐹 Go Fan Report: modelcontextprotocol/go-sdk
Module overview: go-sdk is the official Go SDK for the Model Context Protocol — server primitives (mcp.NewServer, mcp.AddTool), client primitives (mcp.NewClient), and transports (stdio, command, in-memory, streamable HTTP). It is the backbone of gh-aws gh aw mcp server and the mcp inspect subcommand.
Selection: picked via round-robin with priority for recent activity — pushed_at 2026-10-29 was the most recent among eligible direct dependencies, and this module last reviewed 2026-10-22 (8 days ago, outside the 7-day cooldown).
Current usage in gh-aw
- Files: 17 non-test
.gofiles (plus matching_test.gofiles), all underpkg/cli/andpkg/parser/mcp.go - Subpackages imported:
mcp,jsonrpconly — noauth/oauthex(the server has no OAuth surface) - Key APIs used:
mcp.NewServer/mcp.NewClient,mcp.AddTool,ServerOptions.SupportedProtocolVersions,ServerOptions.SetCacheable,mcp.StdioTransport,mcp.NewStreamableHTTPHandler,mcp.CommandTransport,mcp.StreamableClientTransport,AddReceivingMiddleware,mcp.ToolAnnotations
go.mod is pinned to v1.8.0, the current latest release (was v1.7.0 at the last review on 2026-08-18).
Research findings
Recent updates (v1.8.0, 2026-09-14)
No new protocol revision — it is a hardening/fix release on top of v1.7.0:
- JSON decoding now rejects >1000 levels of nesting before parsing
- New
MaxEventSizeonSSEClientTransport/StreamableClientTransport, andMaxLineLengthonStdioTransport, to bound buffered input - OAuth dynamic-client-registration responses capped at 1 MB
ServerOptions.SupportedProtocolVersions— lets a server narrow (never widen) its advertised protocol setServerOptions.SetCacheable— per-request hook forttlMs/cacheScopeon list and discover results- Session-leak, deadlock, and teardown-hang fixes for
ServerSession/Client.Connect - Two new
MCPGODEBUGescape hatches (plaintextstatefulrejection,blockingcancelnotify), both slated for removal in v1.9.0 — not needed by gh-aw
Best practices (from maintainers / release notes)
- Bare
boolforReadOnlyHint/IdempotentHintis now always serialized by default (the oldomitemptybehavior needs an explicithintomitempty=1opt-out) — gh-aw already does this correctly everywhere annotations are set. - Stay stateful if session affinity across calls is required;
Stateless = trueopts into the2026-07-28revision but drops that affinity.
Best practices already observed in gh-aw (click to expand)
mcp_server.godocuments that schema caching is automatic since go-sdk v1.3.0.mcp_server_http.gohas an explicit comment on whyStatelessis leftfalse: the long-runninglogs/audittools rely on session affinity for progress notifications, and staying stateful still lets the SDK negotiate down to2025-11-25.mcp_server_http.gobinds to loopback only as defense in depth alongside the SDKs own Host-header check, noting the SDK dropped default cross-origin protection in v1.6.0.mcp_inspect_mcp.gosetsDisableStandaloneSSE: trueon the inspectorsStreamableClientTransportsince it only queries capabilities once.- gh-aw already adopts v1.8.0s
SetCacheable(60s private TTL onListToolsRequest/discover responses) and v1.7.0sSupportedProtocolVersions— ahead of the curve rather than lagging.
Improvement opportunities
🏃 Quick wins
- Bound the
mcp inspectclient transports against hostile/misbehaving servers.mcp inspect(pkg/cli/mcp_inspect_mcp.go) connects to arbitrary user-configured MCP servers over bothCommandTransport(stdio) andStreamableClientTransport(HTTP) — exactly the scenario v1.8.0s newMaxLineLength/MaxEventSizecaps were built for. Neither is set today, so an inspected server that emits one giant unterminated line or a huge SSE event can grow the inspector processs memory unbounded. Setting conservative caps (e.g. a few MB) on both transport structs is a small, targeted change.
✨ Feature opportunities
- Stateless HTTP mode (
StreamableHTTPOptions.Stateless = true) would opt into the2026-07-28revision, but the 2-hourSessionTimeoutexists specifically for session affinity on long-runninglogs/auditcalls — staying stateful remains the right call for now; just worth re-checking as more MCP clients default to the new revision. - Extending
SetCacheablebeyond tool lists —resources/readand the other list methods also carryttlMs/cacheScopehooks as of v1.8.0, but gh-aw does not register any resources today, so this is a non-issue until it does. x-mcp-headerpassthrough (SEP-2243) forlogs/audittool params — only relevant if the HTTP server is ever placed behind a reverse proxy; it is loopback-only today.
📏 Best practice alignment
- Tool annotations already use the v1.8.0-aligned bare-
boolconvention. - Deliberate avoidance of premature schema defaults (documented in-code for the
timeoutparam). - In-code comments tracking SDK version-specific behavior — a pattern worth continuing as the SDK keeps shipping
MCPGODEBUG-guarded behavior changes.
🔧 General improvements
- No redundant or legacy-pattern usage found; no
MCPGODEBUGopt-outs are needed anywhere in the codebase.
Recommendations
- Add
MaxLineLengthto themcp inspectstdio path andMaxEventSizeto itsStreamableClientTransport— the one place gh-aw talks to untrusted/arbitrary MCP servers. - No other action needed this cycle — the module is pinned to the latest release and usage already adopts opt-in hardening/caching features rather than lagging behind.
- Keep the
StatelessHTTP mode decision on the radar as stateless-client adoption grows in the MCP ecosystem.
Next steps
- Consider a small follow-up PR adding
MaxLineLength/MaxEventSizebounds tomcp inspects client transports - Re-review after v1.9.0 ships (removes the two new
MCPGODEBUGescape hatches)
Generated by Go Fan — run §41023228742
Module summary saved to: scratchpad/mods/go-sdk.md
Generated by 🐹 Go Fan · claude · agent · ~125 AIC · ⌖ ~1 AIC · ⊞ 4.4K · ◷
- expires on Oct 31, 2026, 12:08 AM UTC-08:00
- Lenguaje dominante
- Go
- Estrellas
- 5.5k
- Forks
- 606
- Merge medio
- 4 h 35 min
- PR fusionados (30 d)
- 807
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/gh-aw
-
automation doc-healer documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
agent-research
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
agentic-workflows automation aw-essential cookie
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
automated-analysis code-quality cookie refactoring
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
github/gh-aw#73088 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
ai-inspected
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
Todos los issues de github/gh-aw
Issues similares
-
bug: microcks test get swallows test failure details and operation results in text output modeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
microcks/microcks-cli#608 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug from-studio
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
esengine/DeepSeek-Reasonix#14868 ·
Los mantenedores suelen responder en 1 día
-
Install notes print "Camunda REST API: https://" without a host when global.host is setPosiblemente ocupada @irisfield la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
camunda/camunda-platform-helm#7790 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
wso2/agent-manager#2220 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: zot exits with code 0 when it can't startPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
project-zot/zot#4636 ·
Los mantenedores suelen responder en 1 día