Cloudflare R2

🌐Community
by ovachiever · vlatest · Repository

Securely store and retrieve data in Cloudflare R2 object storage using this efficient AI agent integration.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add ovachiever-cloudflare-r2 npx -- -y @trustedskills/ovachiever-cloudflare-r2
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "ovachiever-cloudflare-r2": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/ovachiever-cloudflare-r2"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill enables AI agents to securely store and retrieve data in Cloudflare R2 object storage. It provides functionality for uploading files to, and downloading files from, an R2 bucket using a worker environment. The integration leverages Wrangler CLI and the Cloudflare dashboard for initial setup and deployment of workers that interact with R2.

When to use it

  • Storing user-generated content like images or videos.
  • Serving static assets (e.g., website files, media) directly from object storage.
  • Backing up data securely within the Cloudflare network.
  • Creating a development/production separation using preview buckets for testing uploads.
  • Building custom APIs that require file upload and download capabilities.

Key capabilities

  • Bucket Creation: Ability to create R2 buckets via Wrangler CLI or the Cloudflare dashboard.
  • File Uploading: Securely uploads files to specified R2 buckets, including setting content type metadata.
  • File Downloading: Retrieves files from R2 buckets and serves them with appropriate headers (Content-Type, ETag, Cache-Control).
  • Environment Binding: Uses environment variables (MY_BUCKET) within a Cloudflare Worker to access the R2 bucket.

Example prompts

  • "Upload this file named 'report.pdf' to my R2 bucket."
  • "Download the file 'image.jpg' from my R2 bucket and serve it."
  • “Create an R2 bucket named ‘my-data’ if one doesn’t already exist.”

Tips & gotchas

  • Dependencies: Requires cloudflare-worker-base for Worker setup, as well as specific versions of Wrangler, @cloudflare/workers-types, and aws4fetch.
  • Bucket Naming Rules: R2 bucket names must adhere to strict naming conventions: 3-63 characters, lowercase letters, numbers, or hyphens only, starting/ending with a letter or number, and globally unique within your Cloudflare account.
  • Binding vs. Bucket Name: Pay close attention to the distinction between the R2 binding (used in code as env.MY_BUCKET) and the actual bucket name configured in Wrangler.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
ovachiever
Installs
41

🌐 Community

Passed automated security scans.