supabase-mcp icon indicating copy to clipboard operation
supabase-mcp copied to clipboard

MCP Supabase Edge Function Deployment Fails with "Internal Error" for Large Functions

Open Tasktivity opened this issue 6 months ago • 0 comments

Bug report

Describe the bug

The mcp__supabase__deploy_edge_function tool fails to deploy Edge Functions that exceed a certain size threshold, returning a generic "Function deploy failed due to an internal error" message without specific details about the cause or size limits.

To Reproduce

  1. Create an Edge Function with substantial code (approximately 15KB+ TypeScript)
  2. Use the MCP Supabase tool to deploy:
mcp__supabase__deploy_edge_function({
  project_id: "your-project-id",
  name: "discover-syllabus",
  files: [{
    name: "index.ts",
    content: "// Large TypeScript function content (~15KB)"
  }]
})
  1. Observe the deployment failure
  2. See error: {"error":{"name":"Error","message":"Function deploy failed due to an internal error"}}

Expected behavior

Expected one of the following:

  1. Successful deployment of the function
  2. Clear error message indicating size limits (e.g., "Function too large: 15KB exceeds 10KB limit")
  3. Guidance on alternative deployment methods for large functions
  4. Chunked/compressed deployment handling for larger functions

Screenshots

N/A - Error occurs in MCP tool response

System information

  • OS: Linux (WSL2)
  • Browser: N/A (MCP tool via Claude Code CLI)
  • Version of supabase-js: Not directly accessible (abstracted by MCP tool)
  • Version of Node.js: v22.16.0
  • Supabase CLI: 2.26.9
  • Supabase MCP Server: ..... this is installed via npx each time the client runs.......
  • MCP Tool: @supabase/mcp-server-supabase (GitHub: supabase-community/supabase-mcp)

Additional context

  • The same function deploys successfully using npx supabase functions deploy discover-syllabus
  • The MCP tool works fine for smaller Edge Functions
  • Error message lacks specificity about root cause (size, syntax, network, etc.)
  • This creates a poor developer experience requiring fallback to manual deployment
  • The function content was valid TypeScript with proper imports and syntax
  • Project ID and authentication were valid (confirmed by successful manual deployment)

Suggested improvements:

  1. Add specific error messages for size limits
  2. Document size limitations in tool documentation
  3. Provide automatic fallback suggestions for large functions
  4. Consider chunked upload for larger functions

Tasktivity avatar Jun 22 '25 00:06 Tasktivity