Remote MCP Server Hosting: Serverless or Containers?

Direct answer: For most teams, remote MCP server hosting should start on serverless containers such as ECS Fargate, not on plain functions. Containers handle long-lived sessions and streaming better, keep startup predictable, and let you enforce auth and per-team scoping in one place. Pure functions are fine for one team with short, stateless tools. Move to always-on or orchestrated containers only when many teams share the server and traffic is steady.
Last updated: November 2026
Key Takeaways
- AWS's own serverless MCP server runs on ECS Fargate, which shows that 'serverless' for MCP usually means serverless containers rather than functions.
- Keep MCP server tasks stateless and store session state in a database, as AWS does with DynamoDB, so tasks can be replaced or scaled without losing conversations.
- Enforce access control at the MCP server layer, not inside each agent, so there is one audit point for every data access decision.
- Cost differences between hosting options matter far less at one team than at fifty, so choose for access control and operability first.
- Per-team scoping is a configuration problem: map each team or context to the datasets and tools it may touch, and deny everything else by default.
Why remote MCP server hosting is a decision now
Remote MCP server hosting has moved from a side question to a real architecture choice. On November 6, 2026, AWS published a walkthrough of a serverless MCP server on Amazon ECS Fargate that gives AI agents access to an enterprise data lake. Two days later, The New Stack ran a piece titled Scaling an autonomous agent from one team to fifty: A serverless-to-container decision framework.
We could only read the headline of the second piece, so we will not speak for it. But the pairing tells you what founders are running into: the prototype that ran on a laptop now needs a home, and that home decides how you handle sessions, security and cost when more teams show up.
This article is about that decision. If you want the broader case for building an MCP layer at all, see our page on custom MCP servers. Here we focus on hosting and access control.
What did AWS actually build, and what does it teach us?
AWS describes a centralized, agent-agnostic gateway between AI agents and a data lake, built by the team supporting Amazon’s North America Sort Center network. According to AWS, the problem was familiar: every team had wired its own agent to the data, each agent reimplemented access control, and onboarding a new table typically took days of custom code and redeployment.
The fix was an MCP server built with FastMCP, a Python framework, running on ECS Fargate. Three details are worth copying:
- Configuration over code. Exposing a new dataset needs only a JSON metadata file, which the server discovers on the next pipeline sync.
- Stateless tasks. AWS says Fargate tasks are stateless and conversation state lives in DynamoDB, so tasks can be replaced or scaled without data loss.
- Permissions at the server. Access control is enforced at the MCP server layer, giving one place to audit access decisions.
Notice what is missing: no per-agent database credentials and no access logic scattered across clients. That is the real value of a hosted MCP layer, and it matters more than which compute service you pick.
Is serverless the same as Lambda for an MCP server?
No. Fargate is serverless in the sense that you do not manage servers, but you still ship a container that runs as a long-lived process behind a load balancer. That is closer to a normal web service than to a function that wakes up per request.
This distinction clears up most of the confusion. The real choice is between three shapes:
- Functions (for example Lambda): per-request execution, scale to zero, strict time limits.
- Serverless containers (for example Fargate): you define the container, the platform runs and scales it, no servers to patch.
- Always-on orchestrated containers (Kubernetes or a fixed container fleet): maximum control, maximum operational load.
We cover when functions are the right call for agents in Serverless AI Agent on AWS. For an MCP server specifically, the middle option wins more often than people expect.
How much do cold starts matter for an MCP server?
Less than you fear in most cases, and more than you expect in a few. A cold start is the delay when a platform has to create a fresh runtime before it can answer. Agents call MCP tools in the middle of a reasoning loop, so a slow first call stalls the whole answer.
Context matters, though. AWS reports end-to-end interaction latency in the 15 to 20 second range for its system, with query scoping helping keep it there. When the model call and the query dominate the wait, an extra second of startup is noise. When your tools are fast lookups and the user expects a snappy reply, cold starts become the visible part of the delay.
A practical rule: if your tool calls finish in under a second and the agent is user-facing, avoid scale-to-zero on the MCP server or keep warm capacity. If the workload is batch or internal and slow anyway, scale-to-zero is fine.
What about long-lived sessions and streaming?
This is where functions struggle. Remote MCP clients may hold connections open, stream partial results and resume conversations. Function platforms impose execution time limits and make long-held connections awkward or expensive, while a container simply keeps the connection open.
The safest design is the one AWS uses: keep the process stateless and push session history to a store such as DynamoDB or Redis. Then a task can die, a deploy can roll, and the next request still finds its context. You get the benefits of containers without trapping state in memory.
Do not store anything in task memory that you cannot afford to lose. That single rule makes autoscaling, rolling deploys and failure recovery boring, which is exactly what you want.
How should auth and per-team access scoping work?
Authenticate at the edge, authorize inside the MCP server, and scope by team through configuration. In the AWS design, traffic passes an HTTPS load balancer with AWS WAF, and Amazon Cognito handles JSON Web Token authentication before requests reach private subnets. A context mapping then narrows each query to only the relevant tables.
For your own build, apply the same layers:
- Identity at the edge. Use your existing identity provider and issue short-lived tokens. Do not hand agents static API keys to company data.
- Team claims in the token. Carry team or role in the token so the server can decide without extra lookups.
- Tool and dataset allowlists per team. Store the mapping in config, not code. Default to deny.
- Read-only by default. Give write tools separate scopes and, where it matters, human approval.
- One audit log. Log who, which team, which tool and which data, in the MCP layer.
Scoping also improves quality, not just security. AWS notes that narrowing the search to specific tables reduces noise and improves SQL generation accuracy. Fewer visible tools means fewer wrong tool choices by the model.
What does remote MCP server hosting cost at 1 team vs 50 teams?
We will not quote prices, because they vary by region, traffic and provider, and none of the sources give figures. What we can describe is the shape of the cost.
At one team, compute is a rounding error next to model usage and engineering time. A function that scales to zero might cost a few dollars a month, and a small always-on container might cost a bit more. Either is fine. Choose whichever your team can operate without thinking.
At fifty teams, three things change. Steady traffic makes always-on capacity cheaper per request than per-invocation pricing. Shared infrastructure such as load balancers, logging and the session store becomes a fixed base you spread across teams. And the largest cost becomes people: each new team needs scoping, onboarding and support. That is why AWS’s metadata-driven onboarding matters more than any instance price.
The model bill will usually outgrow the hosting bill. Spend your optimization effort on tool design and context size before you shave compute.
Which hosting option should you choose?
For most teams, start with serverless containers and keep the server stateless. Use this table as a first pass.
| Situation | Functions | Serverless containers | Orchestrated containers |
|---|---|---|---|
| One team, short stateless tools | Good fit | Fine | Overkill |
| Streaming or long-lived sessions | Awkward | Good fit | Good fit |
| Latency-sensitive, user-facing agent | Needs warm capacity | Good fit | Good fit |
| Several teams, shared data access | Workable, harder to govern | Good fit | Good fit |
| Fifty teams, steady traffic | Cost and limits bite | Good fit | Best control, highest ops load |
| No platform engineers on staff | Good fit | Good fit | Avoid |
The pattern: functions win on simplicity at the smallest scale, orchestrated containers win only when you have the people to run them, and serverless containers cover the wide middle.
What should you do this month?
- List every dataset and tool the agent touches, and mark each as read or write.
- Decide your identity source and what team claim the token will carry.
- Build the MCP server stateless, with sessions in an external store.
- Define team scopes in configuration with default deny, and test that a team cannot see another team’s data.
- Add one audit log and a basic latency and error dashboard before onboarding a second team.
- Run the server on serverless containers, then revisit the choice when traffic is steady or teams multiply.
Hosting is only one item on the path from demo to production. Our production-ready checklist covers the rest, including evaluation, fallbacks and monitoring. If your server will sit in front of internal systems you already run, a well-designed backend API underneath makes every MCP tool simpler and safer.
Frequently Asked Questions
Should I host an MCP server on Lambda or containers?
Use Lambda if you have one team, short stateless tools and no need for streaming. Choose serverless containers such as ECS Fargate if you expect long-lived sessions, steady traffic or several teams sharing the server. Most production setups end up on containers.
Do remote MCP servers need to be stateless?
They should be. Keep the process stateless and store session history in an external database, as AWS does with DynamoDB in its Fargate design. That lets you replace or scale tasks without losing conversations.
How do I give different teams different access through one MCP server?
Carry a team or role claim in the authentication token, then map each team to the tools and datasets it may use in configuration. Deny everything not listed and log every call in the MCP layer. This gives you one place to audit and change access.
Is cold start a problem for MCP servers?
It depends on the workload. If tools answer in under a second and a user is waiting, cold starts are noticeable, so keep warm capacity. If model calls and queries already take many seconds, startup delay matters much less.
Does it cost more to host an MCP server for 50 teams than for one?
Compute grows modestly, but the bigger change is shared infrastructure and onboarding effort. Steady traffic from many teams usually favors always-on containers over per-invocation pricing. Model usage typically becomes the largest line item.
Sources
- Serverless MCP server for AI agent data lake access on Amazon ECS Fargate — Amazon Web Services (AWS), November 6, 2026
- Scaling an autonomous agent from one team to fifty: A serverless-to-container decision framework — The New Stack, November 8, 2026
If you have an agent prototype and need a hosted MCP layer with real auth, per-team scoping and a sensible hosting choice, that is the work we do. Our AI agent development services cover architecture, build and production hardening, so your agent reaches company data safely.
About the author
Ready to start? See our AI Agent Development Services, get in touch, or order on Fiverr.