Skip to main content
Glama
Perufitlife

supabase-security-mcp

by Perufitlife

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

audit_project

Scan a project. Returns JSON findings. Caches for follow-up tools.

list_findings

List cached findings, optionally filter by severity.

preview_fix

Wrap the fix SQL in BEGIN; ... ROLLBACK; and verify it would run. Safe.

apply_fix

Actually apply one finding's fix. Requires confirm: true. Re-audits to verify.

apply_all_fixes

Bulk-apply at or above a severity. Single transaction — all or nothing.

Related MCP server: postgresql-mcp

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_fix and apply_all_fixes call requires confirm: true.

  • Preview before apply. preview_fix runs the SQL inside BEGIN; ... ROLLBACK; so you see if it would error before touching state.

  • All-or-nothing bulk apply. apply_all_fixes runs everything in a single transaction. If any statement fails, the entire change rolls back.

  • Re-audit after apply. Every apply_fix re-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. (For apply_fix, you need write access.)

What it scans

Inherits all checks from supabase-security-skill:

  • Tables with RLS disabled and direct anon grants

  • SECURITY DEFINER functions executable by anon

  • Public 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:

  1. "Add a subscriptions table to my schema." → agent does it

  2. "Now scan for security issues." → agent calls audit_project

  3. Agent notices the new table has no RLS.

  4. "Want to fix?"preview_fix, then apply_fix after 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 tools
apply_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_refYes
severity_minNoMinimum severity to apply (default 'high'). Use 'critical' for safest.high
confirmYesMust be true to actually apply.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses the transactional behavior (wraps in single transaction, rolls back on failure) beyond the absent annotations. This is key behavioral information, though permissions or side effects are not mentioned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences efficiently convey purpose, transaction behavior, and usage advice with no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core operation and advice but omits return value details (no output schema) and does not reference sibling tools like 'list_findings' or 'preview_fix' for previewing, which is part of the workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67% with descriptions for severity_min and confirm. The description adds context for severity filtering ('optionally filtered by severity'), but the 'project_ref' param lacks explanation, and the description does not fully compensate for schema gaps.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'bulk-apply' and resource 'all SQL fixes', clearly distinguishing from sibling 'apply_fix' for individual fixes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It advises to 'Always preview the count and list before confirming', providing a clear usage guideline. However, it does not explicitly state when to use this tool versus alternatives like 'apply_fix'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_refYes
finding_indexYes
confirmYesMust be true to actually apply. Set to false to abort.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses that the tool applies changes (destructive), requires confirmation, and triggers an audit. More detail on side effects or permissions could improve, but current transparency is strong.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each adding essential information: purpose, requirement, and process. No fluff, front-loaded with the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema or annotations, the description covers the key context: prerequisite (preview_fix), requirement (confirm), and postcondition (audit). It lacks detail on return values or error states but is sufficient for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is low (33% with only confirm described). The description reinforces the confirm requirement but does not add meaning to project_ref or finding_index. While the description adds some value, it does not fully compensate for the undocumented parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action 'ACTUALLY APPLY a fix SQL to the project' with a strong verb and resource. It distinguishes itself from sibling tools like preview_fix and apply_all_fixes by implying it's for a single fix and requiring a prerequisite.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit usage guidelines: requires confirm=true, always run preview_fix first, and re-runs audit afterward. This provides clear when-to-use instructions and prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_refYesSupabase project ref, e.g. 'abcdefghijklmnopqrst'
tokenNoPersonal Access Token (sbp_...). Optional if SUPABASE_ACCESS_TOKEN env var is set.

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses caching and output type, but does not mention whether the operation is read-only, auth requirements beyond token, or potential side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two efficient sentences: first defines purpose with concrete examples, second notes output and caching. No redundant words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Describes output format vaguely ('findings JSON') and mentions caching for apply_fix tools, but lacks detail on return structure (no output schema) and does not explain how list_findings relates to cached results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. Description adds minimal value beyond schema descriptions (e.g., token optional with env var is already in schema). No additional parameter guidance.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Explicitly states it scans a Supabase project for security issues and lists specific categories (RLS gaps, etc.), clearly distinguishing from sibling tools that apply fixes or list findings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Mentions caching for use by apply_fix tools, hinting at a workflow, but does not explicitly state when to use versus siblings like list_findings, nor when not to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_findingsA

List findings from the last audit of a project, optionally filtered by severity. Use after audit_project to inspect specific issues.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_refYes
severityNo

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the behavioral disclosure burden. It conveys that only findings from the 'last audit' are listed, implying a session context. However, it does not describe behavior in edge cases (e.g., no prior audit, multiple audits, result format, pagination, or idempotency). The basic intent is clear but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences: first sentence defines the operation, second sentence provides usage guidance. No unnecessary words or repetition. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with 2 parameters and no output schema, the description covers the basic purpose and usage context. However, it omits details about the expected output (list of findings? fields?), error conditions (no audit found), and what constitutes 'last audit'. It is adequate but not thorough.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds that 'severity' is an optional filter, which clarifies its purpose. However, 'project_ref' (the required parameter) is not explained; the description only mentions 'a project' without specifying what format or identifier is expected. Partial but insufficient compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('List findings') and the resource ('from the last audit of a project'), with an optional filter on severity. This distinguishes it from sibling tools like 'audit_project' (which creates the audit) and 'apply_fix' (which applies fixes), making the purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly instructs to use this tool after 'audit_project' to inspect specific issues. This provides clear sequencing and context, helping the agent decide when to invoke this tool over alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
project_refYes
finding_indexYes0-based index from list_findings output

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses that the tool does not apply changes (wrapped in rollback) and is safe. With no annotations, it adequately covers the non-mutating behavioral trait.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with purpose, no wasted words. Efficiently conveys the core function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Adequate for a simple preview tool, but lacks explanation of return format or what 'returns what would have happened' means. No output schema provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 50%, but description adds no meaning for parameters. 'project_ref' lacks description in both schema and description, missing opportunity to explain its role.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool previews changes without applying, wrapping fix SQL in BEGIN...ROLLBACK. It distinguishes from siblings like apply_fix by focusing on preview-only behavior.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states it is safe to call for any finding, implying usage for testing/reviewing. Does not explicitly exclude scenarios or name alternatives, but context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.3.0
    • First observedapply_all_fixes
    • First observedapply_fix
    • First observedaudit_project
    • First observedlist_findings
    • First observedpreview_fix

TDQS

A4.2/5.0

Scored across 5 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A runtime-configurable MCP server for Supabase databases that enables dynamic tool creation through JSON configuration. Build custom database operations (select, insert, update, delete) without writing code, with built-in authentication and template support.
    5 npm
    11
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A general-purpose PostgreSQL MCP server with full read-write SQL access, atomic multi-statement transactions, and schema inspection. Works with any PostgreSQL instance — local, Supabase, AWS RDS, or self-hosted — and connects to Claude, Cursor, Windsurf, or any MCP-compatible AI client.
    45 npm
    3
    ISC
  • A
    license
    A
    quality
    A
    maintenance
    Security 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.
    39
    312 npm
    5
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    A production-ready MCP server providing AI assistants with intelligent Supabase database access, featuring dynamic schema discovery, complete user management, and file storage operations.
    1
    MIT