Simple PostgreSQL MCP Server
An MCP server for executing SQL queries on PostgreSQL databases with configurable permissions.
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-MCP - Install dependencies
npm install - Build the project
npm run build
MCP Configuration
Add the following to your MCP client configuration (mcp.json):
Write Mode (default)
{
"mcpServers": {
"simple-postgresql-mcp": {
"command": "node",
"args": [
"/path/to/build/index.js",
"postgresql://username:password@localhost:5432/database_name",
"write"
]
}
}
}
Read-Only Mode
{
"mcpServers": {
"simple-postgresql-mcp": {
"command": "node",
"args": [
"/path/to/build/index.js",
"postgresql://username:password@localhost:5432/database_name",
"readonly"
]
}
}
}
Note: Update the path in the configuration to point to the
index.jsfile inside yourbuildfolder.
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
Related Servers
Knowledge Graph Memory Server
A knowledge graph server that provides persistent, multi-context memory for AI models.
A-Share MCP
Provides A-share stock market data, including basic info, historical K-lines, financial indicators, and macroeconomic data using Baostock.
SimpleDB MCP
A secure MCP server for accessing and exploring relational databases like MySQL, PostgreSQL, Salesforce, and AWS Glue.
Data.gov.il
Access Israeli Government Open Data from the data.gov.il portal.
Finance MCP Server
Provides real-time financial data from Yahoo Finance.
AWS Athena MCP Server
An MCP server for querying and interacting with AWS Athena.
Mallory MCP Server
Access real-time cyber and threat intelligence, including details on vulnerabilities, threat actors, and malware.
AWS Athena
Run SQL queries on data in Amazon S3 using AWS Athena.
Michelin MCP
Access structured Michelin restaurant data, including cities, countries, cuisines, awards, and facilities.
MCP KQL Server
Execute KQL queries using Azure authentication. Requires Azure CLI login.