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
Thexmcp build command compiles your server for production:
- 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 runningxmcp build, you’ll find:
Platform-Specific Builds
xmcp provides platform-specific build flags for optimized deployment:Vercel
.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
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:| Platform | Environment Variable | Auto-detected |
|---|---|---|
| Vercel | VERCEL=1 | Yes |
| Cloudflare | CF_PAGES=1 | Yes |
| Self-hosted | None | Default |
Running in Production
After building, run your server:HTTP Transport
stdio Transport
Custom Port
Set thePORT environment variable (defaults to 3001):
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