- Explore MCP Servers
- Simple-Postgres-MCP
Simple Postgres Mcp
What is Simple Postgres Mcp
Simple PostgreSQL MCP Server is a minimal server that implements the Model Context Protocol (MCP) for executing SQL queries on PostgreSQL databases. It allows users to configure permissions for read-only or write access.
Use cases
This server can be utilized in various applications requiring database interactions, such as web services, data analysis tools, or any application that needs to interact with PostgreSQL in a controlled manner. It is particularly useful for projects needing database operations with clear permission distinctions.
How to use
To use the Simple PostgreSQL MCP Server, clone the repository, install the dependencies, and build the project. Then, configure your MCP client with the appropriate settings in mcp.json
, specifying the connection string and the desired permission mode (write or read-only). Start your MCP client to enable the server.
Key features
Key features include the ability to execute SQL queries with configurable access levels, a structured response format with metadata, and ease of setup through a simple PostgreSQL connection string. The server can be run in either read-only or write mode, depending on user requirements.
Where to use
This server can be used in environments where a controlled PostgreSQL database interaction is required. Suitable applications include internal tools, microservices architectures, and other systems where database access needs to be managed with specific permissions.
Overview
What is Simple Postgres Mcp
Simple PostgreSQL MCP Server is a minimal server that implements the Model Context Protocol (MCP) for executing SQL queries on PostgreSQL databases. It allows users to configure permissions for read-only or write access.
Use cases
This server can be utilized in various applications requiring database interactions, such as web services, data analysis tools, or any application that needs to interact with PostgreSQL in a controlled manner. It is particularly useful for projects needing database operations with clear permission distinctions.
How to use
To use the Simple PostgreSQL MCP Server, clone the repository, install the dependencies, and build the project. Then, configure your MCP client with the appropriate settings in mcp.json
, specifying the connection string and the desired permission mode (write or read-only). Start your MCP client to enable the server.
Key features
Key features include the ability to execute SQL queries with configurable access levels, a structured response format with metadata, and ease of setup through a simple PostgreSQL connection string. The server can be run in either read-only or write mode, depending on user requirements.
Where to use
This server can be used in environments where a controlled PostgreSQL database interaction is required. Suitable applications include internal tools, microservices architectures, and other systems where database access needs to be managed with specific permissions.
Content
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.js
file inside yourbuild
folder.
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