Cloudflare Backup MCP server

Automates backing up Cloudflare configurations to GitHub repositories, enabling version control and disaster recovery for DNS, Workers, and security settings.
Back to servers
Setup instructions
Provider
Dynamic Endpoints
Release date
Dec 24, 2024
Language
TypeScript

The Cloudflare to GitHub Backup MCP server helps you automatically back up your Cloudflare projects to a GitHub repository. This tool serves as a bridge between your Cloudflare account and GitHub, ensuring your projects are safely stored and versioned.

Prerequisites

Before installation, ensure you have:

  • Node.js and npm installed
  • A Cloudflare account with an API token (with read access to projects)
  • A GitHub account with a personal access token (with "repo" scope)
  • A GitHub repository for storing the backups

Installation Options

Using Smithery

The easiest way to install is through Smithery:

npx -y @smithery/cli install @DynamicEndpoints/cloudflare-github-backup-mcp --client claude

Manual Installation

For manual installation:

git clone <repository_url>
cd cloudflare-github-backup
npm install
npm run build

Setting Up Access Tokens

Cloudflare API Token

  1. Go to your Cloudflare dashboard
  2. Navigate to "My Profile" → "API Tokens"
  3. Click "Create Token"
  4. Set permissions for reading your projects
  5. Copy the generated token

GitHub Personal Access Token

  1. Go to your GitHub settings
  2. Navigate to "Developer settings" → "Personal access tokens"
  3. Click "Generate new token"
  4. Select the "repo" scope
  5. Copy the generated token

Configuration

Edit the cline_mcp_settings.json file:

{
  "mcpServers": {
    "cloudflare-backup": {
      "command": "node",
      "args": ["/path/to/cloudflare-github-backup/build/index.js"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your_cloudflare_api_token",
        "GITHUB_ACCESS_TOKEN": "your_github_access_token",
        "GITHUB_REPO_NAME": "your_github_repo_name"
      }
    }
  }
}

Make sure to:

  • Replace /path/to/cloudflare-github-backup with the actual path where you installed the tool
  • Add your actual API tokens and GitHub repository name

Using the Backup Tool

  1. Start the MCP server by restarting the VS Code extension
  2. Trigger a backup by calling the backup_projects tool:
<use_mcp_tool>
<server_name>cloudflare-backup</server_name>
<tool_name>backup_projects</tool_name>
<arguments>
{}
</arguments>
</use_mcp_tool>

The server will display progress messages in the console as it performs the backup operation.

Current Limitations

Please note that in the current version, the backup functionality is implemented as a placeholder. The system will log messages to the console but does not yet perform actual backups. Future updates will implement the full backup functionality using Cloudflare and GitHub APIs.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "cloudflare-backup" '{"command":"node","args":["/path/to/cloudflare-github-backup/build/index.js"],"env":{"CLOUDFLARE_API_TOKEN":"your_cloudflare_api_token","GITHUB_ACCESS_TOKEN":"your_github_access_token","GITHUB_REPO_NAME":"your_github_repo_name"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cloudflare-backup": {
            "command": "node",
            "args": [
                "/path/to/cloudflare-github-backup/build/index.js"
            ],
            "env": {
                "CLOUDFLARE_API_TOKEN": "your_cloudflare_api_token",
                "GITHUB_ACCESS_TOKEN": "your_github_access_token",
                "GITHUB_REPO_NAME": "your_github_repo_name"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "cloudflare-backup": {
            "command": "node",
            "args": [
                "/path/to/cloudflare-github-backup/build/index.js"
            ],
            "env": {
                "CLOUDFLARE_API_TOKEN": "your_cloudflare_api_token",
                "GITHUB_ACCESS_TOKEN": "your_github_access_token",
                "GITHUB_REPO_NAME": "your_github_repo_name"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later