semvec/pypi-packages huggingface dataset:
cf-mcp 0.1.1
Cloudflare CLI + MCP server for DNS, tunnels, workers, and token management.
Requires Python: >=3.11
Keywords: cli, cloudflare, dns, mcp, tunnel, workers

# cf-mcp

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

## Install

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

## Setup

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

```bash
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](https://dash.cloudflare.com/profile/api-tokens) with permissions for the resources you want to manage.

## CLI Usage

```bash
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):

```bash
cf mcp
```

Register with Claude Code:

```bash
claude mcp add cf-mcp -- cf mcp
```

## Development

```bash
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