MCP: secure stateless scaling for enterprise AI
Developer

MCP: secure stateless scaling for enterprise AI

Enterprise teams can use gateways, tenant-aware authorization and stateless servers to scale MCP while protecting corporate data boundaries.

Key insights

  • Stateless MCP servers let a load balancer send requests to any available instance.
  • A gateway can validate tokens, apply tenant policy, route requests and rate-limit clients.
  • Bind explicit handles to the caller and tenant, then verify that binding on every call.
  • Reject tokens not issued for the resource, and do not pass a client token through to an upstream API.
  • Network isolation adds a boundary beyond identity; the Azure design keeps MCP servers off public endpoints.

Stateless MCP servers and a security gateway can help enterprise teams scale AI tool access without tying each client to one server instance. This approach matters to architects, developers and security teams responsible for production AI systems, especially where multiple tenants or sensitive data are involved. Microsoft Events demonstrates enterprise MCP security and scaling patterns in a Microsoft Ignite session.

What's new

The central design shift is from session-bound MCP servers to stateless request handling. In a stateful setup, a client may need to return to the instance that holds its session, requiring sticky routing or a shared session store. In the stateless pattern described in the session, any server instance can handle a request, so a load balancer can distribute traffic across the pool.

Requests carry context such as protocol version, client capabilities and client information. The session also describes using the and headers for routing, with cache hints for tool lists. The practical aim is to make scaling and rolling changes easier without requiring clients to re-establish a server-side session.

Statelessness does not mean trust can be assumed. A gateway remains a control point between agent hosts and MCP servers: it can validate tokens, authorize and route requests, apply rate limits, and log activity. The MCP server then reaches the relevant backend, while shared application state belongs in the backend rather than in the MCP server instance.

Who it is for and what you need

This architecture is aimed at organizations moving MCP integrations from development into production, particularly teams operating shared AI hubs or supporting multiple customers and tenants. It is relevant to platform architects and developers building the service path, as well as security and governance teams that need visibility into access attempts.

The starting point is an MCP client or agent, an MCP server pool and a gateway or load balancer. For multi-tenant use, the design must also resolve the tenant from validated identity claims and enforce the relevant policy before routing to tools or data. The session recommends least privilege rather than broad access and frames security as an ongoing operational responsibility, not a one-time deployment step.

The demonstrated architecture uses Azure components, including API Management and an Azure Virtual Network, but the session describes MCP as an open standard that can span different cloud environments. Its core routing and identity principles are not limited to one MCP server implementation.

How it works

  1. Validate the request at the gateway. Authenticate the caller and check that the token is intended for the resource receiving it. Resolve the tenant from validated claims before applying tenant-specific policy.
  2. Authorize and route. Use the request method and tool name to determine whether the caller can invoke the requested capability. Apply rate limits per client, then send the request to an available server instance.
  3. Keep state explicit. Where a tool needs to refer to an object created in an earlier call, return an identifier and require the client to pass it back as an ordinary argument. Treat that identifier as untrusted input: bind it to the caller and tenant, and check the binding on every request.
  4. Validate each leg of the call. Do not treat a successful inbound request as proof that a response or downstream call is trustworthy. The session cautions against forwarding a client token to an upstream API; validate credentials at each boundary.
  5. Monitor and contain. Log denied requests and relevant payload details for investigation, rather than silently dropping every failure. Apply network controls as well as identity checks, and route outbound calls through controlled egress where appropriate.

For multi-tenant deployments, the gateway is the point where identity, tenant context and routing meet. A request for one tenant should reach only that tenant’s tools and data. A token with the wrong audience should be rejected, and an identifier from one tenant should not work when replayed in another tenant’s context.

Limitations and alternatives

Stateless servers simplify horizontal scaling, but they do not remove the need to protect application state. Explicit identifiers can be replayed, guessed or substituted, so authorization must be checked whenever a handle is used. Likewise, round-robin routing is safe only when any instance can handle the request and the relevant shared state is held outside that instance.

Identity controls are only one part of the boundary. The Azure reference design keeps MCP servers off public endpoints and places access behind private networking and a gateway; it also describes controlling outbound traffic. Teams should consider how they will enforce tenant separation, record rejected attempts, limit access duration and escalate higher-risk activity to a person.

Organizations with only one tenant have a simpler routing problem, but still need authentication, least privilege and monitoring. For teams moving from stateful servers, the previous approach relies on sticky sessions or a shared session store; the stateless pattern instead makes requests independently routable. The session presents this as a security and architecture journey, not a reason to halt existing production systems immediately.

Sources

Frequently asked questions

How does stateless MCP help with scaling?

Any MCP server instance can handle an eligible request, allowing a load balancer to distribute traffic without sticky sessions. Shared state belongs outside the MCP server instance.

How should an MCP gateway handle multiple tenants?

Validate the token, resolve the tenant from validated claims, apply tenant policy and then route the request. Bind explicit handles to both caller and tenant and verify them on every call.

Should MCP servers be publicly accessible?

The Azure reference architecture keeps MCP servers off public endpoints and uses private networking and a gateway to control access.

Can an MCP gateway forward a client token to an upstream API?

The described pattern says not to pass a client token through to an upstream API. Validate requests at each boundary instead.