Provides support for the developer through Ko-fi donations
Allows execution of SQL queries on PostgreSQL databases with configurable read-only or write access permissions, returning structured results with metadata
Simple PostgreSQL MCP Server
A minimal Model Context Protocol (MCP) server for executing SQL queries on PostgreSQL databases with configurable permissions.
Features
Execute SQL queries with optional read-only or write access
Server-level mode (read-only/write) configurable via command line
Returns structured results with metadata
Simple setup using a PostgreSQL connection string
Getting Started
Clone the repository
git clone https://github.com/perrypixel/Simple-Postgres-MCP cd Simple-Postgres-MCPInstall dependencies
npm installBuild the project
npm run build
MCP Configuration
Add the following to your MCP client configuration (mcp.json
):
Write Mode (default)
Read-Only Mode
Note: Update the path in the configuration to point to the
index.js
file inside yourbuild
folder.
Usage
Copy the appropriate MCP configuration (read-only or write mode) to your tool’s
mcp.json
(e.g., Cursor, Windsurf, Copilot, etc.).Start your MCP client. The server is now ready to use!
Support
If you find this tool helpful, you can support the development by:
Buying me a coffee at https://ko-fi.com/perrypixel
UPI to kevinp@apl
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Tools
A minimal MCP server that allows executing SQL queries on PostgreSQL databases with configurable read-only or write permissions.
Related MCP Servers
- -securityAlicense-qualityAn MCP server that connects to Supabase PostgreSQL databases, exposing table schemas as resources and providing tools for data analysis through SQL queries.Last updated -1MIT License
- -securityAlicense-qualityA template project for building custom MCP servers that enables direct access to PostgreSQL databases, allowing SQL query execution and schema information retrieval through the Model Context Protocol.Last updated -31MIT License
- -securityFlicense-qualityAn MCP server that allows working with MySQL databases by providing tools for executing read-only SQL queries, getting table schemas, and listing database tables.Last updated -3114
- -securityFlicense-qualityA Model Context Protocol server implementation that provides a simple interface to interact with PostgreSQL databases, enabling SQL queries, database operations, and schema management through MCP.Last updated -