Copying Edge Functions between projects

How to copy Edge Functions from one SupaHost project to another, or from Supabase Cloud, using the dashboard editor or an AI agent over MCP, plus the secrets and settings to redo.

There's no one-click copy for Edge Functions. You move the source files yourself, either by pasting them into the dashboard editor or by having an AI agent read them from one project and deploy them to the other over MCP. Secrets and the Require JWT setting don't travel with the code, so you set those again.

When you need this

  • Promoting functions from a staging project to production.
  • Setting up a branch: branches copy the database but not Edge Functions or function secrets.
  • Moving from Supabase Cloud: the one-click import copies the database, users and files, but not functions.

Option 1: copy and paste in the dashboard

  1. In the source project, go to Dashboard → your project → Functions tab and click Edit on the function. Copy each file. (Studio's Edge Functions page also shows a read-only copy of the live code.)
  2. In the target project's Functions tab, click New function and use the same slug.
  3. Paste index.ts, then use + File for each extra file, keeping the same paths (for example _shared/cors.ts).
  4. Click Deploy function and wait for active.

This works well for a few small functions. If your functions live in a Git repo, paste from there instead; the repo is the better source of truth.

Option 2: let an AI agent copy them

Create an access token with Whole instance scope in Dashboard → AI agents (MCP) (or Access tokens), connect your AI tool to the SupaHost MCP server, and ask:

Copy every Edge Function from project app-one to project app-two. Keep the same slugs and files.

The agent uses list_edge_functions and get_edge_function on the source to read each function's files, then deploy_edge_function on the target. It can confirm each one reached active and check get_edge_function_logs after a test call. A token scoped to a single project can only see that project, so use an instance-wide token, or two project tokens configured as separate servers.

From Supabase Cloud

Download the code with the Supabase CLI while you still have access to the Cloud project:

supabase functions download send-invoice --project-ref abcdefghijklmnopqrst

This writes supabase/functions/send-invoice/. Then deploy it to SupaHost with either option above. The supabase functions deploy command doesn't work against SupaHost; see supabase functions deploy doesn't work with SupaHost.

After copying: what to redo

  1. Secrets. Add each one in the target's Secrets card. Values can't be read back from the source, so take them from your password manager or the provider's dashboard.
  2. Require JWT. Set the per-function toggle to match the source. Webhook receivers usually need it off.
  3. Project-specific values. Code that reads SUPABASE_URL and the keys from Deno.env needs no change. Hard-coded URLs, keys, bucket names or webhook signing secrets do.
  4. Callers. Point webhooks, cron jobs (net.http_post URLs) and your app at the new project's function URL, for example https://app-two.acme.supahost.space/functions/v1/send-invoice.

Updated 11 November 2026 · View as Markdown · Something wrong or missing? Tell us