-
Notifications
You must be signed in to change notification settings - Fork 711
Closed
Description
In github.com/mark3labs/mcp-go/server/sse.go:
func (s *SSEServer) handleMessage(w http.ResponseWriter, r *http.Request) {
...
ctx := s.server.WithContext(r.Context(), session)
...
// quick return request, send 202 Accepted with no body, then deal the message and sent response via SSE
w.WriteHeader(http.StatusAccepted)
go func() {
// Process message through MCPServer
response := s.server.HandleMessage(ctx, rawMessage)
...
}()
}r.Context() is canceled by golang after handleMessage returns. HandleMessage in the goroutine should not use context derived from r.Context().
manusa and dronnix
Metadata
Metadata
Assignees
Labels
No labels