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
関連サーバー
MOTE Registry
Search the MOTE AI agent registry to discover machine-readable businesses by category, location, and keyword
Theta Health MCP Server
Connect your health data to AI assistants like Cursor, Claude, and Windsurf.
Keboola MCP Server
An MCP server for interacting with the Keboola Connection data platform.
Materials Project MCP
Query the Materials Project database using the mp_api client. Requires an MP_API_KEY environment variable.
PostgreSQL MCP
Transforms PostgreSQL databases from "I have tables and I don't know what they do" into "I understand the entire database structure, relationships, and best practices"
MySQL
A server for managing MySQL databases.
MySQL MCP
A secure MCP service for accessing and managing MySQL databases, featuring multi-layer security and high-performance connection pooling.
Quran.com API
Interact with the Quran.com corpus using their official REST API v4.
CData Reckon
A read-only MCP server for Reckon, enabling LLMs to query live data using the CData JDBC Driver.
QuickBooks Online by CData
A read-only MCP server for querying live QuickBooks Online data. Requires a separate CData JDBC Driver for QuickBooks Online.