Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xxyoudeadpunkxx/cloudflare-r2-remote-mcp-worker/llms.txt

Use this file to discover all available pages before exploring further.

The 10 read-only admin tools provide visibility into Cloudflare R2 bucket configuration and account-level metrics by querying the Cloudflare API on your behalf. All admin tools are disabled by default and must be activated with ENABLE_ACCOUNT_TOOLS=true. No mutating operations — such as creating or deleting buckets, updating CORS rules, or modifying lifecycle policies — are included.

Prerequisites

Enable admin tools and configure the required environment variables in wrangler.jsonc:
wrangler.jsonc
{
  "vars": {
    "ENABLE_ACCOUNT_TOOLS": "true",
    "CLOUDFLARE_ACCOUNT_ID": "<your-account-id>",
    "R2_BUCKET_NAME": "<your-default-bucket-name>"
  }
}
Then add your Cloudflare API token as a secret:
npx wrangler secret put CLOUDFLARE_API_TOKEN
Use the narrowest token scope that covers the R2 resources you need. A token scoped to R2: Read for specific buckets is sufficient for all admin tools and reduces the blast radius if the token is compromised.
R2_BUCKET_NAME is used as the default bucket for any admin tool that accepts an optional bucketName parameter. When a tool call omits bucketName, the Worker falls back to this value.

Available Tools

ToolDescription
r2_bucket_listLists R2 buckets in the configured Cloudflare account. Parameters: cursor (string), direction (asc or desc), nameContains (string), perPage (integer, 1–1000).
r2_bucket_getReturns metadata for one R2 bucket. Parameters: bucketName (string, optional — defaults to R2_BUCKET_NAME).
r2_cors_getReturns the CORS rules configured on one R2 bucket. Parameters: bucketName (string, optional).
r2_lifecycle_getReturns the lifecycle rules configured on one R2 bucket. Parameters: bucketName (string, optional).
r2_domain_custom_listLists all custom domains attached to one R2 bucket. Parameters: bucketName (string, optional).
r2_domain_custom_getReturns settings for one custom domain on an R2 bucket. Parameters: bucketName (string, optional), domain (string, required).
r2_domain_managed_getReturns the r2.dev managed domain settings for one R2 bucket. Parameters: bucketName (string, optional).
r2_notifications_listLists all event notification rules configured for one R2 bucket. Parameters: bucketName (string, optional).
r2_notifications_getReturns the configuration for one event notification queue on an R2 bucket. Parameters: bucketName (string, optional), queueId (string, required).
r2_metrics_getReturns account-level R2 storage metrics. No parameters.

Tool Details

Lists R2 buckets in the configured Cloudflare account with optional filtering and pagination.Parameters
cursor
string
Pagination cursor from a previous response. Optional.
direction
string
Sort direction: asc or desc. Optional.
nameContains
string
Filter to buckets whose names contain this substring. Optional.
perPage
integer
Number of results per page. Must be between 1 and 1000. Optional.
Returns metadata for one R2 bucket, including its creation date, location hint, and storage class.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
Returns the Cross-Origin Resource Sharing (CORS) rules configured for one R2 bucket.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
Returns the object lifecycle rules for one R2 bucket, including expiration and transition policies.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
Lists all custom domains (e.g. cdn.example.com) currently attached to one R2 bucket.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
Returns the configuration for one specific custom domain attached to an R2 bucket.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
domain
string
required
The custom domain to look up (e.g. cdn.example.com).
Returns the settings for the Cloudflare-managed r2.dev public access domain for one R2 bucket.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
Lists all event notification rules configured on one R2 bucket, including the queues they target and the event types they capture.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
Returns the configuration for one specific event notification queue on an R2 bucket.Parameters
bucketName
string
The bucket to query. Defaults to R2_BUCKET_NAME when omitted. Optional.
queueId
string
required
The ID of the queue whose notification configuration to retrieve.
Returns account-level R2 storage metrics including total object count and storage bytes consumed. This tool takes no parameters.

Scope Note

All admin tools are read-only by design. The Worker does not expose any tool for creating or deleting buckets, modifying CORS or lifecycle configurations, attaching or detaching domains, creating or deleting notification rules, or any other mutating operation against the Cloudflare API. This design ensures that the CLOUDFLARE_API_TOKEN used by the Worker never needs write permissions on your account. A token with R2: Read access is sufficient. For full parameter details and API response schemas, see the Admin Tool Reference.

Build docs developers (and LLMs) love