Sentinel MCP Data Governance Agent
Provides tools for inspecting PostgreSQL database schema, checking null ratios, and detecting logical anomalies such as negative stock counts and duplicate SKUs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Sentinel MCP Data Governance Agentaudit the raw_inventory table for data quality issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Sentinel MCP Data Governance Agent
Sentinel is a autonomous data governance agent that audits a PostgreSQL database through the Model Context Protocol (MCP). Instead of giving the LLM direct database access, the project exposes a controlled FastMCP bridge with purpose-built tools for schema inspection, null profiling, and anomaly detection.
The demo seeds an intentionally dirty raw_inventory table, asks an OpenAI-powered agent to inspect it through MCP tools, and writes a Markdown audit report to LATEST_AUDIT.md.
What It Demonstrates
A Python MCP client that follows a ReAct-style Reason -> Act -> Observe workflow.
A FastMCP server that acts as a governance bridge between the agent and PostgreSQL.
SQLAlchemy-backed tools for safe, structured database inspection.
Data quality checks for missing emails, negative inventory counts, and duplicate SKUs.
A generated Data Health Audit with remediation SQL.
Related MCP server: dbecho
Architecture
flowchart LR
U[User question] --> A[Python Agent<br/>MCP Client]
A -->|tools/list and tools/call| M[FastMCP Server<br/>Sentinel-Bridge]
M -->|SQLAlchemy queries| DB[(PostgreSQL 16<br/>raw_inventory)]
DB -->|schema and quality metrics| M
M -->|structured MCP tool results| A
A -->|OpenAI analysis or local fallback| R[LATEST_AUDIT.md]MCP Tools
inspect_schema() returns table names and column definitions for structural audits.
get_data_health_sample() returns 100 recent rows from raw_inventory for row-level review.
check_null_ratios(table_name="raw_inventory") returns null counts and percentages for every column.
find_logical_anomalies() returns rows with negative stock_count values and duplicated sku groups.
Project Layout
agent.py # MCP client and ReAct audit workflow
server.py # FastMCP server exposing database audit tools
seed_data.py # Faker-based dirty data generator
docker-compose.yml # PostgreSQL 16 local database
architecture.md # Mermaid architecture diagram
.env.example # Safe environment variable templateSetup
Requirements:
Windows 11, macOS, or Linux
Docker Desktop
Python managed with
uvAn OpenAI API key with available API quota
Create your local environment file:
Copy-Item .env.example .envEdit .env and replace placeholder values. Do not commit .env.
Install dependencies:
uv syncStart PostgreSQL:
docker compose up -dSeed the dirty inventory table:
uv run python seed_data.pyRun the MCP server directly:
uv run python server.pyIn another terminal, run the autonomous audit agent:
uv run python agent.pyThe agent writes its report to:
LATEST_AUDIT.mdVerify the Seeded Data
docker exec -it sentinel_postgres psql -U sentinel_user -d sentinel_db -c "SELECT COUNT(*) AS negative_stock_rows FROM raw_inventory WHERE stock_count < 0;"Expected result after seeding:
30Security Notes
.envis ignored by Git and must never be committed..env.examplecontains placeholders only.The LLM does not receive raw database credentials directly; it interacts with approved MCP tools.
The MCP server is the policy boundary where database capabilities are explicitly exposed.
Rotate any API key that has appeared in logs, screenshots, terminal output, or chat.
Why MCP Instead of Direct SQLAlchemy in the Agent?
MCP gives the LLM a constrained tool interface rather than unrestricted database access. The FastMCP server defines the allowed actions, making the governance boundary explicit and auditable. The same agent can later interoperate with catalogs, policy engines, warehouses, and observability systems through MCP without rewriting the agent around direct database connections.
This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
- dataOAuthco.thinair
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
- SchemaOAuthai.schemalabs
The AI that understands raw data: Schema over your tables and databases, as MCP tools.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with PostgreSQL databases through schema intelligence, query execution, and DBA tooling including index analysis and health monitoring. Features configurable access levels and audit logging for secure database operations.529 npmMIT
- AlicenseAqualityBmaintenanceAn MCP server that gives AI agents direct read-only access to PostgreSQL databases, enabling natural language analytics through tools for schema exploration, querying, trend analysis, and data quality checks.115MIT
- AlicenseNot gradedqualityCmaintenanceA read-only natural-language database agent that exposes PostgreSQL schema-discovery and SELECT tools via MCP, enabling users to query databases in plain English.MIT
- FlicenseAqualityBmaintenanceAn MCP server that enables AI agents to securely interact with PostgreSQL databases with least-privilege scopes, PII masking, and human approval for writes.4-