From d763bce46d502abc23ae779650d6975a60af9d6e Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Fri, 10 Oct 2025 18:03:07 +0200 Subject: [PATCH] fix(mcp): register sessions (#6429) Because of this, the first calls to the MCP endpoint would fail and later would succeeds thanks to the cache. Signed-off-by: Ettore Di Giacinto --- core/http/endpoints/mcp/tools.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/http/endpoints/mcp/tools.go b/core/http/endpoints/mcp/tools.go index e9d597771..852413db5 100644 --- a/core/http/endpoints/mcp/tools.go +++ b/core/http/endpoints/mcp/tools.go @@ -62,6 +62,7 @@ func SessionsFromMCPConfig( } log.Debug().Msgf("[MCP remote server] Connected to MCP server %s", server.URL) cache.cache[name] = append(cache.cache[name], mcpSession) + allSessions = append(allSessions, mcpSession) } for _, server := range stdio.Servers { @@ -79,6 +80,7 @@ func SessionsFromMCPConfig( } log.Debug().Msgf("[MCP stdio server] Connected to MCP server %s", command) cache.cache[name] = append(cache.cache[name], mcpSession) + allSessions = append(allSessions, mcpSession) } signals.RegisterGracefulTerminationHandler(func() {