@@ -16,7 +16,13 @@ import (
16
16
"github.com/manusa/kubernetes-mcp-server/pkg/mcp"
17
17
)
18
18
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
+ )
20
26
21
27
func Serve (ctx context.Context , mcpServer * mcp.Server , staticConfig * config.StaticConfig ) error {
22
28
mux := http .NewServeMux ()
@@ -32,10 +38,10 @@ func Serve(ctx context.Context, mcpServer *mcp.Server, staticConfig *config.Stat
32
38
33
39
sseServer := mcpServer .ServeSse (staticConfig .SSEBaseURL , httpServer )
34
40
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 ) {
39
45
w .WriteHeader (http .StatusOK )
40
46
})
41
47
mux .HandleFunc (oauthProtectedResourceEndpoint , func (w http.ResponseWriter , r * http.Request ) {
0 commit comments