Back to Home
GarethCott icon

enhanced-postgres-mcp-server

by GarethCott

Overview

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.

Installation

Run Command
npx enhanced-postgres-mcp postgresql://localhost/mydb

Environment Variables

  • DATABASE_URL

Security Notes

The server has critical SQL injection vulnerabilities in several tools. While 'query' uses prepared statements for values, 'insert', 'update', and 'delete' directly concatenate table names and WHERE clauses, making them vulnerable. More critically, all schema management tools ('createTable', 'createFunction', 'createTrigger', 'createIndex', 'alterTable') construct SQL queries by directly concatenating LLM-provided string inputs (like table names, column definitions, function bodies, trigger conditions, and alter operations). This allows an LLM to generate arbitrary malicious SQL, leading to severe data corruption, unauthorized data access, or complete database destruction. The server relies on an external database URL which may contain credentials.

Similar Servers

Stats

Interest Score37
Security Score3
Cost ClassMedium
Avg Tokens1000
Stars10
Forks8
Last Update2026-01-19

Tags

PostgreSQLDatabaseLLMData ManagementMCP