Cloudflare R2 Remote MCP Worker turns your R2 bucket into an AI-accessible storage backend. Deploy it as a Cloudflare Worker and connect any MCP client — ChatGPT, MCP Inspector, or your own tooling — to list, read, write, delete, copy, move, and transfer objects directly through the Model Context Protocol.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.
Quickstart
Deploy the Worker and connect your first MCP client in minutes
Deploy
Step-by-step production deployment guide
Authentication
GitHub OAuth setup, allowlists, and auth modes
MCP Tools
All 24 tools across object, transfer, presign, and admin surfaces
What it does
The Worker exposes three credential surfaces through a single/mcp endpoint:
| Surface | What it gives you | Credential |
|---|---|---|
| R2 binding | Object list, head, get, put, delete, copy, move, rename | Worker R2 binding |
| Cloudflare API | Read-only bucket/admin visibility | Cloudflare API token |
| S3-compatible API | Presigned GET and PUT URLs | R2 access key + secret |
Account-level admin tools and presigned URL tools are disabled by default. Enable them individually with
ENABLE_ACCOUNT_TOOLS=true and ENABLE_PRESIGN_TOOLS=true.How it works
R2_ROOT_PREFIX.
Get started
Install and configure
Clone the repo, run
npm install, copy wrangler.example.jsonc to wrangler.jsonc, and fill in your bucket name and GitHub login.Create buckets and KV
Create your R2 bucket with
npx wrangler r2 bucket create and a KV namespace for OAuth state with npx wrangler kv namespace create OAUTH_KV.Set secrets and deploy
Set
GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, and COOKIE_ENCRYPTION_KEY as Wrangler secrets, then run npm run deploy.Configuration Reference
All environment variables and their defaults
Security Guide
Threat model, destructive guards, and public deployment checklist
Client Setup
Connect ChatGPT, MCP Inspector, or any generic MCP client
Tool Reference
Complete parameter and return-type reference for every tool