A PostgreSQL database server that enables AI models to execute SQL queries, manage tables, and inspect database schemas through a standardized interface. Built with TypeScript and the MCP SDK, it features prepared statement support, automatic connection management, and support for both PostgreSQL and MySQL-style parameter placeholders. The implementation is particularly valuable for developers who want to give AI assistants secure, controlled access to PostgreSQL databases for querying and analysis tasks.
暂无评论. 成为第一个评论的人!
登录以参与讨论
Execute a read-only SQL statement. Accepts `SELECT`, `WITH ... SELECT`, `EXPLAIN`, and `SHOW`. Supports PostgreSQL-style `$1, $2` prepared-statement parameters.
List all schemas in the connected database.
List tables in the connected database. Accepts an optional schema parameter (defaults to 'public').
Get the structure of a specific table (columns, types, nullability, defaults, primary keys). Accepts an optional schema parameter (defaults to 'public').
Execute an `INSERT`, `UPDATE`, `DELETE`, or DDL statement. Requires `PG_ALLOW_WRITE=true` to perform writes.
Connect to a different PostgreSQL database at runtime using provided credentials. Requires `PG_ENABLE_RUNTIME_CONNECT=true`.