Back to Home
loadept icon

pg-mcp

by loadept

Overview

A read-only PostgreSQL server providing database information and query execution via the Model Context Protocol (MCP).

Installation

Run Command
docker run --rm -i loadept/pg-mcp:latest -u "postgres://usuario:contraseƱa@host:puerto/basedatos?sslmode=disable"

Security Notes

The 'execute_query' tool directly executes user-provided SQL queries without robust input sanitization or explicit enforcement of 'SELECT only' statements in the code. Although the transaction is marked 'ReadOnly: true', malicious users could craft queries for time-based blind SQL injection, information leakage (accessing unintended tables), or resource exhaustion (complex/long-running queries), despite the README's implied 50-row limit (which is not enforced in the provided source). The PostgreSQL connection URI is passed via a command-line flag, which can expose credentials in process listings; using environment variables or a secrets manager is generally more secure.

Similar Servers

Stats

Interest Score31
Security Score4
Cost ClassLow
Avg Tokens500
Stars1
Forks0
Last Update2025-12-12

Tags

PostgreSQLDatabaseMCPGoRead-only