Skip to main content

Real-time Monitoring

MCP Gatekeeper provides real-time monitoring of MCP server activity via WebSocket connections.

Overview

The real-time monitoring system uses WebSocket connections to push updates from the backend to the frontend without polling.

What's Monitored

  • Server Status: Active, inactive, error states
  • Tool Calls: Real-time tool execution events
  • Metrics: Performance statistics updates
  • HTTP Requests: Proxy traffic for HTTP servers
  • Errors: Immediate error notifications

WebSocket Connection

Endpoint: ws://127.0.0.1:8000/api/ws/metrics

Message Format:

{
"type": "metric",
"data": {
"server_id": 1,
"tool_name": "read_file",
"latency_ms": 45.2,
"success": true
}
}

Pages with Real-time Updates

Dashboard

  • Live metric counters
  • Recent events feed
  • Active server count

Servers Page

  • Server status indicators
  • Activity badges
  • Last activity timestamps

Metrics Page

  • Live charts and graphs
  • Request rate updates
  • Error rate tracking

Server Activity

  • Real-time log streaming
  • Tool call events
  • Performance metrics

Connection Management

The WebSocket connection:

  • Automatically connects on page load
  • Reconnects on disconnect
  • Buffers messages during reconnection
  • Shows connection status indicator

Implementation

Frontend: Uses native WebSocket API Backend: FastAPI WebSocket support Message Format: JSON

For technical details, see WebSocket API.