Skip to content

mcp: fix status() to not overwrite connected with failed#1

Merged
shuv1337 merged 1 commit intodevfrom
fix/mcp-status-correct-connected
Oct 28, 2025
Merged

mcp: fix status() to not overwrite connected with failed#1
shuv1337 merged 1 commit intodevfrom
fix/mcp-status-correct-connected

Conversation

@shuv1337
Copy link
Collaborator

Fix MCP status showing servers as failed when connected

Summary

  • Correct MCP.status() logic to avoid overwriting a connected status with failed.
  • This resolves the UI showing gh_grep and chrome-devtools as failed despite being usable.

Details

  • Previous logic set result[key] = "connected" when the client existed, but then immediately set result[key] = "failed" unconditionally. Added a continue to preserve connected.
  • Keeps the existing response shape: Record<string, "connected" | "failed" | "disabled">, matching opencode-web's current expectations.
  • Note: sst/opencode's opentui branch returns { name: { status } }. If/when we adopt that shape, we'll align the web client accordingly. For now, this PR fixes correctness without changing the API shape.

Verification

  • In opencode-web, /mcp drives the McpStatus component. After this change, servers with active clients report connected and render green.

Upstream

  • The opentui branch appears to have addressed this; this fork PR ensures we are unblocked now while upstream changes land.

@shuv1337 shuv1337 merged this pull request into dev Oct 28, 2025
@shuv1337 shuv1337 deleted the fix/mcp-status-correct-connected branch November 21, 2025 00:33
@coderabbitai coderabbitai bot mentioned this pull request Nov 21, 2025
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.

1 participant