An MCP server can look healthy while every tool call is slow, every search returns empty, or one tenant is exhausting the connection pool. Monitoring must cover the protocol boundary and the work behind it. Scaling without measurement just moves the bottleneck.
Start with user-visible signals
Define a few service-level indicators:
- Availability: successful protocol discovery responses divided by attempts.
- Tool success rate: calls returning a valid result or a deliberate tool error, not protocol failures.
- Latency: p50, p95, and p99 per tool, split by read and write.
- Upstream health: error rate and latency of dependencies.
- Saturation: concurrency, queue depth, memory, and connection pool usage.
A JSON-RPC error should not be counted the same as a tool returning a permission error. They mean different things and have different owners.
Structured logs
Log one event per request or tool call with:
{
"ts": "2026-10-23T12:00:00Z",
"request_id": "01J...",
"tool": "search_issues",
"outcome": "ok",
"duration_ms": 184,
"upstream_status": 200,
"tenant": "acme"
}
Keep secrets, tokens, full arguments, and result bodies out. If you need to debug a payload, use a sampling mechanism with redaction and a short retention window, not routine logs.
Send logs to stderr for stdio processes (where the client or supervisor captures them) and to the platform log collector for containers. Never write logs to stdout on a stdio server.
Traces and correlation
Propagate a request id from the MCP request into upstream calls. If you use OpenTelemetry, create spans for the tool invocation and each dependency call. Record attributes such as tool name, outcome, and retry count. Do not attach credentials or raw user content as span attributes.
For remote deployments, preserve a client-supplied correlation header if it is safe and documented; otherwise generate one at the edge and return it in logs or a header for support.
Alerts that are worth waking someone for
- Sustained authentication failure spike (possible credential or attack issue).
- Tool error rate above an agreed threshold.
- p95 latency above the user-facing budget.
- Upstream failures or circuit breaker open.
- Unexpected memory growth or process restarts.
- Queue or concurrency saturation.
Alert on symptoms users feel, not on every internal counter. Each alert needs a runbook entry and an owner.
Timeouts and backpressure
Set and align three budgets:
- Per-upstream-call timeout.
- Per-tool deadline.
- Client or gateway timeout.
If the client gives up at 15 seconds, a 60-second server operation is wasted work. Return a controlled error before the client disconnects, and cancel downstream work when possible.
Apply backpressure with bounded queues and concurrency limits. Reject or defer excess work with a clear error rather than silently accumulating tasks until the process runs out of memory.
Rate limits and fairness
Rate limit at the edge and inside the server:
- Per token or tenant.
- Per tool for expensive operations.
- Global concurrency for shared dependencies.
Prevent one tenant from consuming the entire connection pool. Fairness matters more than raw throughput in shared deployments.
Scaling patterns
Stateless tools scale horizontally with a load balancer. Keep no in-process session state; read configuration and credentials at startup or from a secret store.
Stateful or long-running tools need a different design: job queues, external state stores, and polling or progress notifications. Do not pin users to an instance by accident.
Tool catalogs should be identical across replicas. A tool that exists on one instance but not another creates nondeterministic agent behavior.
Dependencies are often the real bottleneck. Scale the MCP servers and the upstream service together, or add caching with explicit invalidation and privacy review.
Load testing
Test with representative requests, not just a synthetic ping:
- Mixed read and write tools.
- Slow upstream responses and errors.
- Concurrent tenants.
- Large result sets near the truncation limit.
- Auth and token refresh.
Record throughput, latency, error rate, and resource use. Test the failure modes: what happens when the upstream is down, when the queue fills, and when a client disconnects? A server that stays up but returns misleading results is not reliable.
Cost and retention
MCP integrations can generate significant upstream API usage. Track cost per tool and per tenant where possible. Set budgets and rate limits. Define retention for logs and traces; sensitive payloads should have shorter retention, or never be logged.
A reliability review checklist
- SLIs and SLO targets are written down.
- Logs exclude secrets and include request ids.
- Metrics are split by tool and outcome.
- Timeouts are aligned across client, server, and upstream.
- Concurrency and rate limits exist.
- Alerts have owners and runbooks.
- Load and failure tests have been run.
- Scaling assumptions are documented.
- Cost and retention are bounded.
Monitoring is not a dashboard after launch; it is how you learn whether the server solves the user’s task. Pair these signals with real user reports and protocol-level tests. For security monitoring, see securing MCP servers; for deployment mechanics, see deploy an MCP server.
Sources
Sources were checked on Oct 23, 2026. Versions and client behavior can change; confirm the current documentation before relying on a configuration.