Operational Architecture
PostgreSQL Read-Only MCP isolates agent queries inside a strict read-only transaction wrapper so schema discovery never triggers unintended writes or locks. By exposing only five targeted tools, initial prompt schema injection stays near 1,120 tokens.
Core Capabilities
- Enumerates schemas, tables, column nullability, and composite indexes from information_schema.
- Wraps every submitted SELECT statement in READ ONLY transaction mode with configurable statement timeouts.
- Surfaces sequential scan bottlenecks via structured EXPLAIN JSON summaries.
Recommended Security Baseline
Create a dedicated PostgreSQL role limited to SELECT on target tables rather than reusing superuser credentials. Bind connection strings through runtime environment variables rather than committing plain credentials inside workspace JSON files.