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 "Install 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-mcpaudit 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: supership-scan
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.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL schema / migration text to audit. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses that the audit is static (implying no side effects) and returns a summary plus ranked findings. It does not explicitly state non-destructiveness or permissions, but 'statically' plus the nature of the tool provides adequate transparency for a read-only analysis.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and front-loaded. The first sentence states the action and target, lists the key checks, and the second sentence describes the output. No redundant information or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite lacking annotations and an output schema, the description covers the core inputs, the scope of analysis, and the return type (summary + ranked findings). It does not detail the ranking methodology or output structure, but for a single-parameter static analysis tool, it is sufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides 100% coverage of the single `sql` parameter with a clear description ('The SQL schema / migration text to audit.'). The tool description adds no additional parameter-level meaning, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('statically audit') and resource ('Postgres/Supabase SQL'), and enumerates concrete security issues it detects (missing RLS, permissive policies, broad grants, SECURITY DEFINER gaps, sensitive columns). This clearly distinguishes it from sibling tools like rls_coverage, which likely focuses narrowly on RLS coverage.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly implies when to use the tool: when you need a static security audit of SQL schema. It does not explicitly mention alternatives or exclusions, but the scope is clear enough that an agent could infer this is the broad audit tool, while siblings like rls_coverage or list_rules serve narrower purposes.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_rulesList audit rulesA
Enumerate the security checks Schema Guard runs, with id, severity, and rationale.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It accurately portrays a non-mutating enumeration operation through the verb 'enumerate' and by describing the output fields, though it never explicitly states that no checks are executed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence with no redundant words. It front-loads the action ('Enumerate') and includes essential output details without extraneous information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter list tool, the description is complete: it states the purpose and the information returned. Although there is no output schema, the description compensates by listing the output fields. No further context is needed for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the empty schema makes parameter semantics trivial. The baseline is 4, and the description correctly focuses on the output rather than parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('enumerate') and clearly identifies the resource ('security checks Schema Guard runs'). It also lists the output fields (id, severity, rationale), which differentiates it from siblings like audit_sql and rls_coverage.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description conveys what the tool does but does not explicitly mention when to use it over sibling tools. There is no guidance on alternatives or exclusions; usage is implied from the tool's purpose, but not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
rls_coverageRLS coverageA
Quick per-table yes/no of whether Row-Level Security is enabled in the given SQL.
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | The SQL schema / migration text. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden for behavioral disclosure. It mentions the tool is 'quick' and produces a 'per-table yes/no' result, but does not describe error handling, whether the SQL is executed or parsed statically, or how it treats invalid or complex SQL. This is minimal but not misleading.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the core purpose. Every word contributes value, with no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description adequately covers the high-level behavior and output shape. It lacks details like return format specifics (e.g., list vs. map) but infers that from 'per-table yes/no.' The tool's simplicity makes the description reasonably complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The sole parameter 'sql' is fully described in the input schema (100% coverage), so the description's reference to 'given SQL' adds no new meaning. The schema already explains the parameter as 'The SQL schema / migration text.' The description does not need to compensate for missing parameter info.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: providing a per-table yes/no answer on whether Row-Level Security is enabled in the given SQL. It is specific to the resource (SQL text) and uniquely identifies the tool's output, distinguishing it from siblings like a general SQL audit or rule listing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description offers no explicit guidance on when to use this tool versus alternatives, nor does it mention prerequisites, limitations, or whether it works on arbitrary SQL or only migration scripts. Usage context is only implicitly inferable from the tool's name and purpose.
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. Dates show when Glama detected each change.
3 tool updates
v1.0.0- First observed
audit_sql - First observed
list_rules - First observed
rls_coverage
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Compliance & security scan for your app: secrets, exposed files, headers, privacy, AI-disclosure.
Threat modeling, code/cloud/pipeline scanning, shadow-AI discovery, compliance checks and fixes.
Related MCP Servers
- AlicenseAqualityCmaintenanceMCP server that lets AI coding agents (Claude Code, Cursor, Cline) audit Supabase projects for security misconfigurations AND apply the fixes — without leaving the agent. Tools: audit_project, list_findings, preview_fix (BEGIN/ROLLBACK safety), apply_fix (with confirmation), apply_all_fixes (transactional bulk). Closes the audit-fix loop entirely in the agent — other Supabase scanners only report.5141MIT
- AlicenseNot gradedqualityFmaintenancePredeploy security scanner for AI-generated code. 80+ vulnerability patterns across secrets, auth, injection, config, Supabase, and logging. Runs locally, code never leaves your machine. Optional x402 witnessed attestation.78Apache 2.0
- FlicenseNot gradedqualityDmaintenanceActs as a secure bridge connecting PostgreSQL databases to AI models, enabling natural language querying, schema analysis, and controlled write operations with multi-layer security.-
- AlicenseNot gradedqualityCmaintenanceEnforces safety and governance for SQL queries executed by AI agents, providing read-only enforcement, cost estimation, and audit trails.Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yagaMI-Reverse/schema-guard-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server