The MCP PostgreSQL Server is a real MCP server implementation that exposes PostgreSQL access to MCP-compatible AI clients for schema discovery and query-driven workflows.
- Repository:
modelcontextprotocol/servers-archived (archived official reference servers)
- Common package:
@modelcontextprotocol/server-postgres
- Status: Archived reference server in the official MCP servers ecosystem
- List databases, schemas, tables, and columns
- Run read queries against allowed databases
- Provide schema metadata as resources
- Execute write queries (optional and usually discouraged)
- AI-assisted analytics and reporting
- Database schema exploration
- Internal support tools that query operational data
npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb
- Use dedicated database users with least privilege
- Prefer read-only roles for AI access
- Restrict network access to trusted hosts
- Log queries and enforce timeouts
- Review archived status before production use