Skip to main content
Compile your xmcp server for production deployment with platform-specific optimizations.

Usage

xmcp build [options]

Options

--vercel
boolean
Build for Vercel deployment. Generates the .vercel/output directory structure required by Vercel’s Build Output API.This option can also be triggered by setting the VERCEL environment variable to "1".
This flag is ignored when using the experimental adapter configuration.
--cf
boolean
Build for Cloudflare Workers deployment. Prepares artifacts optimized for Cloudflare Workers runtime.This option can also be triggered by setting the CF_PAGES environment variable to "1".

Examples

Standard production build:
xmcp build
Build for Vercel:
xmcp build --vercel
Build for Cloudflare Workers:
xmcp build --cf
Build for both platforms:
xmcp build --vercel --cf
Using environment variables:
VERCEL=1 xmcp build

How it works

The build command:
  1. Initializes the compiler context in production mode
  2. Compiles all source files with optimizations
  3. Generates platform-specific output when flags are set
  4. Creates deployment-ready artifacts

Vercel output

When building with --vercel, the command generates:
  • .vercel/output/config.json - Vercel configuration
  • .vercel/output/functions/ - Serverless functions
  • .vercel/output/static/ - Static assets

Cloudflare output

When building with --cf, the command generates:
  • Cloudflare Workers compatible bundle
  • Optimized for edge runtime execution
Platform flags can be combined in a single build command to prepare for multiple deployment targets.

dev

Start development mode

Deployment guides

Learn how to deploy your server

Build docs developers (and LLMs) love