Build Supabase Edge Functions with AI

Writes and deploys Supabase Edge Functions with CORS, caller verification and secrets handled properly, then reads the logs to confirm they work. Deploys and secrets wait for your yes.

Asks before writingUses 6 Supabase toolsWorks in RevampKey, Claude Code, Codex and Cursor

Use in RevampKey

Get RevampKey to connect Supabase

RevampKey is a free desktop app for Mac, Windows and Linux. Install it, sign in, and Supabase is one click away with its skills already attached.

Download RevampKey

Not now? Use the skills in your current tool

curl -fsSL --create-dirs -o .claude/skills/supabase-edge-functions/SKILL.md https://revampkey.com/marketplace/supabase/skills/edge-functions/SKILL.md
Other agents
Other agents

When to use it

  • Adding a webhook handler (Stripe, GitHub and others)
  • Server-side logic your client cannot run
  • An edge function that suddenly returns 500

What it looks like

You

Create an edge function that receives Stripe webhooks and marks invoices paid.

list_edge_functionsget_edge_functionsearch_docscreate_edge_function_secret+2 more
Agent

Draft stripe-webhook: verifies the Stripe-Signature header, handles invoice.paid, and updates invoices.status with the service role inside the function. It needs 2 secrets, STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET, which you enter yourself. Deploy to acme-dev?

The SKILL.md file

View raw
name: supabase-edge-functions

Write, deploy and troubleshoot Supabase Edge Functions, including secrets, CORS, auth checks and logs, with deploys only after approval. Use when the user asks to create, update, deploy or debug a Supabase Edge Function or webhook handler.

Steps

  1. See what exists with list_edge_functions, and read a function's code with get_edge_function.
  2. For a new function or a change, write TypeScript for the Deno runtime:
    • handle CORS preflight (OPTIONS) when browsers call it;
    • verify the caller, either a Supabase JWT from the Authorization header or a webhook signature, before doing work;
    • read config from Deno.env.get(...), never hard-coded. Check current patterns with search_docs.
  3. Secrets: list the environment variables the function needs. Set them with create_edge_function_secret only after the user approves each name. Never echo secret values back.
  4. Show the full code and the target project. After the user's yes, deploy with deploy_edge_function.
  5. Verify by calling the function, or asking the user to, then read get_logs for the edge function service and fix any errors with another approved deploy.

Report

The function name and URL, secrets set (names only), and how it was verified.

Supabase tools it uses

  • list_edge_functions
  • get_edge_function
  • search_docs
  • create_edge_function_secretAsks first
  • deploy_edge_functionAsks first
  • get_logs

Tool list from supabase-community/supabase-mcp source.

FAQ

Does it handle secrets safely?

It reads them from environment variables, asks before setting any, and never prints their values.

Can it debug an existing function?

Yes. It reads the code and the edge function logs, then proposes a fix.