Health endpoint
GET /health — public, no authentication.
status is one of:
| Value | HTTP code | Meaning |
|---|---|---|
healthy | 200 | All enabled MCP servers connected; DB (if enabled) is healthy. |
degraded | 200 | Some enabled MCP servers are not connected, but MCPHub itself is up. |
unhealthy | 503 | Database health check failed (in DB mode) or an internal error occurred. |
/health suitable for liveness/readiness probes. See src/controllers/healthController.ts.
In-process logs
MCPHub keeps a rolling in-memory log buffer (src/services/logService.ts) that powers the dashboard’s log viewer.
| Method & Path | Description |
|---|---|
GET /api/logs | Returns the buffered log entries as JSON. |
DELETE /api/logs | Clears the buffer. |
GET /api/logs/stream | Server-Sent Events stream of new log entries as they are produced. |
data: line per event, including an initial { "type": "initial", "logs": [...] } snapshot. All three endpoints require an authenticated admin (dashboard JWT, bearer key with accessType: all, OAuth token, or Better Auth session).
The buffer is process-local. For multi-instance deployments, ship stdout to your log aggregator instead of relying on this endpoint.
Activity log (database mode)
When MCPHub runs against PostgreSQL (see Database Configuration), every MCP request/response is persisted to themcphub_activity table by src/services/activityLoggingService.ts. The dashboard exposes it through:
| Method & Path | Description |
|---|---|
GET /api/activities/available | Returns { available: true } when activity logging is on (DB mode). |
GET /api/activities | Paginated activities. Query: page, limit, server, tool, status (success/error), group, keyId, keyName, startDate, endDate. |
GET /api/activities/stats | Aggregate stats with the same filters. |
GET /api/activities/filters | Distinct values for filter dropdowns. |
GET /api/activities/:id | Full record including request input and response output. |
DELETE /api/activities/cleanup | Delete activities older than a configured retention threshold. |
404 and the dashboard hides the Activity page.
Process-level metrics
The dashboard surfaces basic server connection statistics fromgetServerConnectionStats() (also embedded in /health). To export richer process metrics:
- Use any Node.js APM agent that wraps
http/expressautomatically. - Or scrape
/healthand/api/activities/statsfrom your monitoring platform.
See also
- Database Configuration — enable PostgreSQL to unlock activity logging.
- Authentication & Security — how the management API and bearer-key authentication work.