postgresql-mcp
Verified Safeby sgaunet
Overview
Provides a Model Context Protocol (MCP) server for Claude Code to interact with PostgreSQL databases through a set of read-only tools.
Installation
postgresql-mcpEnvironment Variables
- POSTGRES_URL
- DATABASE_URL
Security Notes
The server implements strong security practices by enforcing read-only operations (only SELECT and WITH statements are allowed for user-provided queries). It explicitly validates query types to prevent write/DDL operations. Database connection details are securely handled via environment variables, and parameterized queries are used for user-supplied query arguments, mitigating SQL injection risks. A minor note is that `GetTableStats` uses string concatenation for schema and table names in a fallback query, but these are quoted.
Similar Servers
consult-llm-mcp
Facilitates Claude Code to consult powerful external AI models for complex code analysis, debugging, and review tasks.
postgres-mysql-mcp-server
A Model Context Protocol (MCP) server that enables AI assistants to query PostgreSQL and MySQL databases for schema introspection and data retrieval.
dx-mcp-server
Empowers AI applications to interact with and query a user-provided Postgres database via the Model Context Protocol (MCP).
mcp-devtools-server
Standardizes development tool interaction and enhances AI code generation, autocorrection, and workflow automation.