Database Architect Prover MCP Connector for Claude
A+An AI agent designed a database schema with no indexes on search columns, no foreign keys, and a VARCHAR(255) for every field. Query response time went from 200ms to 14 seconds after 500K rows. Table locks during updates froze the application for 8 minutes. This tool forces 3NF normalization, index strategies mapped to access patterns, explicit foreign key constraints, and partition planning for high-volume tables.
LLMs generate database schemas that work on day one with 100 rows. By month three with 500K rows, queries take 14 seconds, UPDATE statements lock the entire table, and orphaned records pile up because nobody defined foreign keys. The schema worked. The architecture didn't.
The Problem
AI-generated database schemas commit four structural violations that compound over time:
- Normalization Violations — Storing user addresses inside the orders table. Duplicating email columns across three tables. The agent treats normalization as optional. Every duplicate is a future inconsistency.
- Query Blindness — No indexes on
WHEREclauses. No composite indexes for multi-column filters. The schema has 20 tables and zero index definitions. Every query becomes a full table scan at scale. - Orphaned Relations — No foreign keys. No cascade rules. Delete a user and their 10,000 orders remain as ghost data. Referential integrity is not enforced — it's hoped for.
- Scaling Ignorance — INT for a primary key that will exceed 2.1 billion. VARCHAR(255) for a field that stores 'yes' or 'no'. No partition strategy for tables growing at 1M rows/month. The schema breaks silently at scale.
How It Works
4 Decision Pivots govern the schema validation:
- normalizationChecked — Is the schema in 3NF? Are denormalization decisions explicitly justified with access pattern rationale?
- indexesProposed — Does every
WHERE,JOIN, andORDER BYcolumn have a corresponding index? Are composite indexes defined for multi-column queries? - relationshipsEnforced — Are foreign keys defined with explicit
ON DELETEandON UPDATEcascade rules? No implicit relationships. - scalabilityAddressed — Are datatypes sized for growth (BIGINT vs INT)? Are partition strategies defined for tables exceeding 10M rows?
The Verdict Matrix
| First Failing Pivot | Verdict | Meaning |
|---|---|---|
| normalizationChecked = false | NORMALIZATION_VIOLATED | Redundant data. Inconsistencies guaranteed at scale. |
| indexesProposed = false | QUERY_BLIND | No index strategy. Full table scans at scale. |
| relationshipsEnforced = false | ORPHAN_PRONE | No foreign keys. Data integrity is a wish, not a constraint. |
| scalabilityAddressed = false | SCALE_UNPLANNED | Schema breaks at volume. Integer overflows and full scans incoming. |
| All pivots pass | SCHEMA_PROVEN | Normalized, indexed, constrained, and scaled for production. |
Why It Works
- Tool calls are obligations. The agent cannot claim indexes are defined without naming them. Filling the fields IS the schema design.
- Consistency engine catches contradictions. Claiming
indexesProposed=truebut listing zero index definitions triggers rejection. - Semantic traps detect lazy answers. 'The ORM handles indexing,' 'we'll optimize later,' or 'the database auto-manages constraints' all trigger automatic rejection.
Related Connectors
SQL Migration Safety Analyzer MCP
Validate SQL migrations for structural risks, rollback integrity, and unbounded deletions.
Technical Writing Prover MCP
An AI wrote API documentation for 'developers.' No expertise level. No prerequisites. A wall of text with no headings. Code examples that referenced a deprecated method — untested. Passive voice throughout: 'it is recommended that the configuration be updated.' A junior engineer followed the docs, deployed to production with the wrong config, and caused a 4-hour outage. This tool forces audience definition, task-based structure, tested examples, ambiguity elimination, and completeness verification.
Database Migration Safety Analyzer MCP
Detect destructive SQL and ORM migration patterns to prevent production data loss.
Hallucination Detector Prover MCP
LLMs present fabricated information as fact. This tool forces epistemic rigor: cite verifiable sources for every claim, quantify confidence per assertion, separate facts from opinions, declare knowledge boundaries, and cross-reference for internal contradictions.