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
MariaDB
An MCP server for retrieving data from a MariaDB database.
MySQL DB
An MCP server for integrating with and managing MySQL databases.
PyAirbyte
An AI-powered server that generates PyAirbyte pipeline code and instructions using OpenAI and connector documentation.
mcp-parseable-server
MCP server for Parseable observability platform
RDW MCP Server
Query Dutch RDW vehicle registration data for vehicle information, fuel, and emissions data using the official RDW open data API.
dbt-docs
MCP server for dbt-core (OSS) users as the official dbt MCP only supports dbt Cloud. Supports project metadata, model and column-level lineage and dbt documentation.
MySQL MCP Server
An MCP server for accessing and managing MySQL databases.
SAS XPT MCP Server by CData
A Model Context Protocol (MCP) server for SAS XPT files, powered by the CData JDBC Driver.
CData SAP Hybris C4C
A read-only MCP server for querying live SAP Hybris C4C data, powered by the CData JDBC Driver.
MongoDB
Interact with MongoDB databases and MongoDB Atlas.