postgres-mcp
Verified Safeby neverinfamous
Overview
A PostgreSQL database management and optimization expert system, offering interactive workflows for query analysis, index tuning, health monitoring, backup strategies, and advanced functionalities like vector search and geospatial data management. It helps users understand and improve their PostgreSQL database performance and health.
Installation
docker run -i --rm -e "DATABASE_URI=<your_postgresql_connection_string>" writenotenow/postgres-mcp-enhanced:latest --access-mode=restrictedEnvironment Variables
- DATABASE_URI
- POSTGRES_MCP_TOOL_FILTER
Security Notes
The server features a robust `SafeSqlDriver` that, when operating in `RESTRICTED` access mode (the recommended deployment default), explicitly forbids DDL (CREATE, ALTER, DROP, TRUNCATE), DML (INSERT, UPDATE, DELETE), and other administrative statements, limiting operations primarily to `SELECT`. Even in `UNRESTRICTED` mode, the `execute_sql` tool includes basic SQL injection pattern detection for non-parameterized queries. Password obfuscation is applied to connection errors to prevent credential exposure. No use of `eval` or similar high-risk functions with untrusted input was identified. The `tool_filtering` mechanism further allows administrators to control exposed functionality.
Similar Servers
MCP-PostgreSQL-Ops
The MCP server provides professional operations, monitoring, and management capabilities for PostgreSQL databases using natural language queries.
tiger-docs-mcp-server
An MCP server and Claude plugin providing AI assistants with advanced PostgreSQL knowledge through semantic documentation search and curated best practice skills.
enhanced-postgres-mcp-server
This server acts as a Model Context Protocol interface for PostgreSQL, enabling LLMs to query data, modify records, and manage database schema objects with read and write capabilities.
polarbase
Extensible open-source data backend for PostgreSQL with a multi-view UI (spreadsheet), AI agent integration via MCP, and real-time capabilities.