Zero Labs
Industry News / AI

MCP in Production: 7 Failure Modes Nobody Talks About

Source · Towards AI By Siddardha Vangala

From the publisher’s feed, collected in the ZeroLabs newsroom.

Over the past year, Model Context Protocol (MCP) has rapidly become a foundational layer for building AI agents that interact with real systems.At first glance, MCP feels simple. It standardizes how AI agents communicate with tools using JSON-RPC, exposes tool schemas to models, and supports streaming responses. In demos, everything works beautifully. You spin up a server, register a few tools, connect an agent, and suddenly the model can execute actions in the real world.But once you move from demo environments to production systems, things start breaking in ways that most tutorials never discuss.I’ve been building internal AI systems that rely heavily on MCP servers for orchestrating tools, triggering backend workflows, and retrieving operational data. And the biggest lesson I’ve learned is this:The protocol is the easy part. Production architecture is the hard part.Here are seven MCP failure modes that only appear when you run these systems at scale.1. Stateful Sessions Break Horizontal ScalingMost early MCP implementations store session transports and event stores in memory.That works fine on a single server. But once you deploy multiple instances behind a load balancer, problems appear quickly.Long-lived MCP sessions mean that the same server must maintain responsibility for streaming responses back to the client. If requests get routed to a different instance, the session context disappears.This is why traditional request-based load balancing fails for MCP servers.Two production patterns usually solve this:• Sticky sessions at the load balancer level • External session stores such as Redis or ValkeySticky sessions are simpler and work well early on. But at scale, most teams eventually move session state to an external store so servers can remain stateless.2. Long-Running Tools Block the Event LoopIn many MCP systems, tools are not simple API calls. They often trigger workflows, run model inference, orchestrate multiple backend services, or perform heavy data processing.In demo environments this usually works fine. The MCP server receives the tool call, executes the logic, and streams the result back to the client.But in production systems, this pattern quickly becomes problematic.Most MCP servers run on event-driven runtimes such as Node.js. If a tool performs a long-running operation directly inside the request handler, the server’s event loop can become blocked. When this happens, other incoming requests must wait until the task finishes.The result is a cascade of issues that are difficult to diagnose at first:streaming responses begin to stallnew tool calls experience increased latencysession heartbeats stop respondingmultiple clients appear to hang simultaneouslyFrom the outside it may look like the server is overloaded, when in reality a few long-running tools are monopolizing the event loop.This problem becomes even more noticeable when tools perform operations such as:large language model inferencecomplex database queriesmulti-step backend workflowsexternal API orchestrationIn production environments, the MCP server should ideally focus on connection management and streaming, not heavy computation.A common architectural pattern to address this is the Gateway + Worker Pool model.In this architecture, the MCP server acts as a lightweight gateway responsible for handling client connections and routing tool requests. Instead of executing heavy tasks directly, it pushes them to a worker queue where dedicated worker processes perform the actual computation.Workers can scale independently of the gateway, which allows the system to handle high numbers of concurrent MCP sessions while still supporting expensive operations.Example: Delegating MCP Tool Execution to a Worker QueueBelow is a simplified example showing how an MCP gateway can push jobs to a Redis queue instead of executing the task directly.import Redis from "ioredis";import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";import { z } from "zod";const redis = new Redis();const server = new McpServer({ name: "mcp-gateway", version: "1.0.0"});server.tool( "generate_text", "Delegates generation to worker pool", { prompt: z.string() }, async ({ prompt }) => { const jobId = `job:${Date.now()}`; // push job to worker queue await redis.lpush("mcp_job_queue", JSON.stringify({ jobId, prompt })); // wait for worker result const result = await redis.blpop(`result:${jobId}`, 30); return { content: [ { type: "text", text: result ? result[1] : "Worker timeout" } ] }; });A worker process can then consume jobs from the queue and perform the heavy work without blocking the MCP server.import Redis from "ioredis";const redis = new Redis();async function startWorker() { while (true) { const job = await redis.brpop("mcp_job_queue", 0); const { jobId, prompt } = JSON.parse(job[1]); // simulate heavy processing (LLM inference, API calls, etc.) const output = `Processed prompt: ${prompt}`; await redis.lpush(`result:${jobId}`, output); }}startWorker();This approach ensures that the MCP server remains responsive even when tools require significant compute time. The gateway continues managing streaming sessions while workers handle the expensive operations.Over time, this separation also enables more advanced scaling strategies. Worker pools can be specialized for different workloads — for example, GPU workers for model inference or CPU workers for data processing — while the MCP gateway remains lightweight and stable.3. Streaming Backpressure Can Crash ServersStreaming responses are one of the most powerful features of MCP, especially for AI systems that generate incremental outputs.However, streaming introduces a less obvious problem: backpressure.If a client cannot consume messages as fast as the server produces them, the server’s memory usage can grow rapidly. In high-throughput systems, this can crash the entire service.This becomes particularly dangerous when tools stream token-level outputs from large language models.Production systems often mitigate this by:• batching streaming events • limiting output buffer sizes • applying rate limits to tool responsesWithout these safeguards, streaming can become a silent failure mode.4. Tool Schemas Drift Over TimeMCP relies heavily on tool descriptions and schemas so models can understand how to call them.But production systems evolve. APIs change. Parameters are renamed. Tool behavior shifts.If MCP tool definitions are not versioned properly, agents can start calling tools with outdated assumptions.The result is subtle failures where the model repeatedly generates invalid tool calls.One of the most effective strategies is schema versioning combined with compatibility layers that allow older agents to continue functioning while newer versions are introduced.5. Context Growth Becomes a Hidden CostMany MCP systems store conversation history or tool outputs to maintain context between requests.Initially this feels harmless.But over time, context storage can grow dramatically. In systems with thousands of active sessions, conversation history alone can consume significant memory or storage resources.Worse, large context payloads increase latency because they must be loaded before every tool execution.A common mitigation strategy is context compaction, where older conversation segments are summarized or pruned after a certain threshold.6. Tool Permissions Become a Security RiskAs MCP systems grow, the number of tools exposed to agents often increases.Some tools may trigger infrastructure workflows, modify databases, or access sensitive internal systems.Without a permission layer, agents effectively gain direct access to internal operations.This is why many production systems introduce a policy layer between agents and tools. Instead of executing tools directly, MCP servers validate whether a request is allowed before forwarding it to the underlying service.This approach is similar to API gateways in microservice architectures.7. Observability Is Usually an AfterthoughtWhen MCP systems fail, debugging them can be surprisingly difficult.Failures may occur across several layers:• the agent generating tool calls • the MCP server routing requests • the underlying service executing the taskWithout structured logging and tracing, identifying the root cause becomes extremely time consuming.Production MCP systems benefit greatly from observability pipelines that track:• tool invocation latency • streaming response durations • error rates per tool • session lifecycle metricsOnce these metrics exist, previously invisible reliability issues suddenly become measurable.These failure modes rarely appear in small demos, but they become unavoidable once MCP servers operate under real production load.Final ThoughtsThe Model Context Protocol is quickly becoming a foundational layer in the modern AI tooling stack. It provides a clean, standardized way for agents to interact with external systems.But the protocol itself does not solve the challenges of operating AI infrastructure at scale.Those challenges still require careful architectural decisions around state management, task execution, security, and observability.The teams that succeed with MCP in production are not necessarily the ones with the most sophisticated agents.They are the ones that treat MCP servers like distributed systems — and design them accordingly.MCP in Production: 7 Failure Modes Nobody Talks About was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.