Skip to content

Conversation

@kevalmahajan
Copy link
Member

@kevalmahajan kevalmahajan commented Nov 26, 2025

🐛 Bug-fix PR

📌 Summary

Closes #464 and #1506

The health status of MCP servers and tools is automatically updated in the UI in real time, without requiring a manual page reload. This is achieved through a centralized event service that handles the publishing and subscription of events. These events are streamed to the UI as server-sent events, allowing the status of MCP servers and tools to be refreshed automatically based on the latest health checks.

🔁 Reproduction Steps

  1. Open the Context Forge Gateway UI.
  2. Stop your MCP server that is added in the gateway, so that health checks fail, and the MCP server is tagged as Offline.
  3. Check the logs that the MCP server is tagged as offline but in UI that is not reflected in real time.
  4. After current changes, the status is reflected real time when the server is offline and when it comes back online.

🐞 Root Cause

Previously, the UI relied on manual refresh to update the health status of MCP servers and tools. There was no mechanism to propagate real-time updates from the backend to the frontend, leading to stale health information.

💡 Fix Description

  1. Introduced a centralized event service to publish and subscribe to server and tool health events.
  2. The event service sends server-sent events (SSE) to the UI.
  3. The UI listens for these events and updates the health status of MCP servers and tools in real time.
  4. This design eliminates the need for a manual page reload and ensures health status is always up to date based on backend checks.

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage ≥ 90 % make coverage
Manual regression no longer fails steps / screenshots

📐 MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

kevalmahajan and others added 22 commits November 27, 2025 20:03
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Keval Mahajan <mahajankeval23@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai force-pushed the notify_gateway_status_change branch from a3d81b3 to 21771f7 Compare November 27, 2025 20:34
@crivetimihai
Copy link
Member

Freezes on doctest somewhere, working on it.

The test was setting tool_service._event_subscribers but ToolService
now delegates event publishing to _event_service. Updated to set
_event_service._event_subscribers and force local mode.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai merged commit 93bf8cf into main Nov 27, 2025
45 checks passed
@crivetimihai crivetimihai deleted the notify_gateway_status_change branch November 27, 2025 21:41
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.

[Bug]: MCP Server "Active" status not getting updated under "Gateways/MCP Servers" when the MCP Server shutdown.

3 participants