How to Deploy an MCP Server to Production (Vercel, Lambda, Railway)
A practical comparison of the main MCP server deployment targets — Vercel, AWS Lambda, Railway, and ECS — with the tradeoffs for each and how xmcp simplifies the Vercel path.
Getting an MCP server to production requires a different mental model than deploying a REST API. MCP connections can be long-lived, cold starts affect perceived latency, and the Streamable HTTP transport has specific requirements for serverless environments.
Here's a practical comparison of the main options.
Deployment options at a glance
| Target | Operational model | What to verify |
|---|---|---|
| Vercel | Managed functions | Plan-specific duration limits and environment variables |
| AWS Lambda | Functions behind an HTTP endpoint | Gateway timeout, streaming, and IAM configuration |
| Railway | Hosted service | Public HTTP networking, restarts, and resource limits |
| AWS ECS | Managed containers | Load balancer settings, task sizing, and service lifecycle |
Measure cold starts and tool latency with your own workload. A warm container can still restart, and all HTTP deployments have infrastructure limits.
Vercel — the zero-config path
Vercel with Fluid compute is the simplest deployment for TypeScript MCP servers. Check the current Vercel function limits for your plan and configure duration for your longest supported operation.
If you're using xmcp, deployment is a single command:
xmcp generates the correct route structure and configures Streamable HTTP automatically. There's no vercel.json to write, no function configuration to set. See the zero-config Vercel guide for the full walkthrough.
Choose Vercel when: you want to ship fast, you're on TypeScript, and zero infrastructure management is a priority.
AWS Lambda — serverless with more control
A Lambda deployment needs an HTTP entrypoint compatible with the MCP transport. Validate the gateway's request duration, response streaming, headers, and body handling against your clients. Gateway limits and function limits are separate; do not assume an arbitrary timeout can be enabled. See API Gateway quotas.
Choose Lambda when: you're already on AWS, you need VPC integration for private resources, or you're connecting to Bedrock-based AI workloads.
Railway — always-on containers
Railway can run the built HTTP server as a service. Follow the Railway deployment guide, set environment variables, and expose the HTTP port. Test behavior during restarts and deploys, and consult your plan's limits before relying on long-running requests.
Choose Railway when: you prefer a managed service process and want to control its runtime and resources.
AWS ECS — full control
ECS on Fargate gives you long-lived containers with warm caches, persistent streaming connections, and the ability to run any language and runtime. It's the right choice when you need sidecars, custom networking, or workloads that the other options can't support.
The cost is significant infrastructure overhead — VPCs, task definitions, load balancers, service discovery. Only worth it if you have AWS infrastructure expertise on the team and a workload that genuinely requires it.
Choose ECS when: you have complex networking requirements, existing ECS infrastructure, or workloads that need more than the other options support.
The transport question
HTTP-based deployments (Vercel, Lambda) require Streamable HTTP transport. STDIO transport, where the client spawns the server as a child process, requires the client to launch or otherwise manage a local process. Deploying a STDIO executable in a remote container does not make it accessible to remote MCP clients; expose an HTTP transport or an explicit bridge.
If you're building a server for remote AI clients (not local Claude Desktop), you need Streamable HTTP. xmcp enables it with a single config line:
Next steps
- Vercel Zero-Config Deployment — the full xmcp + Vercel walkthrough.
- MCP Server Transports Explained — STDIO vs Streamable HTTP in depth.
- MCP Server Authentication — secure your deployed server with OAuth.
