Drizzle Sentinel MCP

Drizzle Sentinel MCP

Enables database governance for Drizzle ORM projects by inspecting schemas, linting migrations for unsafe operations, detecting schema drift, and explaining query plans with performance checks.

Category
Visit Server

README

šŸ›”ļø Drizzle Sentinel MCP

Production-Grade TypeScript MCP Server for Drizzle ORM Schema Inspection, Migration Safety Linting, and Schema Drift Detection.

TypeScript Turborepo Drizzle ORM MCP v1 Vitest


🌟 Overview & Purpose

Autonomous coding agents (Claude Code, Cursor, Codex) frequently hallucinate or generate unsafe database migrations — such as adding NOT NULL columns without default values, dropping active columns, or forgetting indexes on foreign keys.

Drizzle Sentinel MCP is built for modern TypeScript engineering stacks (Turborepo + Drizzle ORM + Express / Next.js). It injects closed-loop database governance directly into agentic development workflows via the official Model Context Protocol.


šŸ—ļø System Architecture

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)]

šŸ› ļø MCP Tools Provided

  1. inspect_drizzle_schema: Deeply analyzes TypeScript Drizzle schemas, mapping tables, relations, and identifying foreign keys lacking index coverage.
  2. lint_drizzle_migration: Evaluates SQL migration statements against production safety rules:
    • NO_RAW_DROP_TABLE: Blocks destructive table drops.
    • NO_RAW_DROP_COLUMN: Enforces expand-contract migrations.
    • REQUIRE_DEFAULT_ON_NOT_NULL: Prevents migration failures & table locks on existing tables.
    • NO_UNINDEXED_FOREIGN_KEYS: Warns on missing FK index coverage.
  3. detect_schema_drift: Compares declared TypeScript schema with live database tables, pinpointing missing columns/tables and emitting non-breaking zero-downtime remediation SQL.
  4. explain_query_plan: Enforces a strict read-only execution sandbox and flags performance smells (MISSING_LIMIT, WILDCARD_PROJECTION, SORT_MEMORY_RISK).

šŸ“ Repository Structure

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

šŸš€ Quickstart & Setup

1. Install Dependencies & Build

npm install
npm run build

2. Run Test Suite

npm test

3. Register with Claude Code / Cursor MCP Config

Add the server to your claude_desktop_config.json or .cursor/mcp.json:

{
  "mcpServers": {
    "drizzle-sentinel": {
      "command": "node",
      "args": ["<path-to-repo>/packages/mcp-server/dist/index.js"]
    }
  }
}

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured