schema-guard-mcp
Provides tools to audit Postgres / Supabase SQL schemas for security issues such as missing RLS, permissive policies, and broad grants.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@schema-guard-mcp audit my SQL schema for security issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Schema Guard — MCP server
A Model Context Protocol server that gives an AI agent (Claude Desktop, Claude
Code, or any MCP client) tools to audit Postgres / Supabase SQL for security
issues — mid-conversation, with structured results. Point it at a schema and it
flags missing RLS, permissive policies, broad grants, SECURITY DEFINER
search_path gaps, and secrets in client-readable tables.
Built to show MCP / agent tool-use, and tuned to the exact mistakes that no-code exports ship with.
Tools it exposes
Tool | What it does |
| Full audit of a SQL schema → ranked findings (severity, rule, line, fix) + verdict. |
| Quick per-table yes/no of whether RLS is enabled. |
| The checks it runs, with rationale. |
Related MCP server: airlock-rls-mcp
Checks
RLS-001 table without RLS · RLS-002 RLS on but no policy · POL-001 USING (true)
policy · GRANT-001 broad grant to anon/public · SECDEF-001 SECURITY DEFINER
without pinned search_path · COL-001 sensitive column in a client-readable table.
Run the live demo
npm install
npm run demo # spawns the server, does the MCP handshake, audits a sample schema
npm test # 10 assertions on the audit engineThe demo is a real MCP client (@modelcontextprotocol/sdk) speaking to the server
over stdio — the same handshake Claude performs. It finds 7 issues (2 critical)
in fixtures/vulnerable-schema.sql and prints the fix for each.
Wire it into Claude
Claude Desktop — claude_desktop_config.json:
{
"mcpServers": {
"schema-guard": {
"command": "node",
"args": ["C:/path/to/35-schema-guard-mcp/src/server.js"]
}
}
}Claude Code — .mcp.json in your project:
{
"mcpServers": {
"schema-guard": { "command": "node", "args": ["./src/server.js"] }
}
}Then just ask Claude: “audit this schema for RLS gaps” and paste your SQL — it
calls audit_sql and reports back.
Stack
Node (ESM) · @modelcontextprotocol/sdk (stdio transport) · zod · zero external
services, deterministic output.
Available Tools
3 toolsaudit_sqlAudit SQL schemaA
Statically audit Postgres/Supabase SQL for security issues: tables missing RLS, permissive policies, broad grants to anon/public, SECURITY DEFINER search_path gaps, and sensitive columns in client-readable tables. Returns a summary + ranked findings.
Inputs: sql (required).
list_rulesList audit rulesA
Enumerate the security checks Schema Guard runs, with id, severity, and rationale.
Inputs: no named parameters.
rls_coverageRLS coverageA
Quick per-table yes/no of whether Row-Level Security is enabled in the given SQL.
Inputs: sql (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: comprehensive audit, quick RLS check, and rule listing. No overlap or ambiguity between tool responsibilities.
All tool names follow a consistent verb_noun pattern with lowercase and underscores (audit_sql, rls_coverage, list_rules). Naming style is uniform and predictable.
Three tools is well-scoped for a focused SQL security auditing server. Each tool serves a necessary and non-redundant function without bloat or thinness.
The domain of static SQL security auditing is fully covered: full audit, quick subset check, and rule enumeration. No obvious missing operations for the server's stated purpose.
Maintenance
Related MCP Connectors
Finds personal-data leaks in Supabase/Lovable apps: free RLS and headers checks, proven fixes.
Supabase RLS simulator, app key-leak check, email sender check, DMARC and payment-fraud checks.
Check Supabase SQL for who can read and write each table: RLS gaps, open policies, grants, fix SQL.
Security checks for Next.js + Supabase apps: code scan, read-only live DB check, fix confirmation.
Related MCP Servers
- 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.451MIT
- AlicenseAqualityBmaintenanceScan a deployed site for an exposed Supabase service_role key and audit Row Level Security from your AI coding agent.10316 npmMIT
- AlicenseAqualityCmaintenanceEnables AI coding assistants to check whether an API key is safe to expose, audit Supabase Row Level Security, generate owner-based RLS policy templates, and run a builder-specific pre-launch security checklist. Runs locally over stdio with no network calls, telemetry, or file access.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI coding agents to audit Supabase or Postgres databases for Row Level Security and multi-tenant isolation holes, reading tables, grants, policies and functions for static findings and optionally probing those policies inside a rolled-back transaction. It reports each hole with an explanation and a fix, so an agent can verify the migrations it just wrote before declaring them done.1MIT