Skip to content

fix(cli): read real upstream_stats keys in mcpproxy status server counts#815

Merged
Dumbris merged 1 commit into
mainfrom
fix/status-server-counts
Jul 7, 2026
Merged

fix(cli): read real upstream_stats keys in mcpproxy status server counts#815
Dumbris merged 1 commit into
mainfrom
fix/status-server-counts

Conversation

@Dumbris

@Dumbris Dumbris commented Jul 7, 2026

Copy link
Copy Markdown
Member

Summary

mcpproxy status always printed "Servers: 0 connected, 0 quarantined" because extractServerCounts (cmd/mcpproxy/status_cmd.go) read connected/quarantined/total while the daemon's GetStats builders emit connected_servers/total_servers — and no quarantined count existed at all.

Found in v0.47.0-rc.4 release QA: live daemon had 14 connected + 2 quarantined; CLI showed 0/0.

Changes

  • extractServerCounts reads connected_servers/quarantined_servers/total_servers, with fallback to the bare legacy keys for older daemons
  • Both GetStats builders (stateview path in internal/server, manager fallback in internal/upstream) now emit quarantined_servers (stateview ServerStatus.Quarantined / ServerConfig.Quarantined)

Tests

  • TestExtractServerCounts rewritten against the real payload shape (was red before the fix), legacy-keys case kept
  • ./scripts/test-api-e2e.sh: 65/65 PASS · go test -race ./cmd/mcpproxy green · golangci-lint v2: 0 issues

🤖 Generated with Claude Code

'mcpproxy status' always printed 'Servers: 0 connected, 0 quarantined'
because extractServerCounts read connected/quarantined/total while the
daemon's GetStats builders emit connected_servers/total_servers (and no
quarantined count at all).

- extractServerCounts now reads connected_servers/quarantined_servers/
  total_servers, falling back to the bare legacy keys for older daemons
- both GetStats builders (stateview path in internal/server, manager
  fallback in internal/upstream) now emit quarantined_servers

Found in v0.47.0-rc.4 release QA: live daemon had 14 connected + 2
quarantined; CLI showed 0/0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9c35499
Status: ✅  Deploy successful!
Preview URL: https://39d69347.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-status-server-counts.mcpproxy-docs.pages.dev

View logs

@Dumbris

Dumbris commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

Cross-model review (Codex CLI 0.135.0): ACCEPT — "The changes consistently add support for the daemon's *_servers statistic keys and expose a quarantined server count without introducing an actionable regression in the modified code paths." Round 1/5, no findings to fix.

@codecov-commenter

codecov-commenter commented Jul 7, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 81.81818% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/mcpproxy/status_cmd.go 86.66% 2 Missing ⚠️
internal/server/server.go 77.77% 2 Missing ⚠️
internal/upstream/manager.go 77.77% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/status-server-counts

Available Artifacts

  • archive-darwin-amd64 (28 MB)
  • archive-darwin-arm64 (25 MB)
  • archive-linux-amd64 (16 MB)
  • archive-linux-arm64 (15 MB)
  • archive-windows-amd64 (28 MB)
  • archive-windows-arm64 (25 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (22 MB)
  • installer-dmg-darwin-arm64 (19 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 28846919179 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris Dumbris merged commit 85c2e0f into main Jul 7, 2026
38 checks passed
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.

2 participants