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
- Install dependencies
- Build the project
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
This server cannot be installed
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 -JavaScriptMIT License
- AsecurityAlicenseAqualityAn MCP server that provides read-only access to MySQL databases.Last updated -441917JavaScriptMIT 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 -3PythonMIT License
- -security-license-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 -1JavaScript