mirror of
https://github.com/mudler/LocalAI.git
synced 2026-02-13 05:29:11 -06:00
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 <mudler@localai.io>
This commit is contained in:
committed by
GitHub
parent
4aac0ef42e
commit
d763bce46d
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user