Skip to main content

Cloudflare CLI + MCP server for DNS, tunnels, workers, and token management.

Project description

cf-mcp

Cloudflare CLI + MCP server for managing DNS, tunnels, workers, and API tokens.

Install

uv tool install cf-mcp
# or run directly:
uvx cf-mcp

Setup

Set environment variables (or create a .env file):

export CF_API_TOKEN="your-cloudflare-api-token"
export CLOUDFLARE_ACCOUNT_ID="your-account-id"
export CLOUDFLARE_TUNNEL_ID="your-default-tunnel-id"  # optional

Create a token at dash.cloudflare.com/profile/api-tokens with permissions for the resources you want to manage.

CLI Usage

cf zone list
cf dns list example.com
cf dns create example.com app CNAME target.example.com --proxy
cf dns update example.com RECORD_ID --content new-value
cf dns delete example.com RECORD_ID
cf tunnel list
cf tunnel ingress list
cf tunnel ingress add app.example.com http://localhost:3000
cf tunnel ingress remove app.example.com
cf workers list
cf workers info my-worker
cf token verify
cf token list
cf token permissions TOKEN_ID
cf token delete TOKEN_ID

All commands support --json for machine-readable output.

MCP Server

Start the MCP server (stdio transport):

cf mcp

Register with Claude Code:

claude mcp add cf-mcp -- cf mcp

Development

git clone https://github.com/chikingsley/cf-mcp.git
cd cf-mcp
uv sync
uv run pytest -v         # integration tests (requires .env)
uv run ruff check .      # lint
uv run ty check src/     # type check

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cf_mcp-0.1.1.tar.gz (108.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cf_mcp-0.1.1-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file cf_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: cf_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 108.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cf_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5c8596052b189dc319d4051512de50130647e4c895ddec097cbb03a044454e59
MD5 e4b8d46676f3d8ea88887edb0275b3c1
BLAKE2b-256 24a2034f55759aee66597f026670c7ae8d7264d11daefd82721515fe6f8f8347

See more details on using hashes here.

File details

Details for the file cf_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cf_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.3 {"installer":{"name":"uv","version":"0.10.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cf_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 01b298564b64d343f4dac4b3e256915a6fa6db4d6ff7273ba5b44f0a037a8375
MD5 0ef95812ad736c084aacdc3f5f65a5bc
BLAKE2b-256 2c3ccd6f449bd028f2bc88dec990ddad45fa4f77e990a16ba853c28d0276850e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page