Backend MCP (Model Context Protocol) for a ChatGPT App, deployed on Cloudflare Workers. It handles image uploads from ChatGPT file params, stores files in Vercel Blob, and writes metadata to Supabase.
- A ChatGPT App integration using MCP tools.
- The main tool is
upload_artwork, called by ChatGPT. - Input image comes from ChatGPT file parameters (
openai/fileParams) as{ download_url, file_id }. - The Worker fetches the file from
download_url, uploads to Blob, then inserts records in Supabase.
When visiting exhibitions, I often see paintings, objects, or sculptures I want to preserve in my gallery.
Before this app, the workflow was slow and manual:
- Take photos during the visit.
- Later at home, review each photo.
- Search for a better image.
- Research metadata on the web.
- Manually add everything to the gallery.
This app removes that delayed, repetitive process.
With the ChatGPT App workflow:
- Upload the photo directly in ChatGPT while on site.
- Ask ChatGPT to find artwork information online.
- Let the tool write the artwork to the gallery with image and metadata.
Result: capture and enrichment happen in one flow, without the later manual reprocessing step.
- MCP tool
upload_artwork - File param flow compatible with ChatGPT Apps (
openai/fileParams) - MIME validation (
png,jpeg,gif,webp) - Max size validation (10 MB)
- Blob upload + Supabase insert
- OAuth Access flow support (
/authorize,/callback,/token,/register) - Fallback no-auth mode on
/mcpwhen OAuth bindings are not configured
- Cloudflare Workers + Wrangler
agents/mcp+@modelcontextprotocol/sdk@cloudflare/workers-oauth-provider@vercel/blob@supabase/supabase-js
- Node.js 20+ (24 recommended)
- Cloudflare account with Wrangler authenticated
- Supabase project with an
artworkstable - Vercel Blob token (
BLOB_READ_WRITE_TOKEN)
npm install- Copy the example file.
cp .dev.vars.example .dev.vars- Fill in values in
.dev.vars.
Required variables:
BLOB_READ_WRITE_TOKENSUPABASE_URLSUPABASE_SERVICE_ROLE_KEY
OAuth variables (optional, required only when enabling OAuth):
ACCESS_CLIENT_IDACCESS_CLIENT_SECRETACCESS_TOKEN_URLACCESS_AUTHORIZATION_URLACCESS_JWKS_URLACCESS_CALLBACK_URL(optional)ACCESS_ISSUER(optional)
npm run devUseful endpoints:
GET /(text status)POST /mcp(MCP transport)GET /authorizeandGET /callback(when OAuth is enabled)
- ChatGPT sends tool call for
upload_artwork. imageis provided as file param metadata (download_url,file_id).- Worker downloads the image from
download_url. - Worker uploads image to Vercel Blob.
- Worker inserts metadata into Supabase
artworks. - Worker returns
id,imageUrl, and confirmation fields.
npm run deployDeployment uses wrangler.jsonc configuration (KV namespace + Secrets Store OAuth bindings).
Expected input:
image: object withdownload_urlandfile_idtitle: string (required)artist: string (required)year: string (optional)category:en-coursorenregistre(optional, defaulten-cours)description: string (optional)
Output:
id(artwork UUID)imageUrl(public Blob URL)- confirmation fields (
title,artist,category)