From bff1066962853928cda24186068c0ea2ede86d42 Mon Sep 17 00:00:00 2001 From: Jacob Rosenberg Date: Fri, 7 Nov 2025 16:53:57 -0800 Subject: [PATCH] Add health check endpoint to HTTP server --- internal/commands/http.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/commands/http.go b/internal/commands/http.go index d6bc79f..4d7e5e3 100644 --- a/internal/commands/http.go +++ b/internal/commands/http.go @@ -39,6 +39,8 @@ func (c *HTTPCmd) Run(ctx context.Context, globals *Globals) error { mux := http.NewServeMux() srv := newServerWithTimeouts(mux) + mux.HandleFunc("/health", healthHandler) + if c.UseSSE { handler := mcpserver.NewSSEServer(mcpServer) mux.Handle("/sse", handler) @@ -61,3 +63,7 @@ func newServerWithTimeouts(mux *http.ServeMux) *http.Server { IdleTimeout: 60 * time.Second, } } + +func healthHandler(w http.ResponseWriter, _ *http.Request) { + w.WriteHeader(http.StatusOK) +}