Works with Claude Desktop · Claude Code · Cursor · Windsurf · any MCP host
SchemaBrain compiles every query from definitions you control — no path from a prompt to raw SQL at your database. Three guarantees that close the trust gap between AI agents and your database: - **[Read-only by architecture](#1-read-only-by-architecture-not-configuration)** — twelve MCP tools, none of which can write. No `execute()` tool, no `query()` tool, no path from agent prompt to a write at your database. - **[PII-aware refusal at retrieval](#2-pii-aware-refusal-at-the-get_metric-tool-boundary)** — PII tags propagate from the physical schema through joins and metrics. If a query touches a blocked category, SchemaBrain refuses before the database is queried. - **[Cryptographic audit chain](#3-tamper-evident-audit-log)** — every call, refusal, and recovery is recorded in a SHA256-hashed append-only log (best-effort: a disk-full or no-writer configuration logs a warning and continues rather than failing the query). `audit verify` exits non-zero if any past row was rewritten. **See it in action** — ask for something the schema can't answer, and it refuses instead of fabricating a join: > **You:** *compute usage volume by plan tier* > > **SchemaBrain → agent:** `{ "kind": "unreachable_entity", "recovery": { "suggested_tool": "resolve_join" } }` — there's no `plan_id` on usage events, so it won't invent one. > > **Claude:** I can't fake that join — here's **contracted revenue by plan tier** instead, which actually resolves. ✓ → [Full session, with the SQL and results](#sample-session) **Watch it run** — a live Postgres schema becomes a governed knowledge graph, the firewall computes the safe metric and refuses the leaks, and every call lands in a tamper-evident audit log. No agent, no API key:

Knowledge Graph — your schema as the entity-relationship projection the semantic layer compiles joins against; catastrophic-PII entities flagged, the canonical join path traced.

Overview — the whole boundary on one screen: what's bound, what's protected, what's drifted.

PII matrix — which columns carry sensitive data, and what the default policy blocks.

Refusals — every blocked call, the reason that fired, and the recovery hint the agent received.

Audit Viewer — the tamper-evident chain, verified server-side down to each row's hash linkage.

Entities — every business entity bound out of the raw schema, with PII exposure and join counts.

Data Dictionary — every table, column, type, and join, exportable to Markdown for your repo or wiki.

Policy — the block / redact / allow grid the firewall enforces, with the always-on floor disclosed.

Drift — config and enrichment drift the store can detect, each with a copy-the-CLI fix.