@@ -16,7 +16,13 @@ import (
1616 "github.com/manusa/kubernetes-mcp-server/pkg/mcp"
1717)
1818
19- const oauthProtectedResourceEndpoint = "/.well-known/oauth-protected-resource"
19+ const (
20+ oauthProtectedResourceEndpoint = "/.well-known/oauth-protected-resource"
21+ healthEndpoint = "/healthz"
22+ mcpEndpoint = "/mcp"
23+ sseEndpoint = "/sse"
24+ sseMessageEndpoint = "/message"
25+ )
2026
2127func Serve (ctx context.Context , mcpServer * mcp.Server , staticConfig * config.StaticConfig ) error {
2228 mux := http .NewServeMux ()
@@ -32,10 +38,10 @@ func Serve(ctx context.Context, mcpServer *mcp.Server, staticConfig *config.Stat
3238
3339 sseServer := mcpServer .ServeSse (staticConfig .SSEBaseURL , httpServer )
3440 streamableHttpServer := mcpServer .ServeHTTP (httpServer )
35- mux .Handle ("/sse" , sseServer )
36- mux .Handle ("/message" , sseServer )
37- mux .Handle ("/mcp" , streamableHttpServer )
38- mux .HandleFunc ("/healthz" , func (w http.ResponseWriter , r * http.Request ) {
41+ mux .Handle (sseEndpoint , sseServer )
42+ mux .Handle (sseMessageEndpoint , sseServer )
43+ mux .Handle (mcpEndpoint , streamableHttpServer )
44+ mux .HandleFunc (healthEndpoint , func (w http.ResponseWriter , r * http.Request ) {
3945 w .WriteHeader (http .StatusOK )
4046 })
4147 mux .HandleFunc (oauthProtectedResourceEndpoint , func (w http.ResponseWriter , r * http.Request ) {
0 commit comments