Skip to main content
Generates a deployment shell that composes one or more apps and includes platform-specific infrastructure configuration (Docker, Vercel, Lambda, or Cloudflare).

Usage

Options

Generated Files

Generated Code

The entry point imports and composes all specified apps from their project folders:
src/main.ts

Nx Targets

The project is named server-<name>.

Build Output

nx build server-<name> runs frontmcp build --target <platform> with --out-dir servers/<name>/dist, and the generated deployment files point at what it writes:
The Docker build context is the workspace root, so build the image from there; Docker reads the ignore rules from Dockerfile.dockerignore next to the Dockerfile. The Dockerfile uses your workspace’s package manager: it installs from the lockfile (npm ci, yarn install --immutable or --frozen-lockfile for Yarn 1, pnpm install --frozen-lockfile, bun install --frozen-lockfile, after corepack enable or installing bun), runs nx build, prunes dev dependencies and copies the pruned node_modules into the runtime image. For Yarn Berry it sets YARN_NODE_LINKER=node-modules in the build stage, so a Plug’n’Play workspace still installs a node_modules folder for the image. The image gets Yarn from corepack, which installs Yarn 1 unless the workspace pins a version, so for a Yarn Berry workspace that pins none (no packageManager in the root package.json, no yarnPath in .yarnrc.yml) the generator adds "packageManager": "yarn@<version>" with the Yarn it runs under, or warns you to run yarn set version when it can’t tell which. The image sets FRONTMCP_BIND_ADDRESS=all, because the server binds 127.0.0.1 by default and a published port could not reach it, and has a HEALTHCHECK that asks /health, which the server answers whatever health.healthzPath says. It runs with NODE_ENV=production, so pass MCP_SESSION_SECRET when you start it. Generate the secret once and reuse it on every start and deploy: a new value ends every open session; docker-compose.yml refuses to start without it and publishes Redis (when selected) on loopback only. The image installs from the lock file, which must list the shell’s own package.json: the generator runs your install after it writes the shell. Up to 1.9.2 it did not, so the image stopped at npm ci with Missing: server-<name>@0.0.1 from lock file until you installed; the image had no HEALTHCHECK and the compose file passed no MCP_SESSION_SECRET.
nx deploy server-<name> builds, then runs vercel deploy --prebuilt --prod in the server folder, so Vercel deploys the .vercel/output tree the build wrote instead of building again. Link the folder to a Vercel project once with vercel link (or vercel pull). For Git-triggered builds on Vercel, set the project’s Root Directory to servers/<name>: vercel.json installs and builds from the workspace root with your package manager (cd ../../ && npm install, cd ../../ && npx nx build server-<name>). Those commands read files outside the Root Directory, so turn on Include source files outside of the Root Directory in the Build Step in the project’s settings (newer Vercel projects enable it by default). The build target lists .vercel/output in its outputs, so an Nx cache hit restores it too.
The generator adds @codegenie/serverless-express to the workspace: the generated handler wraps the server with it and frontmcp build --target lambda refuses to run without it. The build bundles it into handler.cjs, so the function needs no layer. template.yaml sets NODE_ENV: production and MCP_SESSION_SECRET from its McpSessionSecret parameter: generate it once (openssl rand -hex 32) and pass the same value on every deploy (sam deploy --parameter-overrides McpSessionSecret=<secret>, or parameter_overrides in samconfig.toml). Up to 1.9.2 it set neither and asked for a layer.

Example