Enable Claude with MCP-Enabled Cloudflare Worker for weather IP geolocation web search and custom HTTP requests
The MCP-Enabled Cloudflare Worker for Claude is a bespoke server implementing the Model Context Protocol (MCP), enabling Claude, one of the advanced AI applications, to interface with various external services and APIs seamlessly. MCP ensures a standardized approach that facilitates communication between AI models like Claude Desktop, Continue, Cursor, and other clients through a universal protocol. This document will guide you through setting up, configuring, and using this server for enhanced AI workflows.
The MCP-Enabled Cloudflare Worker for Claude provides the following functionalities:
These capabilities adhere to the MCP protocol standards, ensuring compatibility across various AI clients that support this protocol. The server is designed to be extensible; you can add new functions by writing custom code in TypeScript within the src/index.ts
file.
The architecture of the MCP-Enabled Cloudflare Worker for Claude follows the MCP core principles, enabling seamless integration with any client that adheres to this protocol. The worker is built using TypeScript and integrates existing APIs for weather data, IP geolocation, web search, and HTTP requests.
fetch
functionality of JavaScript.Each function is meticulously documented using JSDoc, ensuring that clients can understand and leverage this server's interface effectively. The workers-mcp framework handles the protocol-level communication, enabling seamless interactions between AI models and external data sources.
To install and configure the MCP-Enabled Cloudflare Worker for Claude, follow these steps:
Install Wrangler CLI:
npm install -g wrangler
Log in to Cloudflare:
wrangler login
Clone the Repository and Navigate Inside:
git clone https://github.com/anishgowda21/cf-mcp-server.git
cd cf-mcp-server
Install Dependencies:
npm install
Set Up MCP:
npx workers-mcp setup
Configure Environment Variables in the Cloudflare Dashboard or wrangler.toml
file:
OPENWEATHERMAP_API_KEY
IPINFO_API_KEY
GOOGLE_API_KEY
GOOGLE_CX
Deployment:
npm run deploy
Weather Data for Contextual Conversations
getWeatherData(cityName: string)
and pass the city name to fetch current weather details.Geolocation for Enhanced Security and Insights
getIpDetails(ipAddr: string)
to retrieve accurate location information.The MCP-Enabled Cloudflare Worker for Claude is designed to be fully compatible with a variety of AI clients, including:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
The performance and compatibility matrix for this server ensures optimal functioning across multiple clients:
To further customize or secure the worker, follow these steps:
src/index.ts
to add new functions and methods.src/index.ts
.npm run deploy
.GOOGLE_API_KEY
and GOOGLE_CX
environment variables.makeRequest(url: string, method: string, params?: object)
to send custom requests.src/index.ts
.MyWorker
class and document them using JSDoc.Contributions are highly welcome! To contribute, follow these steps:
git clone https://github.com/anishgowda21/cf-mcp-server.git
cd cf-mcp-server
src/index.ts
and README.md
.git commit -m "Your detailed description of the changes."
git push origin main
For more information on MCP, visit the official Model Context Protocol documentation or join relevant communities to engage with other developers.
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ✅ |
Cursor | ❌ | ✅ | ❌ |
{
"mcpServers": {
"weatherDataServer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-weather"],
"env": {
"OPENWEATHERMAP_API_KEY": "your-api-key"
}
},
"ipGeolocationServer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-ip"],
"env": {
"IPINFO_API_KEY": "your-api-key"
}
},
"webSearchServer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-websearch"],
"env": {
"GOOGLE_API_KEY": "your-api-key",
"GOOGLE_CX": "your-custom-search-engine-id"
}
},
"httpRequestServer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-http"],
"env": {}
}
}
}
This comprehensive documentation ensures a detailed understanding of how to set up, configure, and use the MCP-Enabled Cloudflare Worker for Claude effectively. By adhering to these instructions, developers can significantly enhance the functionality and interoperability of AI applications like Claude with external data sources and tools through MCP.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration