Skip to main content
xmcp provides multiple deployment options to suit your infrastructure needs. The framework includes built-in build commands and platform-specific optimizations for seamless deployment.

Deployment Options

xmcp supports three primary deployment strategies:

Vercel

Zero-config deployment to Vercel’s serverless platform

Cloudflare Workers

Edge deployment with Cloudflare Workers

Self-Hosting

Deploy to your own infrastructure with Docker or Node.js

Build Command

The xmcp build command compiles your server for production:
xmcp build
This command:
  • Compiles TypeScript to JavaScript
  • Bundles all dependencies
  • Generates optimized output in dist/
  • Creates both HTTP (dist/http.js) and stdio (dist/stdio.js) entry points

Output Structure

After running xmcp build, you’ll find:
dist/
├── http.js       # HTTP transport server
├── stdio.js      # stdio transport server
├── index.js      # Main server logic
└── ...           # Additional bundled modules

Platform-Specific Builds

xmcp provides platform-specific build flags for optimized deployment:

Vercel

xmcp build --vercel
Creates a .vercel/output directory with Vercel’s Build Output API structure.
The --vercel flag is automatically detected when VERCEL=1 environment variable is set.

Cloudflare Workers

xmcp build --cf
Generates a worker.js file bundled for Cloudflare Workers runtime.
The --cf flag is automatically detected when CF_PAGES=1 environment variable is set.

Environment Detection

xmcp automatically detects the deployment platform using environment variables:
PlatformEnvironment VariableAuto-detected
VercelVERCEL=1Yes
CloudflareCF_PAGES=1Yes
Self-hostedNoneDefault
This means you don’t need to specify build flags in your CI/CD pipelines—xmcp will automatically use the correct build configuration.

Running in Production

After building, run your server:

HTTP Transport

node dist/http.js

stdio Transport

node dist/stdio.js

Custom Port

Set the PORT environment variable (defaults to 3001):
PORT=8080 node dist/http.js

Next Steps

Deploy to Vercel

Learn about zero-config Vercel deployment

Deploy to Cloudflare

Deploy to the edge with Cloudflare Workers

Self-Host

Run on your own infrastructure

Configuration

Configure your xmcp server

Build docs developers (and LLMs) love