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
Máy chủ liên quan
KnowledgeGraph MCP Server
Enables persistent knowledge storage for Claude using a knowledge graph with multiple database backends like PostgreSQL and SQLite.
AI Knowledge System
An enterprise-ready system to archive AI conversations from ChatGPT and Claude into a Supabase database.
STRING-MCP
Interact with the STRING protein-protein interaction database API.
CData Salesforce Data Cloud
A read-only MCP server for Salesforce Data Cloud, powered by CData.
MCP PGVector Server
Provides semantic search capabilities for PostgreSQL databases using the pgvector extension, with support for multiple embedding providers.
SolanaBot
Interact with the Solana blockchain to check balances, send SOL, and airdrop SOL.
Kollect MCP Server (Standalone)
An MCP server for querying data from the Kollect tool's API endpoints, such as /api/data, /api/snapshots, and /api/costs.
pg-aiguide
Postgres skills and documentation to help AI coding tools generate better PostgreSQL code.
Google BigQuery by CData
Connect to Google BigQuery databases using CData's MCP Server. Requires a separate CData JDBC Driver license.
MCP Football Server
Provides football (soccer) data using the API-Football service.