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
Verwandte Server
Redshift MCP Server
An MCP server for Amazon Redshift, allowing AI assistants to interact with Redshift databases.
SAS XPT MCP Server by CData
A Model Context Protocol (MCP) server for SAS XPT files, powered by the CData JDBC Driver.
FDIC BankFind MCP Server
Provides structured U.S. banking data from the FDIC BankFind API for AI tools and workflows.
Materials Project MCP
Query the Materials Project database using the mp_api client. Requires an MP_API_KEY environment variable.
UniProt MCP Server
Fetch protein information from the UniProt database.
OpenTK
Provides access to Dutch parliamentary documents, debates, and member information from the Tweede Kamer via the OpenTK project.
Finance MCP Server
Provides real-time financial data from Yahoo Finance.
OrionBelt Semantic Layer
API-first engine and MCP server that transforms declarative YAML model definitions into optimized SQL for Postgres, Snowflake, ClickHouse, Dremio, and Databricks
MCP SQLite Server
A Node.js MCP server for interacting with local SQLite databases, runnable via npx.
SingleStore
Interact with the SingleStore database platform