Safe MCP interface for running read-only analytical queries against PostgreSQL.
Sign in to vote
An MCP server that exposes a PostgreSQL database to an LLM agent in a safe, read-only mode. Includes schema introspection tools, query execution with a configurable row limit, and query explain plans. Designed to let data agents answer analytical questions without risk of data mutation.
Connects to PostgreSQL using a dedicated read-only database role (or enforces read-only via transaction isolation). All queries are validated against a whitelist of safe statement types (SELECT, EXPLAIN) before execution. Results are streamed with a configurable row limit to prevent runaway memory usage. Schema metadata is cached at startup for fast introspection.