Back to Home
kyagoshi icon

pgmcp

Verified Safe

by kyagoshi

Overview

The server provides introspection capabilities for PostgreSQL databases, allowing users to list tables, retrieve schema details, get index information, discover foreign keys, and generate Mermaid-formatted Entity-Relationship diagrams.

Installation

Run Command
uvx --from git+https://github.com/kyagoshi/pgmcp pgmcp

Environment Variables

  • PGHOST
  • PGPORT
  • PGDATABASE
  • PGUSER
  • PGPASSWORD

Security Notes

The server explicitly establishes all database connections as read-only (`conn.set_session(readonly=True)`), preventing any write operations (INSERT, UPDATE, DELETE, CREATE). All SQL queries use parameterized statements (`%s`), effectively mitigating SQL injection risks. Database credentials are securely loaded from environment variables, not hardcoded. The project also incorporates a `pip-audit` workflow to scan for dependency vulnerabilities.

Similar Servers

Stats

Interest Score0
Security Score9
Cost ClassLow
Avg Tokens1000
Stars0
Forks0
Last Update2025-12-29

Tags

PostgreSQLDatabaseSchemaER DiagramMCP Server