Deploying FrontMCP servers
This section takes a server from your machine to somewhere clients can reach it. frontmcp build turns one @FrontMcp entry file into what a platform runs: a Node process, on a machine or in Docker; a function for Vercel or AWS Lambda; or a Cloudflare Worker. @frontmcp/edge runs a server on Workers without that build step. The rest of the section covers where the server keeps its state between requests, running several instances behind a load balancer, the health checks and metrics an orchestrator reads, what FrontMCP does at the HTTP layer, and how MCP clients connect. It's for whoever ships and runs a server. Start with Production build; Deploying Your Server takes one server from frontmcp build to a connected client, step by step.
frontmcp build --target node # or distributed, vercel, lambda, cloudflare, sdk, browser, cli, mcpbBuilding
| Page | Covers |
|---|---|
| Production build | frontmcp build and its targets: what each one writes, what it bundles and what it leaves in node_modules, how the result runs, which endpoint path it serves, and when it's in production mode |
Where it runs
| Page | Covers |
|---|---|
| Node.js and Docker | The node build on a machine, in a Docker image, with Redis in Docker Compose, behind nginx, or on a Unix socket: what it needs, the environment it reads, and how it stops |
| Vercel | The vercel target: the files it writes, the vercel.json it makes, what the function serves, when it runs in production, and sessions in Vercel KV or Upstash |
| AWS Lambda | The lambda target: the handler it writes, what to deploy, NODE_ENV, the events it accepts, and sessions in Redis |
| Cloudflare Workers | The cloudflare target: the entry and wrangler.toml it writes, secrets and bindings, when the Worker is in production, and the storage it takes and refuses |
| @frontmcp/edge | createEdgeMcp(): a server on Cloudflare Workers from a plain configuration, bundled by wrangler with no frontmcp build, with sessions in a Durable Object and a managed mode |
| Browser | A server inside a web page or a Web Worker: the SDK's browser build, the entry points that never listen, what needs Node, keys in IndexedDB or localStorage, and calling a model from the page |
State and several instances
| Page | Covers |
|---|---|
| Redis | The redis option: what FrontMCP keeps in Redis and under which keys, how long sessions last, what doesn't use it, and what happens when Redis can't be reached |
| SQLite | The sqlite option: sessions, background tasks and pending questions in a SQLite file on one machine, with locking and encryption |
| High availability | Several instances behind a load balancer: what they must share, how an older client's session moves between them through Redis, machine ids, and distributed mode |
Running it in production
| Page | Covers |
|---|---|
| Health checks and metrics | What /healthz, /readyz and /metrics answer on each runtime, and how to point container health checks, Kubernetes probes, load balancers and Prometheus at them |
| Security headers and transport | The security headers FrontMCP sends and how to turn on HSTS and a CSP, bind address and host checks, body size limits, the endpoints the Node server exposes, and the startup audit |
| Connecting MCP clients | Clients that connect by URL over Streamable HTTP, start the server over stdio, or use a Unix socket; client snippets from the CLI; and MCP Bundles |
Which page for which task
| You want to | Read |
|---|---|
| Pick a build target for your platform | Targets |
| Build a Docker image | Building a Docker image |
| Run with Redis in Docker Compose | Running with Redis in Docker Compose |
| Put nginx in front of the server | Putting nginx in front |
| Deploy to Vercel | Deploying a server |
| Deploy to AWS Lambda | Deploying with SAM |
| Deploy to Cloudflare Workers | Deploying a Worker, or @frontmcp/edge without frontmcp build |
| Run a server inside a web page | Running a server in the page |
| Keep sessions across a restart, on one machine | Keeping sessions across restarts |
| Run behind a load balancer | High availability, and storing sessions in Redis |
| Point Kubernetes probes at the server | Pointing Kubernetes at the probes |
| Scrape metrics with Prometheus | Scraping metrics with Prometheus |
| Turn on HSTS and a Content Security Policy | Turning on HSTS and a CSP |
| Let a client start the server over stdio | Starting the server over stdio |
| Ship the server as an MCP Bundle for desktop clients | Installing from an MCP Bundle |
| Set the secrets production requires | Secrets |
Fix a client that gets 404 at /mcp after deploying | A client gets 404 at /mcp after deploying |
Related pages
- Auth in production: secrets, the public address and token checks for an authenticated server.
- Observability and telemetry: every option of
health,metricsand tracing. - Configuration files: every environment variable FrontMCP reads.
createFetchHandler()andFrontMcpInstance: the entry points the build targets run.- frontmcp CLI and Nx executors: the commands that build, start and deploy.
- Learn: Deploying Your Server and Running Several Instances.