Get the FREE Ultimate OpenClaw Setup Guide →

dns

Infrastructure as Code for MCP domains / DNS management

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio modelcontextprotocol-dns python -m mcp_dns_server \
  --env GCS_BUCKET="your-gcs-bucket-name" \
  --env GCP_PROJECT="your-gcp-project-id" \
  --env CLOUDFLARE_API_TOKEN="your-cloudflare-api-token" \
  --env CLOUDFLARE_ACCOUNT_ID="your-account-id"

How to use

This MCP server provides infrastructure as code for managing Cloudflare DNS records for MCP Cloud using Pulumi. The DNS records are defined in the source at src/config/records.ts and are keyed by domain name, allowing you to manage DNS configurations declaratively. The server is designed to run as an MCP service that leverages Pulumi to provision and update DNS entries in Cloudflare as part of your MCP deployment workflow. Use the provided Makefile targets (preview and up) to review and apply changes to your DNS configuration. The usual workflow is to preview changes to confirm the impact, then deploy to apply updates to Cloudflare DNS records for your domains. The server expects Cloudflare API access and appropriate Pulumi configuration, including authentication credentials, to operate.

Typical capabilities include creating, updating, or deleting DNS records (A, AAAA, CNAME, MX, TXT, etc.) across zones managed in Cloudflare, driven by the definitions in src/config/records.ts. You can customize the records by editing that config file and re-running the standard deployment commands to keep DNS in sync with your desired state.

How to install

Prerequisites:

  1. Install Python dependencies (if any are specified in the project):

    • Ensure you have pip installed and run: pip install -r requirements.txt (if a requirements file exists)
  2. Prepare Cloudflare credentials:

    • Obtain a Cloudflare API token with Zone:DNS:Edit permissions.
    • Export it as an environment variable or configure it in your runtime config: export CLOUDFLARE_API_TOKEN="<your-token>" export CLOUDFLARE_ACCOUNT_ID="<your-account-id>"
  3. Ensure Pulumi is authenticated and configured for your deployment target:

    • pulumi login gs://<your-pulumi-backend> (if using a remote backend)
    • pulumi stack init prod (or use your existing prod stack)
    • pulumi config set --secret cloudflare:apiToken "$CLOUDFLARE_API_TOKEN"
    • pulumi config set cloudflare:accountId "$CLOUDFLARE_ACCOUNT_ID"
  4. Initialize and preview changes before deployment:

    • make preview
    • make up

If you prefer running directly with Python without Makefile targets, you can execute the Python module configured for the MCP DNS server, for example:

  • python -m mcp_dns_server

Additional notes

Tips and common issues:

  • Ensure the Cloudflare API token has the necessary permissions (Zone:DNS:Edit) for all zones you manage.
  • The DNS records are defined in src/config/records.ts; any changes there will be picked up on the next deployment after running the preview and up commands.
  • Keep your Pulumi state secure; use a proper backend (e.g., Google Cloud Storage) and protect access credentials.
  • If you change the zone list, verify that the Cloudflare account ID in the config matches the account hosting those zones.
  • For CI/CD, securely store the GCP credentials, Cloudflare token, and Pulumi passphrase in your GitHub Actions secrets as described in the repository.
  • If you see authorization errors, re-authenticate with Pulumi and re-export Cloudflare credentials to ensure the runtime has current tokens.

Related MCP Servers

Sponsor this space

Reach thousands of developers