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 Cloudflare R2 Remote MCP Worker turns your Cloudflare R2 bucket into an MCP-accessible object store. Deploy it as a Cloudflare Worker, connect ChatGPT or any MCP client, and let AI agents list, read, write, copy, move, and delete objects — all behind GitHub OAuth authentication.

Quickstart

Clone, configure, and deploy in under 15 minutes. Get ChatGPT talking to your R2 bucket.

Deploy Guide

Step-by-step deployment: buckets, KV namespaces, OAuth secrets, and Wrangler.

Tools Reference

All 24 MCP tools — object CRUD, base64 transfer, presigned URLs, and admin read tools.

Authentication

GitHub OAuth flow, allowlist configuration, and AUTH_MODE options.

What This Is

The worker exposes R2 object operations through a remote MCP endpoint at /mcp. With AUTH_MODE=github, every MCP client must authenticate through GitHub OAuth before reaching your bucket. The GitHub login is checked against a configurable allowlist — no extra identity infrastructure required.
ChatGPT / MCP client
  → GitHub OAuth (/authorize → /callback)
  → Cloudflare Worker /mcp
  → R2 bucket

Object Tools

list, head, get, put, delete, copy, move, rename

Transfer Tools

Base64 upload and download for binary objects

Presigned URLs

Temporary GET/PUT URLs via R2 S3-compatible API

Getting Started

1

Install dependencies and log in to Cloudflare

npm install
npx wrangler login
2

Create your R2 bucket and configure the worker

npx wrangler r2 bucket create your-bucket-name
cp wrangler.example.jsonc wrangler.jsonc
Edit wrangler.jsonc with your bucket name, worker name, and GitHub allowlist.
3

Set up GitHub OAuth and deploy

Create a GitHub OAuth App with callback URL https://<worker-url>/callback, set secrets with wrangler secret put, then deploy:
npm run deploy
4

Connect ChatGPT or MCP Inspector

Point your MCP client at https://<worker-url>/mcp with OAuth authentication. Approve the GitHub login and start issuing R2 commands.
For local development without OAuth, set AUTH_MODE=none in .dev.vars and run npm run dev. Never expose AUTH_MODE=none on a public URL.

Build docs developers (and LLMs) love