Skip to content

Commit abd9848

Browse files
committed
fix(mcp): let bulk discovery reconnect a lost notification connection with current config
1 parent 3ac3d2d commit abd9848

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

apps/sim/lib/mcp/service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,10 +789,10 @@ class McpService {
789789
if (mcpConnectionManager) {
790790
const manager = mcpConnectionManager
791791
for (const config of liveConnections) {
792-
// Resolve only for servers the manager isn't already monitoring — a
793-
// pooled `listTools` hit above no longer resolves, so this is the sole
794-
// remaining resolution cost, and it's skipped in the steady state.
795-
if (manager.hasConnection(config.id)) continue
792+
// Kick the notification manager for every fetched server; `connect` is
793+
// idempotent (skips a live/connecting one) and reconnects a lost one with
794+
// this current config — do not pre-gate on `hasConnection`, whose state
795+
// survives a transport loss and would block that fresh reconnect.
796796
void (async () => {
797797
try {
798798
const { config: resolvedConfig, resolvedIP } = await this.resolveConfigEnvVars(

0 commit comments

Comments
 (0)