Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

fix: MCP start() self-detection for stdio transport

rUvd27536189805
diff --git a/v3/@claude-flow/cli/src/mcp-server.ts b/v3/@claude-flow/cli/src/mcp-server.ts
index 7567d72e38..cc7d0adf20 100644
--- a/v3/@claude-flow/cli/src/mcp-server.ts
+++ b/v3/@claude-flow/cli/src/mcp-server.ts
@@ -99,9 +99,11 @@ export class MCPServerManager extends EventEmitter {
* Start the MCP server
*/
async start(): Promise<MCPServerStatus> {
- // Check if already running
+ // Check if already running (skip if status reports our own PID —
+ // getStatus() returns running=true for the current process in stdio mode
+ // even before the server is actually started)
const status = await this.getStatus();
- if (status.running) {
+ if (status.running && status.pid !== process.pid) {
throw new Error(`MCP Server already running (PID: ${status.pid})`);
}