A PostgreSQL MCP server that enables AI assistants to interact directly with PostgreSQL databases through a set of specialized tools. It provides capabilities for executing read and write SQL queries, creating tables, and listing database tables - all through the MCP protocol. Built with Go and leveraging the lib/pq driver, this implementation includes security features like query type validation and input sanitization, making it suitable for database management tasks while maintaining appropriate access controls. The server is easily configurable through environment variables and can be integrated with any MCP-compatible AI assistant.
No reviews yet. Be the first to review!
Sign in to join the conversation
Executes a SELECT SQL query. Parameters: query (string, required): The SELECT statement to execute.
Executes an INSERT, UPDATE, or DELETE SQL query. Parameters: query (string, required): The INSERT/UPDATE/DELETE statement to execute.
Executes a CREATE TABLE SQL statement. Parameters: schema (string, required): The CREATE TABLE statement.
Lists all user-created tables in the database. Parameters: schema (string, optional): The schema name to filter tables by.
Returns the execution plan for a given SQL query. Parameters: query (string, required): The query to explain (must start with EXPLAIN).