mcp: batch without MCP-Protocol-Version is accepted when SupportedProtocolVersions excludes 2025-03-26
Los mantenedores suelen responder en 1 día
@nahapetyan-serob ya está trabajando en esto.
Desde el 10/11/2026.
- #1514 de @emgeorrk — cerrado sin fusionar
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Checklist
- I searched the existing issues, and this has not been reported before.
- This is a real problem that I ran into myself, using the latest release of the SDK.
- I ran into it in a production system, not in a toy example, a benchmark, or an automated or AI-driven scan of the code.
- I (a human) examined the relevant SDK code, and wrote or reviewed every line of this report. It is not unreviewed AI output.
- This report is brief and concise, and sticks to the facts needed to understand the problem.
What happened?
With ServerOptions.SupportedProtocolVersions limited to versions without JSON-RPC batching (2025-06-18 and later), the Streamable HTTP handler still accepts a batch sent without the MCP-Protocol-Version header and runs every call in it. The same batch with MCP-Protocol-Version: 2025-03-26 is rejected as an unsupported version.
servePOST falls back to 2025-03-26 when the header is missing, and the batch check compares only that fallback with 2025-06-18. It does not consider which versions the server supports.
Expected: 400 for the header-less batch when no supported version allows batching, as with the explicit 2025-03-26 header. Single messages without the header (such as initialize) should keep working.
I have a fix with a regression test and would like to send it as a PR if this is assigned to me.
I used Claude Code (AI) to investigate this and draft the report; I reviewed it.
How to reproduce
package main
import (
"log"
"net/http"
"github.com/modelcontextprotocol/go-sdk/mcp"
)
func main() {
server := mcp.NewServer(&mcp.Implementation{Name: "repro", Version: "v0.0.1"}, &mcp.ServerOptions{
SupportedProtocolVersions: []string{"2026-07-28", "2025-11-25", "2025-06-18"},
})
handler := mcp.NewStreamableHTTPHandler(func(*http.Request) *mcp.Server { return server },
&mcp.StreamableHTTPOptions{Stateless: true, JSONResponse: true})
log.Fatal(http.ListenAndServe("127.0.0.1:8080", handler))
}
// BODY='[{"jsonrpc":"2.0","id":1,"method":"ping"},{"jsonrpc":"2.0","id":2,"method":"ping"}]'
// curl -s http://127.0.0.1:8080 -H 'Content-Type: application/json' \
// -H 'Accept: application/json, text/event-stream' -d "$BODY"
//
// No header: 200 [{"jsonrpc":"2.0","id":2,"result":{}},{"jsonrpc":"2.0","id":1,"result":{}}]
// MCP-Protocol-Version: 2025-03-26: 400 Bad Request: Unsupported protocol version (supported versions: 2026-07-28,2025-11-25,2025-06-18)
// MCP-Protocol-Version: 2025-06-18: 400 JSON-RPC batching is not supported in 2025-06-18 and later
Where did you hit this?
A public read-only documentation MCP server (stateless Streamable HTTP, JSON responses) where we wanted to stop accepting legacy JSON-RPC batches.
Go MCP SDK version
v1.8.0 (also reproduced on main at 0e849cb)
Go version
go version go1.27.1 darwin/arm64
Logs
No response
- Lenguaje dominante
- Go
- Estrellas
- 5.4k
- Forks
- 623
- Merge medio
- 22 h 10 min
- PR fusionados (30 d)
- 30
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 modelcontextprotocol/go-sdk
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
modelcontextprotocol/go-sdk#1557 ·
Los mantenedores suelen responder en 1 día
-
Streamable HTTP (2026-07-28): tools/call with an out-of-range number in arguments fails because extractName decodes Arguments into anyQuizá libre de nuevo @beiryu la tomó hace 10 días y no hay ningún pull request abierto. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
modelcontextprotocol/go-sdk#1534 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Expose generic `SendNotification` on `ServerSession` for custom protocol extensionsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertoneeds investigation
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
modelcontextprotocol/go-sdk#745 · 13 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 18/100
modelcontextprotocol/go-sdk#1555 ·
Los mantenedores suelen responder en 1 día
-
mcp: 2026-07-28 client runs elicitation and sampling handlers for standalone server requestsQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
modelcontextprotocol/go-sdk#1552 ·
Los mantenedores suelen responder en 1 día
Todos los issues de modelcontextprotocol/go-sdk
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
apache/dubbo-admin#1659 ·
Los mantenedores suelen responder en 8 días
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behindPosiblemente ocupada @arshil42 la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Packaging: support mise-en-placeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100