Direct query execution is the most useful thing you can hand an assistant that is writing code against a schema, and also the sharpest — this server does not restrict statements, so the database role you connect with is the boundary. Parameterised queries and connection pooling are the right foundations; the certificate path is there for managed databases that will not take an unencrypted connection.
An MCP server that executes SQL queries against a PostgreSQL database. It takes a connection string, keeps a pool open, and runs the queries a model composes — built with the Cursor agent chat in mind, so the database becomes context the assistant can consult while writing code.
- Custom SQL executed against the connected database
- Parameterised queries, so values are bound rather than concatenated into the statement
- Configurable timeouts on query execution
- Connection pooling with connection timeouts and connection-string validation
- TLS supported through `POSTGRES_SSL_CERT_PATH`, for databases that require a certificate
Node.js 18.0.0 or higher, a reachable PostgreSQL server, and network access to it. Install through the Smithery CLI in one command, or clone the repository and run `npm install` then `npm run build` and point the client at the built entry point. The connection string goes in `POSTGRES_CONNECTION_STRING`; the package is `postgresql-mcp-server`, version 0.2.0.
One command plus a key — npx -y @smithery/cli install @1Levick3/postgresql-mcp-server --client claude, then supply credentials
