CONNECT APP
Build with Cloudflare
Infrastructure & Cloud
- API key
MCP
Give your agent Cloudflare tools
Every Cloudflare action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Cloudflare account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{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",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Change Development Mode:
result = await session.call_tool("cloudflare_api_key-change-zone-development-mode", {
"zoneId": "Zone ID",
"value": "Development Mode",
})API PROXY
Call the Cloudflare API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Cloudflare API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.cloudflare.com/client/v4/user",
})
// Any allowed Cloudflare endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# 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"SDK
Run Cloudflare actions from your backend
Connect a user's Cloudflare account once, then run Change Development Mode on their behalf from your own code — TypeScript, Python, or plain HTTP.
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",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="cloudflare_api_key-change-zone-development-mode",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"cloudflare_api_key": {"authProvisionId": "apn_xxxxxxx"},
"zoneId": "Zone ID",
"value": "Development Mode",
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "cloudflare_api_key-change-zone-development-mode",
"configured_props": {
"cloudflare_api_key": { "authProvisionId": "apn_xxxxxxx" },
"zoneId": "Zone ID",
"value": "Development Mode"
}
}'TOOLS
Cloudflare actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Change Development Mode
actionDevelopment 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 documentationWritev0.0.7 -
Change Zone's SSL Setting
actionChoose the appropriate SSL setting for your zone. See the docs hereWritev0.0.6 -
Create a Certificate
actionCreates an Origin CA certificate. See the documentationWritev0.0.6 -
Create DNS Record
actionCreates a DNS Record given its zone idWritev1.0.2 -
Create IP Access Rule
actionCreates a new IP Access Rule for an account. The rule will apply to all zones in the account. See the documentationWritev0.0.5 -
Create Key/Value Pairs
actionCreate new Key/Value pairs in a Namespace. See the documentationWritev0.0.5 -
Create Namespace
actionCreate a new Namespace in an account. See the documentationWritev0.0.5 -
Create Zone
actionCreate Zone. See the docs hereWritev0.0.6 -
Delete DNS Record
actionDeletes a DNS record of a zone. See the docs hereWritev0.0.6 -
Export DNS Records
actionExport a BIND config of a zone. See the docs hereWritev0.0.6 -
Import DNS Records
actionImport a BIND config into a zone. See the documentationWritev1.0.5 -
List Account ID Options
actionRetrieves available options for the Account ID field.Read-onlyv0.0.2 -
List Certificates
actionList all existing Origin CA certificates for a given zone. See the documentationRead-onlyv0.0.6 -
List DNS Records
actionList, search, sort, and filter a zones' DNS records. See the docs hereRead-onlyv1.0.2 -
Patch DNS Record
actionPatches a DNS record of a zone. See the docs hereWritev0.0.6 -
Purge All Files
actionRemove ALL files from Cloudflare's cache. See the documentationWritev1.0.2 -
Purge Files by URL
actionGranularly remove one or more files from Cloudflare's cache by specifying URLs. See the documentationWritev0.1.2 -
Query Worker Analytics
actionRetrieves Workers KV request metrics for the given account. See the docs hereWritev0.0.2 -
Revoke Certificate
actionRevoke an existing Origin CA certificate by its serial number. See the documentationWritev0.0.6 -
Update Zone Security Level
actionChoose the appropriate security profile for your website, which will automatically adjust each of the security settings. See the documentationWritev0.0.7
EVENTS
Cloudflare triggers
Event sources your backend can deploy for users and receive through a webhook.
No Cloudflare triggers are available yet.
MULTI-APP
Use Cloudflare with other popular apps
Most products don't stop at one integration. Pair Cloudflare with the other apps your users rely on, and ship use cases that span both.
- App slug
- cloudflare_api_key
- Authentication
- API key
- Categories
- Infrastructure & Cloud
- Actions
- 20
- Triggers
- 0
- API proxy
- Available