supabase-security-mcp
Provides tools to audit Supabase projects for security vulnerabilities, preview and apply SQL fixes, and re-audit to verify fixes.
supabase-security-mcp
The only Supabase security tool that closes the loop in your AI agent. Audit, preview the fix, and apply it — without leaving Claude / Cursor / Cline.
You: audit my supabase project rkmrsefraqssuyuniyco
Claude: Found 17 critical leaks. Want me to apply all SQL fixes?
Run preview_fix on each first?
You: preview them all, then apply if safe.
Claude: [previews each]
All 17 fixes preview cleanly. Applying...
Done. Re-audited: 0 critical findings remaining.Other Supabase scanners (SupaExplorer, AuditYourApp, Vibe App Scanner) report. None of them remediate. This one does.
Tools
Tool | What it does |
| Scan a project. Returns JSON findings. Caches for follow-up tools. |
| List cached findings, optionally filter by severity. |
| Wrap the fix SQL in |
| Actually apply one finding's fix. Requires |
| Bulk-apply at or above a severity. Single transaction — all or nothing. |
Related MCP server: airis-mcp-supabase-selfhost
Install
Claude Desktop / Claude Code
Add to your MCP config (~/.claude.json or claude_desktop_config.json):
{
"mcpServers": {
"supabase-security": {
"command": "npx",
"args": ["-y", "@perufitlife/supabase-security-mcp@latest"],
"env": {
"SUPABASE_ACCESS_TOKEN": "sbp_your_personal_access_token"
}
}
}
}Get a token at https://supabase.com/dashboard/account/tokens (read+write to your projects).
Cursor
Settings → MCP → Add new MCP server → paste the same JSON object as above.
Cline / Continue / etc.
Anything that supports MCP stdio servers will work — point it at npx -y @perufitlife/supabase-security-mcp@latest with the env var set.
Safety model
Never auto-applies. Every
apply_fixandapply_all_fixescall requiresconfirm: true.Preview before apply.
preview_fixruns the SQL insideBEGIN; ... ROLLBACK;so you see if it would error before touching state.All-or-nothing bulk apply.
apply_all_fixesruns everything in a single transaction. If any statement fails, the entire change rolls back.Re-audit after apply. Every
apply_fixre-runs the audit and reports whether the finding is actually gone — protects against fix-that-doesn't-fix.Read-only by default for
audit_project. Token can be a read-only PAT if you only want to scan, never remediate. (Forapply_fix, you need write access.)
What it scans
Inherits all checks from supabase-security-skill:
Tables with RLS disabled and direct anon grants
SECURITY DEFINERfunctions executable by anonPublic storage buckets
Default privileges still granting CRUD to anon
Auth signups with autoconfirm enabled
Defense-in-depth: RLS-locked tables with stale anon grants
Why MCP and not just a CLI
CLIs are great. They're not in your AI agent's context. When you're vibing with Claude in your IDE, asking "is my supabase tight?" should get an actual scan, not a "you should run this command on your laptop."
The flow this enables:
"Add a
subscriptionstable to my schema." → agent does it"Now scan for security issues." → agent calls
audit_projectAgent notices the new table has no RLS.
"Want to fix?" →
preview_fix, thenapply_fixafter you say yes.
That round-trip is the actual product. The audit is just step 2.
Roadmap
Cron job audit (
pg_cron)Edge function secrets scan
Storage object-level RLS scan
HTML report generation as a tool (returns base64 + filename)
CORS configuration check
License
MIT.
Available Tools
5 toolsapply_all_fixesA
Bulk-apply all SQL fixes from last audit, optionally filtered by severity. Wraps everything in a single transaction — if any statement fails, everything rolls back. Always preview the count and list before confirming.
Inputs: project_ref (required), confirm (required), severity_min.
apply_fixA
ACTUALLY APPLY a fix SQL to the project. Requires confirm=true. Always run preview_fix first. Re-runs audit afterward to verify the finding is gone.
Inputs: project_ref (required), finding_index (required), confirm (required).
audit_projectA
Scan a Supabase project for security issues: RLS gaps, exposed SECURITY DEFINER functions, public buckets, default-privilege leaks, and unsafe auth config. Returns findings JSON. Caches result for use by apply_fix tools.
Inputs: project_ref (required), token.
list_findingsA
List findings from the last audit of a project, optionally filtered by severity. Use after audit_project to inspect specific issues.
Inputs: project_ref (required), severity.
preview_fixA
Preview what a fix would change WITHOUT applying it. Wraps the fix SQL in BEGIN; ... ROLLBACK; and returns what would have happened. Safe to call for any finding.
Inputs: project_ref (required), finding_index (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool has a clear, distinct purpose: auditing, listing findings, previewing fixes, applying a single fix, and bulk-applying fixes. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern (e.g., audit_project, list_findings, preview_fix, apply_fix, apply_all_fixes), making the API predictable and easy to navigate.
With 5 tools, the server is well-scoped for its purpose of security auditing and fix application. Each tool is necessary, and the count is neither too few nor excessive.
The tool set covers the full workflow: audit, inspect findings, preview fixes, apply individual fixes, and bulk apply. There are no obvious missing operations for this domain.
Maintenance
Related MCP Connectors
Supabase RLS simulator, app key-leak check, email sender check, DMARC and payment-fraud checks.
Finds personal-data leaks in Supabase/Lovable apps: free RLS and headers checks, proven fixes.
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Related MCP Servers
- AlicenseBqualityBmaintenanceSecurity MCP server with 300+ rules for AI-generated code. Scans Next.js, Supabase, Clerk, Stripe, Prisma, Hono, GraphQL and 20+ modules. Zero config, runs locally.391,074 npm6Apache 2.0
- AlicenseNot gradedqualityFmaintenanceMCP server for self-hosted Supabase with RLS-aware PostgreSQL and PostgREST layers, enabling safe database introspection, SQL queries, and PostgREST access via natural language.MIT
- AlicenseAqualityBmaintenanceStatic security scanner for AI-generated (vibe-coded) Supabase and Next.js apps. Runs as an MCP server so an LLM can scan, explain findings, and produce fixes while it writes code, all locally and offline.529 npm1MIT
- AlicenseBqualityBmaintenanceRead-only security audit for Supabase. Surfaces RLS gaps, permissive policies, exposed functions and grants, and returns scored findings with fix SQL that is never executed.450MIT