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
Servidores relacionados
Google Directory by CData
A read-only MCP server for querying live Google Directory data using the CData JDBC Driver.
MCP Memory libSQL
A persistent memory system for MCP using libSQL, providing vector search and efficient knowledge storage.
MongoDB
Interact with MongoDB databases using natural language. Query collections, inspect schemas, and manage data.
MCP MariaDB Server
Manage and query MariaDB databases using the Model Context Protocol (MCP), with support for SQL and vector search.
Fabi Analyst Agent MCP
Fabi MCP is an autonomous agent that handles end-to-end data analysis tasks from natural language requests, automatically discovering data schemas, generating sql or python code, executing queries, and presenting insights.
F1Data
Access Formula 1 data, including race results, driver standings, and circuit information.
TiDB
An MCP server for TiDB, a serverless, distributed SQL database.
Datai MCP Server
Provides real-time wallet portfolio data, including DeFi, token, and NFT holdings, using the Datai API.
SET-MCP
Access financial statements, including income, balance sheets, and cash flow, for companies listed on the Securities Exchange of Thailand (SET).
CockroachDB
A server for direct interaction with CockroachDB databases.