MCP in production: 10 failure modes and how to fix them
An MCP server is easy to demo and hard to operate. These are the ten failure modes I see in production tool integrations, with the concrete controls that prevent them.

An MCP server is easy to demo and hard to operate. The demo is one tool, one user, one happy path. Production is many tenants, retries, partial failures, malicious inputs and a bill at the end of the month.
I have built and reviewed tool integrations for production systems, and the same ten failure modes show up again and again. None of them is solved by a better prompt. They are engineering contracts.
1. Tool schema drift
The model sees a tool named search_orders with three fields. Six weeks later the backend adds a required field and renames another. The model keeps calling the old shape, the server returns a validation error, and the agent loops.
Fix: version every tool and keep the schema backward compatible while the old version is in use. Publish a schema_version in the tool description, validate arguments on the server, and return a structured error that tells the model which field is wrong. Treat a breaking change as a new tool, not a silent edit.
2. No tenant isolation
A tool that reads order_id without checking who owns the order is an authorization bypass with a friendly interface. The model does not know your tenancy model, and it will happily pass an ID it saw in another context.
Fix: resolve the tenant from the authenticated session, never from the model's arguments. Every query gets a tenant predicate. The tool should return a 404 for another tenant's object, not a 403 that confirms it exists. Add a test that tries to read another tenant's data on every tool.
3. Unbounded tool output
A tool returns a 2 MB JSON document, the client puts it in the context window, and the next request is expensive, slow or truncated. The model then reasons over a partial document and produces a confident wrong answer.
Fix: cap the output at the server, paginate, and return a compact representation with a cursor. Put the limit in the tool description so the model knows how to ask for more. A tool response is not a database dump.
4. Retries without idempotency
The network times out. The client retries. The tool charges the card twice, sends the email twice or creates two tickets. The model sees one success and has no idea what happened.
Fix: require an idempotency key per logical operation and store the result. The retry returns the original result instead of repeating the side effect. For writes, distinguish safe to retry from must not retry and expose that in the tool contract.
5. No timeout or cancellation
A tool waits on a slow upstream. The user cancels, the client closes the request, and the server keeps working. Now you have orphaned work, a leaked connection and a bill for a result nobody will read.
Fix: set a deadline on every tool, propagate cancellation, and close upstream connections. Return a typed timeout error that the model can handle. A tool without a deadline is an outage waiting for a slow dependency.
6. No observability
When an agent gives a wrong answer, you need to know which tool it called, with which arguments, how long it took, what it returned and which tenant it belonged to. If the only log is “tool failed”, you are debugging blind.
Fix: emit a trace per tool call with the tool name, version, tenant, latency, status, output size and a redacted argument hash. Correlate with the model request ID. Keep the raw payload only when policy allows it, with a short retention window.
7. Prompt injection through tool results
The tool returns a document that contains instructions. The model reads them as part of its context and follows them. The injection did not come from the user; it came from a web page, a ticket or a PDF.
Fix: treat tool output as untrusted data, not instructions. Delimit it, label it, and strip or escape control sequences. Give the model a policy that says tool content cannot change its instructions. For high-risk tools, require a human confirmation before a side effect.
8. No cost controls
One retry loop or one large document can burn a month of budget in an afternoon. The model has no concept of your token price, and the server has no concept of the user's remaining budget.
Fix: set per-request and per-tenant token budgets, cache deterministic reads, cap tool fan-out, and fail closed when the budget is exhausted. Log cost per call and show it in the trace. A cost cap is a product feature, not an afterthought.
9. No evaluations
The team tests the demo prompt, ships, and never runs the same scenario again. A model upgrade or a tool change silently breaks the workflow, and the first signal is a customer complaint.
Fix: keep a small eval set of real tasks with expected tool calls and expected outcomes. Run it in CI on every prompt, tool and model change. Track pass rate, latency, cost and tool-error rate. A demo is not a regression test.
10. No fallback or degradation
The tool is down, the agent has no plan B, and the user gets a stack trace. Or the model keeps retrying a dependency that is clearly unavailable.
Fix: define a degraded path: cached answer, a narrower tool, a human handoff or an explicit “I can’t do that right now”. Return a typed error with a retry hint. The agent should fail gracefully, not creatively.
The production checklist
- Every tool has a version and a stable schema.
- Tenant and user come from the session, not the arguments.
- Outputs are capped, paginated and size-logged.
- Writes are idempotent and retries are safe.
- Every tool has a deadline and cancellation.
- Every call has a trace with tenant, latency, status and cost.
- Tool output is treated as untrusted data.
- Per-request and per-tenant budgets are enforced.
- A regression eval runs in CI.
- A degraded path exists for every critical tool.
What this looks like in practice
I keep the same shape in the projects I ship: a thin MCP or HTTP layer, a domain service that owns authorization and idempotency, and an observability layer that records every call. My Northstar demo uses citation-grounded answers with an eval gate; Hookline exercises signed webhooks, retries and incident response. Both are deliberately boring in the places that matter.
The model is the least deterministic part of the system. The tool contract is the part you can test, version and defend.
FAQ
What is MCP?
Model Context Protocol is an open protocol that lets an AI client discover and call tools, read resources and use prompts exposed by a server. It standardizes the contract between the model and the system it is allowed to touch.
Is MCP secure by default?
No. MCP defines the transport and the message shapes, not your authorization model. You still need authentication, tenant isolation, input validation, output limits, audit logs and injection defenses.
How do I test an MCP server before production?
Test each tool as an API: schema validation, authorization per tenant, timeout and cancellation, idempotency, output size, error paths, injection payloads and a regression eval that runs in CI.
Does MCP replace function calling?
No. Function calling is how a model asks for a tool. MCP is how the client discovers and talks to a tool server. You can use both together, and you should still validate every argument.
If you are putting an MCP server or an AI agent into production and want a second pair of eyes, send me the scope. I reply with the risks, a bounded first task and a fixed price before any work starts.
FAQ
- What is MCP?
- Model Context Protocol is an open protocol that lets an AI client discover and call tools, read resources and use prompts exposed by a server. It standardizes the contract between the model and the system it is allowed to touch.
- Is MCP secure by default?
- No. MCP defines the transport and the message shapes, not your authorization model. You still need authentication, tenant isolation, input validation, output limits, audit logs and injection defenses.
- How do I test an MCP server before production?
- Test each tool as an API: schema validation, authorization per tenant, timeout and cancellation, idempotency, output size, error paths, injection payloads and a regression eval that runs in CI.
- Does MCP replace function calling?
- No. Function calling is how a model asks for a tool. MCP is how the client discovers and talks to a tool server. You can use both together, and you should still validate every argument.
Join the Newsletter
Subscribe to get my latest content by email.
We won't send you spam. Unsubscribe at any time.