cloudflare-api-mcp
Lightweight MCP server to give your Cursor Agent access to the Cloudflare API
Overview
cloudflare-api-mcp is a lightweight Model Control Protocol (MCP) server that allows your Cursor Agent to access the Cloudflare API, enabling seamless interaction with Cloudflare services.
To use cloudflare-api-mcp, run the automated setup script to clone the worker and deploy it to your Cloudflare account. After setting up, upload your Cloudflare API key and email to your worker secrets, and add it to Cursor using the MCP server command.
- Interfaces with the Cloudflare REST API. - Provides tools for managing DNS records, purging cache, and listing zones. - Easy setup and deployment using Cloudflare Workers.
- Managing DNS records for websites hosted on Cloudflare.
- Automating cache purging for dynamic content.
- Listing and managing multiple zones in Cloudflare.
Add to your AI client
Use these steps to connect cloudflare-api-mcp in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"cloudflare-api-mcp-amxv": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-cloudflare-api-mcp-amxv"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"cloudflare-api-mcp-amxv": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-cloudflare-api-mcp-amxv"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"cloudflare-api-mcp-amxv": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-cloudflare-api-mcp-amxv"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"cloudflare-api-mcp-amxv": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-cloudflare-api-mcp-amxv"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"cloudflare-api-mcp-amxv": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-cloudflare-api-mcp-amxv"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"cloudflare-api-mcp-amxv": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-cloudflare-api-mcp-amxv"
]
}
}
}FAQ
Is cloudflare-api-mcp free to use?
Yes! cloudflare-api-mcp is free to use as it operates on Cloudflare Workers.
What programming language is used?
The project is developed in TypeScript.
How can I add new tools to the MCP server?
You can create new MCP tools by adding methods to the MyWorker class in the src/index.ts file.