{"record":{"id":"f240e0e4cfa73f35","repo":"can1357/oh-my-pi","slug":"name-message-joined-by","errorCode":null,"errorMessage":"${name}: ${message} (joined by \"; \")","messagePattern":"(.+?): (.+?) \\(joined by \"; \"\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/modes/acp/acp-agent.ts","lineNumber":2678,"sourceCode":"\t\tmanager.setOnToolsChanged(() => {\n\t\t\t// Failures are logged once via the stored chain's catch above.\n\t\t\tenqueueMcpToolsRefresh().catch(() => {});\n\t\t});\n\t\tconst configs: MCPConfigMap = {};\n\t\tconst sources: MCPSourceMap = {};\n\t\tfor (const server of servers) {\n\t\t\tconfigs[server.name] = this.#toMcpConfig(server);\n\t\t\tsources[server.name] = {\n\t\t\t\tprovider: \"acp\",\n\t\t\t\tproviderName: \"ACP Client\",\n\t\t\t\tpath: `acp://${server.name}`,\n\t\t\t\tlevel: \"project\",\n\t\t\t};\n\t\t}\n\n\t\tconst result = await manager.connectServers(configs, sources);\n\t\tif (result.errors.size > 0) {\n\t\t\tthrow new Error(\n\t\t\t\tArray.from(result.errors.entries())\n\t\t\t\t\t.map(([name, message]) => `${name}: ${message}`)\n\t\t\t\t\t.join(\"; \"),\n\t\t\t);\n\t\t}\n\n\t\trecord.mcpManager = manager;\n\t\tawait enqueueMcpToolsRefresh();\n\t}\n\n\t#toMcpConfig(server: McpServer): MCPServerConfig {\n\t\tif (\"command\" in server) {\n\t\t\treturn {\n\t\t\t\ttype: \"stdio\",\n\t\t\t\tcommand: server.command,\n\t\t\t\targs: server.args,\n\t\t\t\tenv: this.#toNameValueMap(server.env),\n\t\t\t};","sourceCodeStart":2660,"sourceCodeEnd":2696,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/modes/acp/acp-agent.ts#L2660-L2696","documentation":"After connecting the configured MCP servers, manager.connectServers returns an errors map of server name → failure message. If any server failed, AcpAgent aggregates all entries into one message joined by \"; \" and throws, so the ACP client sees every failing server at once. It surfaces MCP infrastructure problems that would otherwise silently leave tools unavailable.","triggerScenarios":"Calling the ACP MCP-server configuration RPC where connectServers reports a non-empty errors map — any per-server connect failure (bad command, unreachable URL, auth failure) triggers it.","commonSituations":"An MCP server command is not on PATH; an HTTP/SSE server URL is wrong or down; a header token expired; project vs user config points at conflicting server definitions.","solutions":["Read the per-server messages in the error (format 'name: message; ...') and fix each named server's command/URL/auth in the MCP config.","Verify server executables are installed and on PATH, and HTTP servers are reachable (curl the URL).","Temporarily remove the failing server from config to unblock the session, then repair it separately."],"exampleFix":"// before (config)\n{ \"mcpServers\": { \"fs\": { \"command\": \"mcp-fs\", \"args\": [] } } }\n// after\n{ \"mcpServers\": { \"fs\": { \"command\": \"npx\", \"args\": [\"-y\", \"@modelcontextprotocol/server-filesystem\", \"/tmp\"] } } }","handlingStrategy":"try-catch","validationCode":"for (const [name, cfg] of Object.entries(configs)) {\n  if (cfg.command && !(await which(cfg.command).catch(() => null))) {\n    logger.warn(\"MCP command not found, skipping\", { name, command: cfg.command });\n    delete configs[name];\n  }\n}\nawait manager.connectServers(configs, sources);","typeGuard":null,"tryCatchPattern":"try {\n  await manager.connectServers(configs, sources);\n} catch (err) {\n  const failures = err.message.split(\"; \").map(s => s.split(\":\")[0]);\n  logger.error(\"MCP servers failed to connect\", { failures });\n  // proceed with degraded tool set or rethrow\n}","preventionTips":["Verify each server command is installed and on PATH before configuring it.","Health-check HTTP/SSE server URLs and auth headers as part of setup.","Keep per-server config isolated so one bad server doesn't block the rest; read the 'name: message' pairs to fix each individually."],"tags":["mcp","connection","config"],"backgroundTag":"mcp-server-connect-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}