This PR fixes incorrect MCP server status reporting by deriving status from actual MCP process state instead of agent count.#1445
Conversation
…ead of agent count
There was a problem hiding this comment.
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
statusfield (Running/Stopped) to MCP status output derived from process detection. - Simplify
connectionscalculation to useprocessCountdirectly. - 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'; |
There was a problem hiding this comment.
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.
| status: 'Running' | 'Stopped'; |
| status: isRunning ? 'Running' : 'Stopped', | ||
| running: isRunning, | ||
| processCount, | ||
| orchestratorRunning, | ||
| port, | ||
| connections: processCount > 0 ? Math.max(1, processCount - 1) : 0 // Estimate connections | ||
| connections: processCount | ||
| }; |
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| return { | ||
| status: isRunning ? 'Running' : 'Stopped', |
There was a problem hiding this comment.
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.
This PR fixes incorrect MCP server status reporting.
Previously, status was derived from agent count, which did not reflect the actual server state.
Changes:
This ensures that "claude-flow status" reflects the real MCP server state.
Closes #760