Back to Home
scionoftech icon

pg_mcp

by scionoftech

Overview

Enables natural language querying of PostgreSQL databases using AI.

Installation

Run Command
docker-compose up -d

Environment Variables

  • POSTGRES_HOST
  • POSTGRES_PORT
  • POSTGRES_DB
  • POSTGRES_USER
  • POSTGRES_PASSWORD
  • ANTHROPIC_API_KEY

Security Notes

The server has critical security vulnerabilities. The `execute_sql` tool directly executes user-provided SQL queries without sanitization, allowing for SQL injection and arbitrary database operations. The `describe_table` tool uses f-strings to embed the `table_name` parameter directly into SQL queries (e.g., `SELECT * FROM {table_name} LIMIT 3;`), making it vulnerable to SQL injection. Additionally, while the `query` tool uses AI to generate SQL, the generated SQL is executed directly, posing a risk if the AI can be prompted to generate malicious queries. The project also uses default PostgreSQL credentials in the example setup, which should never be used in production.

Similar Servers

Stats

Interest Score0
Security Score2
Cost ClassHigh
Avg Tokens1000
Stars0
Forks0
Last Update2025-11-19

Tags

PostgreSQLNatural Language ProcessingAISQLFlaskDocker