Skip to content

This PR fixes incorrect MCP server status reporting by deriving status from actual MCP process state instead of agent count.#1445

Open
TeamInfinixdevcom wants to merge 1 commit intoruvnet:mainfrom
TeamInfinixdevcom:fix/mcp-status
Open

This PR fixes incorrect MCP server status reporting by deriving status from actual MCP process state instead of agent count.#1445
TeamInfinixdevcom wants to merge 1 commit intoruvnet:mainfrom
TeamInfinixdevcom:fix/mcp-status

Conversation

@TeamInfinixdevcom
Copy link
Copy Markdown

This PR fixes incorrect MCP server status reporting.

Previously, status was derived from agent count, which did not reflect the actual server state.

Changes:

  • Status is now based on MCP process detection (processCount)
  • Removed incorrect dependency on agents.length
  • Simplified connections logic to use processCount directly

This ensures that "claude-flow status" reflects the real MCP server state.

Closes #760

Copilot AI review requested due to automatic review settings March 26, 2026 01:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes inaccurate MCP server status reporting by basing status on detected MCP process state rather than agent count, ensuring claude-flow status reflects the real server state.

Changes:

  • Add explicit status field (Running/Stopped) to MCP status output derived from process detection.
  • Simplify connections calculation to use processCount directly.
  • Remove two multi-repo skill documentation files from .agents/skills.

Reviewed changes

Copilot reviewed 3 out of 6 changed files in this pull request and generated 3 comments.

File Description
v2/src/utils/metrics-reader.ts Derives MCP server status from actual process detection and adjusts reported connection counts.
.agents/skills/github-multi-repo/SKILL.md Removed skill documentation file (unrelated to MCP status reporting).
.agents/skills/agent-multi-repo-swarm/SKILL.md Removed skill documentation file (unrelated to MCP status reporting).
Files not reviewed (1)
  • v3/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

interface MCPServerStatus {
status: 'Running' | 'Stopped';
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status and running represent the same state and can drift if any future code path sets one but not the other. Consider making one the single source of truth (e.g., keep only running, or keep only status), or make status a derived value (e.g., computed at formatting/serialization time) to prevent inconsistencies.

Suggested change
status: 'Running' | 'Stopped';

Copilot uses AI. Check for mistakes.
Comment on lines +262 to 268
status: isRunning ? 'Running' : 'Stopped',
running: isRunning,
processCount,
orchestratorRunning,
port,
connections: processCount > 0 ? Math.max(1, processCount - 1) : 0 // Estimate connections
connections: processCount
};
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assigning connections to processCount changes the meaning of the connections field (it no longer represents an estimated connection count). If the intent is to expose process count, consider renaming the field to something like connectionCount vs processCount, or add a clarifying comment/documentation so consumers don’t misinterpret the value.

Copilot uses AI. Check for mistakes.
}

return {
status: isRunning ? 'Running' : 'Stopped',
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR includes deletion of .agents/skills/github-multi-repo/SKILL.md and .agents/skills/agent-multi-repo-swarm/SKILL.md, which appears unrelated to MCP server status reporting. Please either (a) split those deletions into a separate PR, or (b) update the PR description with rationale so reviewers can assess the impact appropriately.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP Server status shows as 'Stopped' even when running

2 participants