What should you monitor?
Monitor the complete path from the MCP client to the upstream system:
Track results by tool name and server version. A healthy overall average can hide one slow or failing tool.
Use structured logs
Write logs as structured fields instead of long free-form strings.- Timestamp and severity
- Request, session, and trace identifiers
- MCP method and capability name
- Tool, resource, or prompt name
- Authenticated principal or anonymized tenant identifier
- Server and protocol version
- Duration, result size, and outcome
- Safe error category and upstream status
Follow MCP logging rules
The MCP specification lets a server declare thelogging capability and send structured notifications/message events. A client can request a minimum severity with logging/setLevel.
For a local stdio server, reserve stdout for protocol messages. Send operational logs to stderr. Writing ordinary logs to stdout can corrupt the JSON-RPC stream.
Protocol logs are useful to the connected client. They do not replace your server-side observability pipeline, audit log, or infrastructure metrics.
Add distributed tracing
Create a trace at the MCP request boundary and a span for each important step:Build useful dashboards
Start with four dashboards:- Service health: availability, request rate, latency, and error rate.
- Tool usage: calls, success rate, latency, and result size by tool.
- Dependencies: upstream API latency, status codes, retries, and rate limits.
- Security: authentication failures, denied operations, unusual call volume, and destructive actions.
Alert on user impact
Good alerts describe an actionable failure:- Initialization failures exceed the normal baseline.
- A tool’s error rate remains above its threshold.
- p95 latency breaches the service objective.
- Upstream
429or5xxresponses rise sharply. - Authorization failures or destructive calls increase unexpectedly.
- No requests or heartbeats arrive when traffic is expected.
Separate operational logs from audit logs
Operational logs help you debug reliability. Audit logs answer who performed a sensitive action, what changed, and whether it was allowed. For a write or destructive tool, an audit event should include:- The authenticated actor
- The tool and target object
- The authorization decision
- A timestamp and correlation ID
- The outcome and safe change summary
Monitor a 0mcp server
0mcp provides activity logs and usage analytics for hosted MCP servers created from OpenAPI, Swagger, direct REST API, or GraphQL sources. Use Analytics to review usage patterns and Logs to investigate individual calls. When you publish a new version, compare errors and latency with the previous version and use rollback if necessary.Production checklist
- Structured logs use stable field names
-
stdoutis reserved forstdioprotocol messages - Secrets and sensitive payloads are redacted
- Metrics are segmented by tool and version
- Traces cover upstream dependencies
- Dashboards show availability, latency, errors, and saturation
- Alerts have thresholds, owners, and runbooks
- Sensitive actions create protected audit events
- Retention and access policies match your compliance needs