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
Qdrant
Implement semantic memory layer on top of the Qdrant vector search engine
Fireproof JSON DB Collection Server
Manage multiple Fireproof JSON document databases with cloud sync capabilities.
Movie Database
Access a MongoDB movie database using natural language queries.
VictoriaMetrics MCP Server
Access VictoriaMetrics APIs for monitoring, observability, and debugging.
DexPaprika
Access real-time DEX analytics across 20+ blockchains with DexPaprika API, tracking 5M+ tokens, pools, volumes, and historical market data. Built by CoinPaprika.
CData Avalara AvaTax
A read-only MCP server for querying live Avalara AvaTax data. Powered by the CData JDBC Driver.
BigQuery
Server implementation for Google BigQuery integration that enables direct BigQuery database access and querying capabilities
BrianKnows
Access BrianKnows' extensive blockchain knowledge base.
Acumatica MCP Server by CData
A read-only MCP server for querying live Acumatica data using the CData JDBC Driver.
DROMA MCP Server
Interact with DROMA drug-omics association analysis databases using natural language.