# Cloudflare — Pipedream Connect

> CDN, DDoS mitigation, Internet security, and DNS services

- API slug: `cloudflare_api_key` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Infrastructure & Cloud
- Website: https://www.cloudflare.com/
- This page (HTML): https://pipedream.com/apps/cloudflare-api-key
- Tools: 20 actions · 0 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: cloudflare_api_key`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "cloudflare_api_key",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Change Development Mode:
const result = await mcp.callTool({
  name: "cloudflare_api_key-change-zone-development-mode",
  arguments: {
    zoneId: "Zone ID",
    value: "Development Mode",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Cloudflare endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.cloudflare.com/client/v4/user

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuY2xvdWRmbGFyZS5jb20vY2xpZW50L3Y0L3VzZXI?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "cloudflare_api_key-change-zone-development-mode",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    cloudflare_api_key: { authProvisionId: "apn_xxxxxxx" },
    zoneId: "Zone ID",
    value: "Development Mode",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (20)

### `cloudflare_api_key-change-zone-development-mode` — Change Development Mode (Write)

Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site. This will bypass Cloudflare's accelerated cache and slow down your site. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/change-zone-development-mode.md

### `cloudflare_api_key-change-ssl-setting` — Change Zone's SSL Setting (Write)

Choose the appropriate SSL setting for your zone. See the docs here

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/change-ssl-setting.md

### `cloudflare_api_key-create-certificate` — Create a Certificate (Write)

Creates an Origin CA certificate. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/create-certificate.md

### `cloudflare_api_key-create-dns-record` — Create DNS Record (Write)

Creates a DNS Record given its zone id

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/create-dns-record.md

### `cloudflare_api_key-create-ip-access-rule` — Create IP Access Rule (Write)

Creates a new IP Access Rule for an account. The rule will apply to all zones in the account. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/create-ip-access-rule.md

### `cloudflare_api_key-create-key-value-pairs` — Create Key/Value Pairs (Write)

Create new Key/Value pairs in a Namespace. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/create-key-value-pairs.md

### `cloudflare_api_key-create-namespace` — Create Namespace (Write)

Create a new Namespace in an account. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/create-namespace.md

### `cloudflare_api_key-create-zone` — Create Zone (Write)

Create Zone. See the docs here

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/create-zone.md

### `cloudflare_api_key-delete-dns-record` — Delete DNS Record (Write)

Deletes a DNS record of a zone. See the docs here

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/delete-dns-record.md

### `cloudflare_api_key-export-dns-records` — Export DNS Records (Write)

Export a BIND config of a zone. See the docs here

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/export-dns-records.md

### `cloudflare_api_key-import-dns-records` — Import DNS Records (Write)

Import a BIND config into a zone. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/import-dns-records.md

### `cloudflare_api_key-list-account-identifier-options` — List Account ID Options (Read-only)

Retrieves available options for the Account ID field.

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/list-account-identifier-options.md

### `cloudflare_api_key-list-certificates` — List Certificates (Read-only)

List all existing Origin CA certificates for a given zone. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/list-certificates.md

### `cloudflare_api_key-list-dns-records` — List DNS Records (Read-only)

List, search, sort, and filter a zones' DNS records. See the docs here

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/list-dns-records.md

### `cloudflare_api_key-patch-dns-record` — Patch DNS Record (Write)

Patches a DNS record of a zone. See the docs here

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/patch-dns-record.md

### `cloudflare_api_key-purge-all-files` — Purge All Files (Write)

Remove ALL files from Cloudflare's cache. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/purge-all-files.md

### `cloudflare_api_key-purge-files-by-url` — Purge Files by URL (Write)

Granularly remove one or more files from Cloudflare's cache by specifying URLs. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/purge-files-by-url.md

### `cloudflare_api_key-query-worker-analytics` — Query Worker Analytics (Write)

Retrieves Workers KV request metrics for the given account. See the docs here

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/query-worker-analytics.md

### `cloudflare_api_key-revoke-certificate` — Revoke Certificate (Write)

Revoke an existing Origin CA certificate by its serial number. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/revoke-certificate.md

### `cloudflare_api_key-update-zone-security-level` — Update Zone Security Level (Write)

Choose the appropriate security profile for your website, which will automatically adjust each of the security settings. See the documentation

Full schema: https://pipedream.com/apps/cloudflare-api-key/actions/update-zone-security-level.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
