diff --git a/web/server.go b/web/server.go index f1cc348..f79f06a 100644 --- a/web/server.go +++ b/web/server.go @@ -136,7 +136,12 @@ func (s *Server) Routes() http.Handler { }) if s.MCP != nil { - mux.Handle("/mcp/", http.StripPrefix("/mcp", s.MCP)) + // Mount MCP routes with explicit method+path patterns. A prefix pattern + // like `/mcp/` would conflict with `GET /` under Go 1.22's strict + // ServeMux (the prefix matches more methods than the subtree root). + mcpHandler := http.StripPrefix("/mcp", s.MCP) + mux.Handle("POST /mcp/rpc", mcpHandler) + mux.Handle("GET /mcp/rpc", mcpHandler) } static, _ := fs.Sub(staticFS, "static")