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
เซิร์ฟเวอร์ที่เกี่ยวข้อง
CData SuiteCRM Server
A read-only MCP server for querying live SuiteCRM data using the CData JDBC Driver.
GeoServer MCP Server
Connects Large Language Models to the GeoServer REST API, enabling AI assistants to interact with geospatial data and services.
Binance Cryptocurrency MCP
Access Binance cryptocurrency market data, including prices, candlestick charts, and order books.
CData Reckon Accounts Hosted
A read-only MCP server by CData that enables LLMs to query live data from Reckon Accounts Hosted. Requires a separate CData JDBC Driver.
Chroma MCP Server
An MCP server for the Chroma embedding database, providing persistent, searchable working memory for AI-assisted development with features like automated context recall and codebase indexing.
TiDB
An MCP server for TiDB, a serverless, distributed SQL database.
Microsoft SQL Server
A Model Context Protocol (MCP) server for connecting to and querying Microsoft SQL Server databases.
MCP Postgres Query Server
An MCP server for querying a PostgreSQL database in read-only mode.
SQL Server
Enables AI assistants to access and query SQL Server databases.
Local Context Memory MCP
A production-ready persistent memory system for AI agents, offering searchable memory across sessions with semantic search and support for multiple database backends.