Governor SQL MCP
Provides governed, read-only access to SQLite databases through describe_entities, read_records, and aggregate_records tools. Exposes only published views as the security boundary and enforces per-user row-level security with fail-closed behavior.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Governor SQL MCP
A governed, read-only MCP server over SQL. Stand it up from nothing, point an AI agent at it, and the agent can only ever see what the caller is allowed to see. Three things matter when you expose a database to a model, and all three are enforced by construction:
Read-only by construction. Exactly three tools —
describe_entities,read_records,aggregate_records— and no write path exists anywhere in the code. Create, update, delete, and execute are absent, not merely denied.The views are the security boundary. Base tables are never exposed. The model can only see the columns a published view deliberately includes.
Per-user row-level security, fail-closed. A caller's claim resolves to a predicate. An unresolved or absent claim sees zero rows — never everything.
The engine is SQLite (standard library), so it runs anywhere with no database
server and no credentials. The security model is documented in SQL terms
(sql/03_rls.sql) and maps directly onto SQL Server SESSION_CONTEXT
predicates in a real deployment.
Quick start
pip install -e ".[mcp]" # core runs with no dependencies; mcp extra adds the server
governed-sql verify # row-level security demo (admin / manager / anonymous)
governed-sql run # start the MCP server (streamable-http on :8000)Related MCP server: sqlgate-mcp
Row-level security
Caller claim | Rows visible |
| all of them |
| only that manager's customers |
(no claim) | zero — fail closed |
Using from LangChain / LangGraph
The server speaks standard MCP, so any MCP-capable client can consume it.
LangChain exposes it through langchain-mcp-adapters:
from langchain_mcp_adapters.client import MultiServerMCPClient
client = MultiServerMCPClient({
"governed-sql": {
"url": "http://localhost:8000/mcp",
"transport": "streamable_http",
}
})
tools = await client.get_tools()
# describe_entities / read_records / aggregate_records are now typed
# LangChain tools, each bound by the caller's row-level security.Deployment
Dockerfile— multi-stage uv build, slim non-root runtime, healthcheck.infra/main.bicep— Container Apps with scale-to-zero (0–2 replicas), Log Analytics + App Insights, liveness probe. Compiles clean (az bicep build)..github/workflows/deploy.yml— GHCR build/push, Trivy scan (blocking on CRITICAL/HIGH), OIDC Bicep deploy on version tags.
Security posture
See SECURITY.md. The short version: read-only surface, fail-closed RLS,
honest withheld_count disclosure, synthetic data, no credentials in the repo
or image.
Structure
sql/ schema, published views, documented RLS policy
src/governed_sql_mcp/ db / query / server / cli
infra/main.bicep Container Apps deployment
tests/ pytest suite (RLS, masking, read-only surface)Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
PostgreSQL, MySQL, and SQL Server in one session. 26 read-only MCP tools for AI agents.
Query 40 databases from Claude, ChatGPT, or Cursor — on any device. Read-only, encrypted, audited.
Security layer for AI agents: Retrieve for controlled SQL reads, Guard for allow/deny writes.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to safely query and explore SQLite databases through read-only, guard-protected tools that block writes, sensitive table access, and runaway queries.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to query Postgres, BigQuery and DuckDB read-only through policy-checked SQL, with AST-based guards that refuse writes and dangerous functions, column masking on the way out, and an audit log of every query. Also exposes schema browsing and query-planning tools so agents can see allowed tables, columns and costs before running anything.MIT
- AlicenseAqualityBmaintenanceEnables AI agents to inspect database schemas and run strictly read-only SQL queries with guardrails against destructive statements, multi-statement chaining, and unbounded scans. Supports SQLite natively and PostgreSQL optionally.484 PyPIMIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to securely discover database schemas and execute read-only SQL queries through guardrailed tools that block mutations and clamp result sizes.MIT