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.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
Related Servers
Tinybird
Interact with Tinybird serverless ClickHouse platform
Cryptocurrency Daemon
An MCP server for interacting with cryptocurrency daemon RPC interfaces.
Grist
Integrate with the Grist API to manage relational spreadsheets and data. Requires a Grist API key.
Gralio SaaS Database
Access a comprehensive database of over 30,000 SaaS products, including reviews, pricing, alternatives, and growth metrics.
LoL Data MCP Server
Provides real-time, structured access to League of Legends game data, including champions, items, abilities, game mechanics, and patch information.
MongoDB MCP Server
An MCP server providing tools and prompts for interacting with a MongoDB database.
Pipedrive MCP Server by CData
A read-only MCP server for Pipedrive, enabling LLMs to query live data using the CData JDBC Driver.
AKShare One
Access Chinese stock market data, including historical prices, real-time quotes, news, and financial statements.
microCMS MCP Server
Interact with the microCMS headless CMS API, enabling AI assistants to manage content.
MCP MariaDB Server
Manage and query MariaDB databases using the Model Context Protocol (MCP), with support for SQL and vector search.