Deploying functions

Deploy Edge Functions on SupaHost from the dashboard Functions tab or with the MCP deploy_edge_function tool, and how versions, build errors and deletes work.

There are two ways to deploy an Edge Function on SupaHost: the dashboard's Functions tab, or an AI agent using the deploy_edge_function tool on the SupaHost MCP server. Both store your source, build it on your instance and switch traffic to the new version once the build passes.

The Supabase CLI's supabase functions deploy doesn't work with SupaHost, because SupaHost doesn't offer Supabase's Management API. See supabase functions deploy doesn't work with SupaHost.

Deploying, editing and deleting are owner-only. Team members can see functions, their status and logs.

Deploy from the dashboard

Dashboard → your project → Functions tab:

  1. Click New function.
  2. Enter a Name. It becomes the URL (/functions/v1/<name>), uses lowercase letters, numbers, - and _ (up to 63 characters), and can't be changed later.
  3. Choose whether to Require a JWT (see Authentication and JWT verification).
  4. Write your code in index.ts. Use + File to add more files, such as _shared/cors.ts, and Remove to drop one. index.ts can't be removed.
  5. Click Deploy function.

To change a live function, click Edit on its row, make your changes and click Deploy new version. Turning Require JWT on or off in the table takes effect without a new build.

What happens when you deploy

  1. SupaHost saves the files as a new version (v1, v2, …).
  2. Your instance downloads that version and bundles it as a check. The bundle step parses the code and fetches every npm:, jsr: and https: import, which also warms the module cache so the first request is fast.
  3. If the check passes, the new version goes live. If not, the deploy is marked as failed and the previous version keeps serving.

The whole cycle usually takes about a minute. The status column tells you where it is:

Status Meaning
Deploying vN… Version N is being built. The previous version, if any, is still answering.
Live · vN Version N is serving requests.
Deploy failed · vM live The latest version didn't build. The error is shown under the function's URL, and version M keeps serving.

A failed first deploy leaves nothing live, so requests get a 404 NOT_FOUND until a version builds. For common build errors, see Edge Function deploy failed.

Deploy with an AI agent (MCP)

An agent connected to the SupaHost MCP server can deploy the files in your repository. The deploy_edge_function tool takes:

Argument Notes
name The function's slug. Creates the function or adds a new version.
files An array of { name, content }. Must include index.ts. Paths may contain folders.
verify_jwt Optional. Defaults to the function's current setting, or true for a new function.
entrypoint_path Optional. Must be index.ts if given.
project Only for instance-wide tokens: which project to deploy to.

The arguments for a two-file function look like this:

{
  "name": "room-quote",
  "verify_jwt": true,
  "files": [
    { "name": "index.ts", "content": "import { quote } from \"./lib/pricing.ts\";\nDeno.serve(async (req) => Response.json(quote(await req.json())));\n" },
    { "name": "lib/pricing.ts", "content": "export function quote({ nights }: { nights: number }) {\n  return { total: nights * 120 };\n}\n" }
  ]
}

The tool returns straight away with status deploying. The agent should then call list_edge_functions until the function shows active with the new deployed_version, or error with the build message. Deploys made over MCP appear in Activity as MCP (<token name>).

A prompt that works well:

Deploy supabase/functions/room-quote to SupaHost with deploy_edge_function, including every file in that folder. Keep verify_jwt on. Then poll list_edge_functions until it's active and show me the URL.

Keep your source in git

The dashboard stores the deployed source, and you can read any function back with Edit, from Studio's Edge Functions page (read-only), or with the MCP get_edge_function tool. Still, keep the source of truth in your repository, for example in the Supabase CLI layout:

supabase/functions/
  room-quote/
    index.ts
    lib/pricing.ts

You can keep running functions locally with supabase functions serve while you develop (see Local development with the Supabase CLI). Only the deploy step is different: paste the files into the dashboard, or have your agent deploy them over MCP.

Deleting a function

Click Delete on the function's row and confirm. It stops answering within about a minute and can't be restored, so keep a copy of the source first. The MCP equivalent is delete_edge_function.

Moving functions between projects

Functions aren't copied when you create a branch or import from Supabase Cloud. To copy one to another project, deploy the same files there, and add its secrets in that project too. See Copying Edge Functions between projects.

Limits

A project can have up to 100 functions. Each function can have up to 50 files, 1 MB of source in total, and folder paths up to 8 levels deep. See Edge Function limits for runtime limits.

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