About Veto — SQL Safety & Cost Oracle
Veto is a remote MCP server that deterministically checks PostgreSQL statements for safety, correctness, and estimated cost before an AI coding agent runs them. It returns auditable ok, warn, or block findings without connecting to a production database or using an LLM for verdicts.
Key features
- 01Deterministic SQL safety verdicts
- 02Destructive and correctness rule checks
- 03Scratch-Postgres cost analysis with EXPLAIN
- 04Stable finding IDs for audit and CI
- 05Optional declarative organization policies
Use cases
- 01Gate agent-written SQL before execution
- 02Review migrations for destructive changes
- 03Use verdict findings to branch CI checks
MCP support
Exposes analyze_sql, plus Pro tools for setting and retrieving custom policies, through a remote streamable-HTTP MCP endpoint. SQL is analyzed without connecting to the caller's production database.
Configuration
Remote servers need no local install. Pick your client, then copy the config or install in one click.
https://vetosql.com/mcpclaude mcp add --transport http com-vetosql-veto https://vetosql.com/mcp{"mcpServers":{"com-vetosql-veto":{"type":"http","url":"https://vetosql.com/mcp"}}}Open in Cursor{"servers":{"com-vetosql-veto":{"type":"http","url":"https://vetosql.com/mcp"}}}Open in VS Code{"mcpServers":{"com-vetosql-veto":{"type":"http","url":"https://vetosql.com/mcp"}}}{"mcpServers":{"com-vetosql-veto":{"serverUrl":"https://vetosql.com/mcp"}}}Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.
Tools
3| Parameter | Type | Required | Description |
|---|---|---|---|
| sql | string | Yes | The SQL to analyze (one or more statements). |
| schema | string | No | Optional CREATE TABLE/INDEX DDL. Providing it enables EXPLAIN-based cost analysis (seq scans on large tables, etc.) on a throwaway scratch Postgres; omit it for static safety analysis only. |
| dialect | string | No | |
| rowCountHints | object | No | Optional map of table name to estimated row count for realistic cost estimates. |
Details
From the project READMEVeto — SQL Safety & Cost Oracle (MCP)
Veto is a deterministic MCP server that vets Postgres SQL for safety, correctness, and cost before an AI coding agent runs it. It returns an
ok/warn/blockverdict on every statement — no LLM in the core, and it never connects to your database.
Website: https://vetosql.com · MCP endpoint: https://vetosql.com/mcp (remote, streamable-http)
AI coding agents (Claude Code, Cursor, …) write and execute SQL. Occasionally they write DELETE FROM payments with no WHERE, or a DROP TABLE during a migration. More prompting doesn't fix a probabilistic system — a deterministic gate does. Veto is that gate: given the same statement, it returns the same verdict, every time, with stable finding ids you can audit and gate CI on.
What it catches
| Verdict | Meaning | What falls here |
|---|---|---|
block | Destructive / data loss | Unscoped DELETE/UPDATE, TRUNCATE, dropping data-bearing objects — including destructive statements hidden inside CTEs |
warn | Risky but recoverable | Lock-heavy schema changes, expensive scans, correctness traps that silently return wrong rows (= NULL, NOT IN (subquery), a LEFT JOIN filtered into an inner join), common anti-patterns like SELECT * |
ok | Safe to run | Routine, reversible migrations |
Every finding carries a stable dotted id (e.g. destructive.delete_without_where) so your pipeline can branch on it. The exact rule set lives server-side and evolves over time.
Why deterministic
- Reproducible — same input, same verdict. Testable, so trustable.
- Auditable — a named rule fired, not "the model felt it was risky."
- No drift — can't be talked out of a
blockby a clever prompt; doesn't get worse on a bad day. - Never touches your DB — cost is measured with a real
EXPLAINon a throwaway scratch Postgres inside a transaction that is always rolled back. Your production database is never connected.
Tools
analyze_sql
Returns a deterministic safety + cost verdict for Postgres SQL / migrations.
| Input | Type | Notes |
|---|---|---|
sql | string | The SQL / migration to analyze — one or more statements (required) |
schema | string? | Optional CREATE TABLE/INDEX DDL — enables EXPLAIN-based cost analysis on scratch Postgres |
rowCountHints | object? | Optional map of table name → estimated row count, for realistic cost estimates |
Returns { verdict, findings[], plan?, meta } where verdict ∈ ok | warn | block.
set_policies (Pro)
Stores custom org policies keyed to your Pro key; analyze_sql then enforces them on top of the built-in rules. Policies are declarative data — validated and never executed (max 50, replaces the previously stored set).
Each policy: table (exact name or glob, e.g. payments, audit_*, *), operations (any of select/insert/update/delete/truncate/drop/alter), action (block/warn), optional message.
{
"policies": [
{ "table": "payments", "operations": ["delete", "truncate"], "action": "block",
"message": "Never delete from payments — use the refund flow." }
]
}
Sending the full set updates it; sending an empty array clears it.
get_policies (Pro)
Returns the custom org policy set currently stored for your key — the same rules analyze_sql enforces on top of the built-ins. Read-only; returns an empty list if none are set.
Setup
Veto is a remote MCP server — no install, no source needed. Point your client at the endpoint.
Claude Code — .mcp.json
{
"mcpServers": {
"veto": {
"type": "http",
"url": "https://vetosql.com/mcp"
}
}
}
Cursor — ~/.cursor/mcp.json
{
"mcpServers": {
"veto": {
"url": "https://vetosql.com/mcp"
}
}
}
The free tier needs no key (60 req/min). Pro: add your VETO-… key as a bearer token (keep the word Bearer and the space):
"headers": { "Authorization": "Bearer VETO-…" }
Pricing
| Tier | Price | Limits | Extras |
|---|---|---|---|
| Free | €0 | 60 req/min | Full deterministic verdict — all destructive, locking, correctness & cost rules |
| Pro | €9.90 / mo | 1200 req/min | Custom org policies (set_policies), maintainer support |
Subscribe at vetosql.com.
FAQ
What databases does Veto support? PostgreSQL. Works with any Postgres host (Supabase, Neon, RDS, self-hosted) and any migration tool, because Veto analyzes the SQL text — it doesn't connect to your database.
Is it safe? Can it see or modify my data? No. Veto never connects to your production database. Cost analysis runs inside a transaction that is always rolled back, against a separate scratch Postgres — no data is read or written.
How is Veto different from a linter like Squawk or sqlfluff?
Those are CI/style tools. Veto is a real-time runtime gate an AI agent calls over MCP, returning an ok/warn/block verdict on the exact statement it's about to execute — plus cost estimation and custom org policies.
Why not just give the agent a read-only or restricted DB role?
Roles are coarse and easy to misconfigure, and they don't catch a costly sequential scan or a full-table UPDATE inside a write-allowed role. Veto adds a statement-level verdict on top of whatever roles you use.
Does it use an LLM?
No. The core is deterministic static analysis + EXPLAIN. The calling agent narrates the structured verdict; the verdict itself never comes from a model.
Links
- Website: vetosql.com
- Blog: An AI agent wiped a production database. The fix isn't a better prompt.
- MCP endpoint:
https://vetosql.com/mcp - Official MCP registry:
com.vetosql/veto - Glama: glama.ai/mcp/connectors/com.vetosql/veto
Built by Metawear. The hosted service runs at vetosql.com; this repository is the public documentation and MCP registry manifest for the Veto server.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.