home / mcp / workers mcp demo mcp server

Workers MCP Demo MCP Server

cloudflare workers MCP server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "akazwz-workers-mcp-demo": {
      "url": "https://your-worker-url.workers.dev"
    }
  }
}

MCP (Model Context Protocol) lets you connect AI assistants to data sources and tools so they can perform actions and fetch context during conversations. This server enables you to host custom MCP tools on Cloudflare Workers, making them accessible to Claude, Cursor, and other MCP clients for practical, real-time interactions.

How to use

After you configure your MCP server, you can use your tools directly from your AI assistant. For example, in Claude Desktop you can invoke a tool by typing a command like @workers-mcp-demo getRandomNumber to generate a random number, or use generateImage to create an image from a text prompt. Your helpers can be called from any MCP-enabled client, and the assistant will pass the request to your server to compute results and return them in the chat.

How to install

Prerequisites you need before starting:

  • Node.js 16 or higher
  • pnpm package manager
  • Cloudflare account
  • Wranger CLI
  • Claude Desktop, Cursor, or another MCP-compatible client

Concrete steps you will follow to set up and run the server.

Configuration and usage notes

Configure your Cloudflare Worker, enable MCP, and deploy. If you are using the free Cloudflare plan, remove the browser rendering binding from the configuration to avoid limitations. This does not affect most core functions, only screenshotURL and extractImagesFromURL.

To integrate the MCP server with clients like Claude Desktop or Cursor, use the commands shown in the setup steps. You’ll configure the client to point at your worker URL and provide the path to your local MCP tooling when appropriate.

Troubleshooting

  • If your AI assistant cannot see your tools, restart the assistant.
  • If you rename a method or change parameters, restart the assistant to apply changes.
  • Check Cloudflare Workers logs for deployment errors.
  • If you see an error about the Browser Rendering API on a free plan, follow the free account notes above.

Available tools

getRandomNumber

Generates a random number for use in demos, tests, or simple simulations.

generateImage

Creates an image based on a text prompt, useful for visual content generation.

screenshotURL

Takes a screenshot of a specified URL. Requires a paid Cloudflare account.

extractImagesFromURL

Extracts all images from a given webpage. Requires a paid Cloudflare account.