A single query tool is a smaller surface than a schema-plus-query-plus-execute server, and for a production RDS instance that is the right trade — the model cannot write, and the schema is still discoverable through ordinary catalogue queries. Give it a database user with read grants on exactly the schemas you want visible; the server's read-only check is a floor, not your access policy.
A Node MCP server that opens a connection to a PostgreSQL database on AWS and exposes one tool for running read queries against it.
- A `query` tool taking `sql` and returning the rows
- Read-only enforcement: only SELECT, SHOW and similar statements are allowed
- Credentials supplied through the client's env block rather than living in the code
- Enough access to introspect the schema — querying information_schema tells the model what exists before it writes anything else
`pnpm install` then `pnpm run build`. Configure `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER` and `DB_PASSWORD` in the client's env block, and point the command at the built build/index.js with an absolute path over stdio.
