Deploy your MCP server to Cloudflare Workers for global edge distribution and zero-ops scaling using Speakeasy’s built-in Cloudflare deployment configuration.
Prerequisites
Before deploying to Cloudflare Workers, you need to do the following:
cloudflareEnabled: Set to true to enable Cloudflare Worker deployment configuration.
cloudflareURL: This is the URL where your MCP server will be deployed. It should match the URL of your Cloudflare Worker.
The cloudflareURL determines the endpoint where your MCP server will be
accessible after deployment. Make sure this matches your intended Worker
domain.
Generating the deployment
After configuring your gen.yaml file, regenerate your SDK to include Cloudflare Worker deployment files:
speakeasy run
This creates an additional file in your generated SDK for the Cloudflare Worker.
Deployment process
Use the following steps to deploy your MCP server on a Cloudflare worker.
Authenticate with Cloudflare:
npx wrangler login
Navigate to your generated SDK directory and deploy your MCP server:
npx wrangler deploy
Verify that your MCP server is running at the URL specified in your cloudflareURL configuration by accessing it via curl:
Note the different endpoint paths: Claude Code and Windsurf use /sse for
server-sent events, while Cursor uses /mcp for the standard MCP protocol
endpoint.
Updating your deployment
You can update your deployed MCP server as follows: