deploy_edge_function
Deploys an Edge Function to a Supabase project. If the function already exists, this will create a new version. Example: import "jsr:@supabase/functions-js/edge-runtime.d.ts"; Deno.serve(async (req: Request) => { const data = { message: "Hello there!" }; return new Response(JSON.stringify(data), ...
This record as markdown: /tools/supabase/deploy-edge-function.md
What deploy_edge_function does on Supabase
AI agents invoke deploy_edge_function to trigger actions in Supabase. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | — | The name of the function |
files | array | — | The files to upload. This should include the entrypoint, deno.json, and any relative dependencies. Include the deno.json and deno.jsonc files to configure the D |
project_id | string | — | |
verify_jwt | boolean | — | Whether to require a valid JWT in the Authorization header. You SHOULD ALWAYS enable this to ensure authorized access. ONLY disable if the function previously h |
entrypoint_path | string | — | The entrypoint of the function |
import_map_path | string | — | The import map for the function. |
Parameters from the server's own tool schema.
Why deploy_edge_function is rated High
This tool executes arbitrary code in a serverless environment (Supabase Edge Functions). While deployment itself is reversible, the executed function can perform any action accessible from the edge runtime—making external API calls, accessing databases, modifying data, or triggering side effects.
From the tool's definition Deploys an Edge Function to a Supabase project. If the function already exists, this will create a new version. The example shows arbitrary code (Deno script) that can be executed in the edge runtime.
Risk signalsAccepts raw HTML/template content (files[].content)
Attacks that exploit this kind of access
The rule that runs deploy_edge_function safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Supabase, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For deploy_edge_function, this is the rule to start with:
deploy_edge_function stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Supabase, apply this rule, and every deploy_edge_function call is checked against it from then on.
Questions about deploy_edge_function
Deploys an Edge Function to a Supabase project. If the function already exists, this will create a new version. Example: import "jsr:@supabase/functions-js/edge-runtime.d.ts"; Deno.serve(async (req: Request) => { const data = { message: "Hello there!" }; return new Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json', 'Connection': 'keep-alive' } }); });. It is categorised as a Execute tool in the Supabase MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
deploy_edge_function accepts 6 parameters: name, files, project_id, verify_jwt, entrypoint_path, import_map_path. The full parameter table on this page comes from the server's own tool schema.
Register the Supabase MCP server in PolicyLayer and add a rule for deploy_edge_function: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Supabase. Nothing to install.
deploy_edge_function is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the deploy_edge_function rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for deploy_edge_function. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
deploy_edge_function is provided by the Supabase MCP server (@modelcontextprotocol/server-supabase). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Supabase, and thousands of servers like it.
Across the catalogue