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
Create an edge function that receives Stripe webhooks and marks invoices paid.
list_edge_functionsget_edge_functionsearch_docscreate_edge_function_secret+2 moreDraft 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
name: supabase-edge-functionsWrite, 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
- See what exists with
list_edge_functions, and read a function's code withget_edge_function. - 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 withsearch_docs.
- handle CORS preflight (
- Secrets: list the environment variables the function needs. Set them with
create_edge_function_secretonly after the user approves each name. Never echo secret values back. - Show the full code and the target project. After the user's yes, deploy with
deploy_edge_function. - Verify by calling the function, or asking the user to, then read
get_logsfor 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_functionsget_edge_functionsearch_docscreate_edge_function_secretAsks firstdeploy_edge_functionAsks firstget_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.