The PostgreSQL MCP Server binds the Model Context Protocol to a secure PostgreSQL sandbox, enabling efficient access to a large set of tools and features for database management and AI integration.
From the registry: Enterprise PostgreSQL MCP server with 63 tools, 10 resources, 10 prompts for AI-native operations
$ docker pull writenotenow/postgres-mcp:latestPlease install the `postgres-mcp-server` 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 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 (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>`)
Note: Same as postgres-mcp slug — same repo (neverinfamous/postgres-mcp). 248 tools, 23 resources, 20 prompts. Code Mode (V8 isolate) recommended.
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 hostname of the PostgreSQL server.POSTGRES_PORTrequiredThe port number on which the PostgreSQL server 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.Minimal, token-efficient Database MCP Server for PostgreSQL, MySQL, SQL Server, SQLite, MariaDB