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
相关服务器
Video Metadata MCP Server
Manages video metadata, including game information, teams, scores, and other sports-related data.
DBHub
Universal database MCP server supporting mainstream databases.
MCP Toolbox for Databases
Open source MCP server specializing in easy, fast, and secure tools for Databases.
Neo4j
A server for accessing and interacting with a Neo4j graph database, configured via environment variables.
CoinGecko
Official CoinGecko API MCP Server for Crypto Price & Market Data, across 200+ blokchain networks and 8M+ tokens.
SQL Server Express
An MCP server for interacting with Microsoft SQL Server Express databases.
Drug Gene Interaction Database (DGIdb)
A bridge to the Drug Gene Interaction Database (DGIdb) API, enabling AI clients to query drug-gene interaction data.
SolanaBot
Interact with the Solana blockchain to check balances, send SOL, and airdrop SOL.
Pinecone
Read and write to a Pinecone vector database using the Model Context Protocol.
XiYan MCP Server
A server that enables natural language queries to databases using XiyanSQL.