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, mcpb

Building

PageCovers
Production buildfrontmcp 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

PageCovers
Node.js and DockerThe 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
VercelThe 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 LambdaThe lambda target: the handler it writes, what to deploy, NODE_ENV, the events it accepts, and sessions in Redis
Cloudflare WorkersThe 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/edgecreateEdgeMcp(): 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
BrowserA 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

PageCovers
RedisThe 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
SQLiteThe sqlite option: sessions, background tasks and pending questions in a SQLite file on one machine, with locking and encryption
High availabilitySeveral 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

PageCovers
Health checks and metricsWhat /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 transportThe 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 clientsClients 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 toRead
Pick a build target for your platformTargets
Build a Docker imageBuilding a Docker image
Run with Redis in Docker ComposeRunning with Redis in Docker Compose
Put nginx in front of the serverPutting nginx in front
Deploy to VercelDeploying a server
Deploy to AWS LambdaDeploying with SAM
Deploy to Cloudflare WorkersDeploying a Worker, or @frontmcp/edge without frontmcp build
Run a server inside a web pageRunning a server in the page
Keep sessions across a restart, on one machineKeeping sessions across restarts
Run behind a load balancerHigh availability, and storing sessions in Redis
Point Kubernetes probes at the serverPointing Kubernetes at the probes
Scrape metrics with PrometheusScraping metrics with Prometheus
Turn on HSTS and a Content Security PolicyTurning on HSTS and a CSP
Let a client start the server over stdioStarting the server over stdio
Ship the server as an MCP Bundle for desktop clientsInstalling from an MCP Bundle
Set the secrets production requiresSecrets
Fix a client that gets 404 at /mcp after deployingA client gets 404 at /mcp after deploying