Skip to main content
Build a compact Node artifact and run it behind a process manager / reverse proxy.
Looking to deploy to serverless platforms like Vercel, AWS Lambda, or Cloudflare Workers? See the Serverless Deployment guide.

Build

This runs frontmcp build, which compiles TypeScript using your project’s tsconfig.json (the CLI passes --project tsconfig.json when present, otherwise falls back to inline tsc flags) and writes each target to dist/<target>/ — dist/node/ for the default node target. A deployment’s outDir in frontmcp.config replaces that directory.

Start

frontmcp create and frontmcp init don’t add a start script by default — run the compiled bundle directly. The default node target emits a CommonJS single-file bundle at dist/node/{name}.bundle.js, where {name} is the name in frontmcp.config (or, without a config file, your package.json name with any scope removed):
Run this way, the bundle applies what the generated dist/node/<name> runner script does: it serves MCP at transport.http.path from frontmcp.config (unless FRONTMCP_HTTP_ENTRY_PATH is set) and --stdio serves over stdin/stdout instead of HTTP. The generated Dockerfile’s CMD ["node", "dist/node/<name>.bundle.js"] relies on this. If you prefer a script, add one to package.json:
  • Use a process manager (PM2, systemd) for restarts and logs.
  • Put a reverse proxy (NGINX, Traefik, Caddy) in front for TLS and path routing.
  • Pin matching versions of all @frontmcp/* packages.

Example NGINX snippet

Troubleshooting

  • Version mismatch at boot → align all @frontmcp/* versions and reinstall.
  • No decorators working → ensure experimentalDecorators + emitDecoratorMetadata and import 'reflect-metadata' at the top of main.ts.
  • Port conflicts → set http.port in @FrontMcp or use PORT env.