Drizzle Sentinel MCP
🛡️ Drizzle Sentinel MCP
面向 Drizzle ORM 的生产级 TypeScript MCP 服务器,用于 Schema 检查、迁移安全 lint 和 Schema 漂移检测。
🌟 概述与目的
自主编码代理(Claude Code、Cursor、Codex)经常产生幻觉或生成不安全的数据库迁移——例如添加没有默认值的 NOT NULL 列、删除活跃列,或忘记为外键创建索引。
Drizzle Sentinel MCP 专为现代 TypeScript 工程栈(Turborepo + Drizzle ORM + Express / Next.js)而构建。它通过官方 Model Context Protocol 将闭环数据库治理直接注入代理开发工作流。
Related MCP server: schema-lint-mcp
🏗️ 系统架构
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 工具
inspect_drizzle_schema:深度分析 TypeScript Drizzle schema,映射表、关系,并识别缺少索引覆盖的外键。lint_drizzle_migration:根据生产安全规则评估 SQL 迁移语句:NO_RAW_DROP_TABLE:阻止破坏性的表删除。NO_RAW_DROP_COLUMN:强制执行扩展-收缩迁移。REQUIRE_DEFAULT_ON_NOT_NULL:防止现有表上的迁移失败和表锁。NO_UNINDEXED_FOREIGN_KEYS:警告缺少外键索引覆盖。
detect_schema_drift:将声明的 TypeScript schema 与实时数据库表进行比较,精确定位缺失的列/表,并生成非破坏性的零停机修复 SQL。explain_query_plan:强制执行严格的只读执行沙箱,并标记性能问题(MISSING_LIMIT、WILDCARD_PROJECTION、SORT_MEMORY_RISK)。
📁 仓库结构
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🚀 快速开始与设置
1. 安装依赖并构建
npm install
npm run build2. 运行测试套件
npm test3. 注册到 Claude Code / Cursor MCP 配置
将服务器添加到你的 claude_desktop_config.json 或 .cursor/mcp.json:
{
"mcpServers": {
"drizzle-sentinel": {
"command": "node",
"args": ["<path-to-repo>/packages/mcp-server/dist/index.js"]
}
}
}This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceGive AI agents structured database intelligence. Deterministic SQL, NULL trap detection, EXPLAIN pre-flight. MIT licensed.1MIT
- FlicenseBqualityDmaintenanceValidates schema files against customizable lint rules using Claude or Gemini AI, supporting JSON and SQL schemas with rules for naming, structure, and migration safety.1
- AlicenseAqualityDmaintenanceAnalyzes database migrations for risks like lock contention and data loss before they run. Supports Flyway and Liquibase formats, providing risk scores and rollback generation.640MIT
- FlicenseBqualityFmaintenanceProvides database schema management, query execution, and schema introspection through Drizzle ORM and drizzle-kit CLI tools, supporting SQLite and PostgreSQL.515
Related MCP Connectors
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
Manage Supabase projects end to end across database, auth, storage, realtime, and migrations. Moni…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/akmalkhaniub/drizzle-sentinel-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server