Skip to content

Commit 617a28b

Browse files
committed
Improve logs in --central mode
Signed-off-by: David Gageot <[email protected]>
1 parent 8e89765 commit 617a28b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cmd/docker-mcp/internal/gateway/run.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func (g *Gateway) Run(ctx context.Context) error {
9898
return nil
9999
}
100100

101+
log("> Start streaming server on port", g.Port)
101102
return g.startCentralStreamingServer(ctx, newMCPServer, ln, configuration)
102103
}
103104
mcpServer := newMCPServer()

cmd/docker-mcp/internal/gateway/transport.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ func (g *Gateway) startCentralStreamingServer(ctx context.Context, newMCPServer
7575
mux.HandleFunc("/mcp", func(w http.ResponseWriter, r *http.Request) {
7676
serverNames := r.Header.Get("x-mcp-servers")
7777
if len(serverNames) == 0 {
78-
_, _ = w.Write([]byte("No server names provided in the request header 'x-mcp-servers'"))
78+
log("No server names provided in the request header 'x-mcp-servers'")
7979
w.WriteHeader(http.StatusBadRequest)
80+
_, _ = io.WriteString(w, "No server names provided in the request header 'x-mcp-servers'")
8081
return
8182
}
8283

@@ -86,8 +87,8 @@ func (g *Gateway) startCentralStreamingServer(ctx context.Context, newMCPServer
8687
mcpServer := newMCPServer()
8788
if err := g.reloadConfiguration(ctx, mcpServer, configuration, parseServerNames(serverNames)); err != nil {
8889
lock.Unlock()
89-
_, _ = w.Write([]byte("Failed to reload configuration"))
9090
w.WriteHeader(http.StatusInternalServerError)
91+
_, _ = io.WriteString(w, "Failed to reload configuration")
9192
return
9293
}
9394
handler = server.NewStreamableHTTPServer(mcpServer)

0 commit comments

Comments
 (0)