Skip to main content
Build a compact Node artifact and run it behind a process manager / reverse proxy.

Build

npm run build
This compiles TypeScript to dist/ using tsconfig.build.json.

Start

NODE_ENV=production PORT=8080 npm start
  • 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

server {
  listen 443 ssl;
  server_name mcp.example.com;

  location /mcp/ {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto https;
    proxy_pass http://127.0.0.1:8080/mcp/;
  }
}

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.