Back to Home
neverinfamous icon

postgres-mcp

Verified Safe

by 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

Run Command
docker run -i --rm -e "DATABASE_URI=<your_postgresql_connection_string>" writenotenow/postgres-mcp-enhanced:latest --access-mode=restricted

Environment 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

Stats

Interest Score38
Security Score9
Cost ClassMedium
Avg Tokens750
Stars9
Forks1
Last Update2026-01-19

Tags

PostgreSQLDatabase ManagementPerformance TuningHealth MonitoringSQLQuery OptimizationIndexingpgvectorPostGISAIAnalyticsBackupDevOps