Deploy to Cloudflare Workers
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:
- Generate an MCP server using Speakeasy
- Install the Wrangler CLI
- Have a Cloudflare account
Configuration
Enable Cloudflare Worker deployment by adding the following configuration to your .speakeasy/gen.yaml
file:
Configuration options
cloudflareEnabled
: Set totrue
to enable Cloudflare Worker deployment configurationcloudflareURL
: The URL where your MCP server will be deployed. This should match your Cloudflare Worker’s URL
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:
This creates an additional file in your generated SDK for the Cloudflare Worker.
Deployment process
1. Authenticate with Cloudflare
2. Deploy your MCP server
Navigate to your generated SDK directory and deploy:
3. Verify deployment
Your MCP server is now running at the URL specified in your cloudflareURL
configuration. You can test the deployment by accessing the URL via curl:
or in a browser window where the MCP Server configuration will appear.
Using the deployed server
Configure your MCP client to connect to the deployed Cloudflare Worker. Different clients use different configuration formats:
Claude Code
Use the Claude Code CLI to add your deployed MCP server:
Windsurf
Add the server configuration to your Windsurf MCP settings:
Cursor
Configure your MCP server in Cursor’s settings:
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
To update your deployed MCP server:
- Make changes to your OpenAPI specification
- Regenerate your SDK with
speakeasy run
- Redeploy with
npx wrangler deploy
Last updated on