The PostgreSQL MCP Server binds the Model Context Protocol to a secure PostgreSQL sandbox, providing access to a large set of tools and features for database management and interaction.
From the registry: PostgreSQL MCP server with 203 tools, connection pooling, HTTP/SSE, OAuth 2.1, and tool filtering
$ docker pull writenotenow/postgres-mcp:latestPlease install the `postgres-mcp` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **PostgreSQL 12-18** — PostgreSQL database to connect to
- **Docker (recommended) or Node.js 24+** — Docker image: writenotenow/postgres-mcp:latest; or npm install -g @neverinfamous/postgres-mcp Run: `docker pull writenotenow/postgres-mcp:latest`
Canonical MCP server config (stdio transport):
- command: `docker`
- args: ["run","--rm","-i","-e","POSTGRES_HOST","-e","POSTGRES_PORT","-e","POSTGRES_USER","-e","POSTGRES_PASSWORD","-e","POSTGRES_DATABASE","writenotenow/postgres-mcp:latest","--tool-filter","codemode"]
- required environment variables:
- `POSTGRES_HOST`: PostgreSQL host (use host.docker.internal for local PG) (example: `host.docker.internal`)
- `POSTGRES_USER`: PostgreSQL username (example: `<your-username>`)
- `POSTGRES_PASSWORD`: PostgreSQL password (example: `<your-password>`)
- `POSTGRES_DATABASE`: Database name (example: `<your-database>`)
- optional environment variables:
- `POSTGRES_PORT`: PostgreSQL port (example: `5432`)
Note: 248 tools, 23 resources, 20 prompts. Code Mode (V8 isolate) recommended for token efficiency. Supports 22 tool groups including pgvector, PostGIS, pg_cron, pgcrypto. OAuth 2.1 and HTTP transport available. Also via npx: @neverinfamous/postgres-mcp.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.POSTGRES_HOSTrequiredThe host of the PostgreSQL database.POSTGRES_PORTrequiredThe port on which the PostgreSQL database is running.POSTGRES_USERrequiredThe username for connecting to the PostgreSQL database.POSTGRES_PASSWORDrequiredThe password for the PostgreSQL user.POSTGRES_DATABASErequiredThe name of the PostgreSQL database to connect to.MCP server for interacting with the Supabase platform