MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

C
Cloudflare MCP Server

A modular MCP (Model Communication Platform) server deployed on Cloudflare Workers, providing tools like weather and forecast APIs for AI models and other clients.

Created 11/3/2025
Updated about 1 month ago
Repository documentation and setup instructions

Cloudflare MCP Server

A modular MCP (Model Communication Platform) server deployed on Cloudflare Workers, providing tools like current weather and 5-day weather forecast APIs for AI models or other clients.


Features

  • Modular tools architecture – easily add new tools for different APIs.
  • Get current weather – fetch current weather for any city.
  • Get 5-day forecast – fetch 5-day weather forecast for any city.
  • Serverless & globally accessible – deployed on Cloudflare Workers with no infrastructure to maintain.
  • JSON interface – send POST requests with tool and input, receive structured JSON responses.

Project Structure

cloudflare-mcp/
│
├─ src/
│   └─ index.ts           # main MCP Server
│
├─ test/                  # optional tests
├─ package.json
├─ package-lock.json
├─ tsconfig.json
├─ vitest.config.mts
├─ README.md
├─ .gitignore

Note: Files like .env, .dev.vars, and wrangler.toml containing API keys should not be included in public repo.


Getting Started

Prerequisites

Install dependencies

npm install

Set up environment variables

Create a .dev.vars or .env file locally:

OPENWEATHER_API_KEY=your_openweathermap_api_key

Running Locally

Start the local development server:

wrangler dev

Example POST request:

curl -X POST http://127.0.0.1:8787 \
  -H "Content-Type: application/json" \
  -d '{"tool":"getWeather","input":{"city":"Warsaw"}}'

Deploying to Cloudflare

wrangler deploy

Your MCP Server will be accessible via the provided workers.dev URL.


Usage

Get current weather

POST request:

{
  "tool": "getWeather",
  "input": { "city": "Warsaw" }
}

Response:

{
  "city": "Warsaw",
  "temp": 10.47,
  "description": "broken clouds"
}

Get 5-day forecast

POST request:

{
  "tool": "getForecast",
  "input": { "city": "Warsaw" }
}

Response:

{
  "city": "Warsaw",
  "forecast": [
    {"date":"2025-11-03 12:00:00","temp":10.5,"description":"broken clouds"},
    {"date":"2025-11-04 12:00:00","temp":9.8,"description":"light rain"},
    ...
  ]
}

License

MIT License

Quick Setup
Installation guide for this server

Install Package (if required)

npx @modelcontextprotocol/server-cloudflare-mcp-server

Cursor configuration (mcp.json)

{ "mcpServers": { "takzen-cloudflare-mcp-server": { "command": "npx", "args": [ "takzen-cloudflare-mcp-server" ] } } }