In this section, you'll learn how to deploy your MCP server to Cloudflare Workers. To deploy your MCP server, run the following command:
# Deploy to Cloudflare Workers
npm run deployThis command will:
- Build your TypeScript code
- Bundle dependencies
- Upload to Cloudflare Workers
- Configure Durable Objects
- Provide you with a deployment URL
⛅️ wrangler 3.x.x
-------------------
Total Upload: 150.23 KiB / gzip: 35.67 KiB
Uploaded your-mcp-server-name (2.34 sec)
Published your-mcp-server-name (6.78 sec)
https://your-mcp-server-name.your-subdomain.workers.dev
Current Deployment ID: abc123def456# Test the deployment URL
curl https://your-mcp-server-name.your-subdomain.workers.devIf your MCP server requires API keys or configuration:
# Set environment variables
wrangler secret put API_KEY
wrangler secret put DATABASE_URL