Drizzle Sentinel MCP
🛡️ Drizzle Sentinel MCP
Produktionsreifer TypeScript-MCP-Server für Drizzle-ORM-Schema-Inspektion, Migrations-Sicherheits-Linting und Schema-Drift-Erkennung.
🌟 Überblick & Zweck
Autonome Coding-Agenten (Claude Code, Cursor, Codex) halluzinieren häufig oder generieren unsichere Datenbankmigrationen – etwa das Hinzufügen von NOT NULL-Spalten ohne Standardwerte, das Entfernen aktiver Spalten oder das Vergessen von Indizes auf Fremdschlüsseln.
Drizzle Sentinel MCP wurde für moderne TypeScript-Engineering-Stacks (Turborepo + Drizzle ORM + Express / Next.js) entwickelt. Es integriert eine geschlossene Datenbank-Governance-Schleife direkt in agentische Entwicklungsworkflows über das offizielle Model Context Protocol.
Related MCP server: dryrun
🏗️ Systemarchitektur
graph TD
Agent[Agentic IDE / Claude Code / Cursor] -->|MCP Protocol / stdio| Sentinel[🛡️ Drizzle Sentinel MCP Server]
subgraph Tools [MCP Governance Toolsuite]
Sentinel --> T1[🔍 inspect_drizzle_schema]
Sentinel --> T2[🚨 lint_drizzle_migration]
Sentinel --> T3[🩺 detect_schema_drift]
Sentinel --> T4[⚡ explain_query_plan]
end
T1 --> Parser[Drizzle Schema AST Parser]
T2 --> Engine[Rules Engine: NO_DROP, DEFAULT_ON_NOT_NULL, UNINDEXED_FK]
T3 --> Drift[Drift Doctor & Safe Patch Generator]
T4 --> Sandbox[Read-Only Query Sandbox & Smell Detector]
Parser --> AppCode[TypeScript Drizzle Schemas]
Engine --> Migrations[Drizzle Migration .sql Files]
Drift --> Database[(PostgreSQL / SQLite / MySQL)]🛠️ Bereitgestellte MCP-Tools
inspect_drizzle_schema: Analysiert TypeScript-Drizzle-Schemas eingehend, bildet Tabellen und Beziehungen ab und identifiziert Fremdschlüssel ohne Indexabdeckung.lint_drizzle_migration: Bewertet SQL-Migrationsanweisungen anhand von Produktionssicherheitsregeln:NO_RAW_DROP_TABLE: Blockiert destruktive Tabellenlöschungen.NO_RAW_DROP_COLUMN: Erzwingt Expand-Contract-Migrationen.REQUIRE_DEFAULT_ON_NOT_NULL: Verhindert Migrationsfehler und Tabellensperren bei bestehenden Tabellen.NO_UNINDEXED_FOREIGN_KEYS: Warnt bei fehlender FK-Indexabdeckung.
detect_schema_drift: Vergleicht das deklarierte TypeScript-Schema mit Live-Datenbanktabellen, lokalisiert fehlende Spalten/Tabellen und generiert nicht-brechendes Remediation-SQL ohne Ausfallzeiten.explain_query_plan: Erzwingt eine strikte Read-only-Ausführungssandbox und kennzeichnet Performance-Probleme (MISSING_LIMIT,WILDCARD_PROJECTION,SORT_MEMORY_RISK).
📁 Repository-Struktur
drizzle-sentinel-mcp/
├── packages/
│ ├── mcp-server/ # TypeScript MCP server implementation
│ │ ├── src/tools/ # Tool handlers (inspect, lint, drift, sandbox)
│ │ ├── src/services/ # AST & schema parsers
│ │ └── src/index.ts # Stdio server entrypoint
│ └── rules-engine/ # AST & regex defensive migration rules
├── apps/
│ └── demo-service/ # Express + Drizzle ORM reference application
├── tests/ # Vitest comprehensive unit & integration test suite
├── turbo.json # Turborepo task pipeline
├── CLAUDE.md # Agentic guidelines & operating rules
└── README.md🚀 Schnellstart & Einrichtung
1. Abhängigkeiten installieren und Build ausführen
npm install
npm run build2. Test-Suite ausführen
npm test3. Bei Claude Code / Cursor MCP-Konfiguration registrieren
Fügen Sie den Server zu Ihrer claude_desktop_config.json oder .cursor/mcp.json hinzu:
{
"mcpServers": {
"drizzle-sentinel": {
"command": "node",
"args": ["<path-to-repo>/packages/mcp-server/dist/index.js"]
}
}
}Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Database intelligence, AST SQL injection auditing, query optimization & schema guards.
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Review your AI agent's database changes on your schema, with plain-language risk, before they run.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides database schema management, query execution, and schema introspection through Drizzle ORM and drizzle-kit CLI tools, supporting SQLite and PostgreSQL.516MIT
- AlicenseNot gradedqualityBmaintenanceGives AI coding assistants, IDEs, and CI full PostgreSQL schema intelligence from an offline snapshot, enabling linting, query validation, migration safety analysis, and foreign key graph exploration without ever exposing database credentials.36BSD 2-Clause "Simplified"
- AlicenseNot gradedqualityBmaintenanceExposes read-only tools that let AI assistants detect schema drift, analyze lock impact, verify data with checksums, and plan safe PostgreSQL migrations that are validated by deterministic checks and shadow runs.37 npmApache 2.0
- AlicenseBqualityCmaintenanceEnables AI coding agents to perform deterministic database architecture audits and performance engineering for PostgreSQL and MySQL, covering migration analysis with schema health scoring, ESR-based composite index recommendations, N+1 query detection, EXPLAIN plan diagnosis, transaction and deadlock analysis, partitioning and archival design, and capacity or configuration tuning. It also generates phased Expand & Contract runbooks that turn blocking DDL into zero-downtime production migrations.8MIT