Speakeasy Logo
Skip to Content

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:

Configuration

Enable Cloudflare Worker deployment by adding the following configuration to your .speakeasy/gen.yaml file:

Configuration options

  • cloudflareEnabled: Set to true to enable Cloudflare Worker deployment configuration
  • cloudflareURL: The URL where your MCP server will be deployed. This should match your Cloudflare Worker’s URL

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:

Updating your deployment

To update your deployed MCP server:

  1. Make changes to your OpenAPI specification
  2. Regenerate your SDK with speakeasy run
  3. Redeploy with npx wrangler deploy

Last updated on