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.

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.

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:
SurfaceWhat it gives youCredential
R2 bindingObject list, head, get, put, delete, copy, move, renameWorker R2 binding
Cloudflare APIRead-only bucket/admin visibilityCloudflare API token
S3-compatible APIPresigned GET and PUT URLsR2 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

ChatGPT / MCP client
  → GitHub OAuth (AUTH_MODE=github)
  → Cloudflare Worker /mcp
  → R2 bucket
The Worker runs entirely on Cloudflare’s edge — no servers to manage. GitHub OAuth gates access to a list of allowed GitHub logins you control. Object operations are scoped to the single R2 bucket bound to the Worker, optionally restricted further with R2_ROOT_PREFIX.

Get started

1

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.
2

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.
3

Set secrets and deploy

Set GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, and COOKIE_ENCRYPTION_KEY as Wrangler secrets, then run npm run deploy.
4

Connect your MCP client

Point ChatGPT or MCP Inspector at https://<worker-url>/mcp with OAuth authentication. Approve the GitHub login and start using R2 tools.

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

Build docs developers (and LLMs) love