From 5202bfdf9f99254fbbe4ee7adb0010c7ee9516f4 Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 13 Jan 2026 23:12:13 +0000 Subject: [PATCH] Checkpoint: File edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic checkpoint created by Claude Code - Branch: v3 - Timestamp: 2026-01-13T23:12:13Z - Changes: 1 file(s) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- v3/@claude-flow/cli/src/mcp-server.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/v3/@claude-flow/cli/src/mcp-server.ts b/v3/@claude-flow/cli/src/mcp-server.ts index 63b29e6d9f..fa20d01750 100644 --- a/v3/@claude-flow/cli/src/mcp-server.ts +++ b/v3/@claude-flow/cli/src/mcp-server.ts @@ -242,11 +242,17 @@ export class MCPServerManager extends EventEmitter { metrics?: Record; }> { if (this.options.transport === 'stdio') { - // For stdio, just check if process is running + // For stdio, check if process is running const pid = await this.readPidFile(); - return { - healthy: pid !== null && this.isProcessRunning(pid), - }; + if (pid === null) { + return { healthy: false, error: 'No PID file found' }; + } + if (!this.isProcessRunning(pid)) { + // Clean up stale PID file + await this.removePidFile(); + return { healthy: false, error: 'Process not running (cleaned up stale PID)' }; + } + return { healthy: true }; } // For HTTP/WebSocket, make health check request