Skip to main content
Glama
yagaMI-Reverse

schema-guard-mcp

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

audit_sql

Full audit of a SQL schema → ranked findings (severity, rule, line, fix) + verdict.

rls_coverage

Quick per-table yes/no of whether RLS is enabled.

list_rules

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 engine

The 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 Desktopclaude_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 tools
audit_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL schema / migration text to audit.

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.3/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sqlYesThe SQL schema / migration text.

TDQS

A3.6/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

  1. 3 tool updatesv1.0.0
    • First observedaudit_sql
    • First observedlist_rules
    • First observedrls_coverage

TDQS

A4.2/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: comprehensive audit, quick RLS check, and rule listing. No overlap or ambiguity between tool responsibilities.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivitySlowing
ResponsivenessSyncing

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

Related MCP Servers

  • A
    license
    A
    quality
    C
    maintenance
    MCP 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.
    5
    14
    1
    MIT
  • A
    license
    Not graded
    quality
    F
    maintenance
    Predeploy 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.
    78
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Acts as a secure bridge connecting PostgreSQL databases to AI models, enabling natural language querying, schema analysis, and controlled write operations with multi-layer security.
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enforces 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

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