
This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A FastMCP-powered Model Context Protocol server that gives AI assistants structured access to a PostgreSQL database through MCP resources and tools over stdio.
PostgreSQL MCP Server is cataloged as an MCP server attributed to vivekmalipatel. A FastMCP-powered Model Context Protocol server that gives AI assistants structured access to a PostgreSQL database through MCP resources and tools over stdio. It is categorized under databases storage. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for PostgreSQL MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
It runs over stdio; the server starts and waits on stdin for MCP protocol messages.
It uses parameterised queries throughout.
README.md · ae17a54ce0f0 · Fetched 2026-11-13 10:47:28 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
A FastMCP-powered Model Context Protocol server that gives AI assistants (Claude, Cursor, etc.) full, structured access to a PostgreSQL database — no SQL knowledge required from the user.
This server exposes your PostgreSQL database as a set of MCP Resources (read-only views) and MCP Tools (read/write actions) over the stdio transport. Any MCP-compatible AI client can connect, inspect your schema, and perform data operations in natural language.
Claude / Cursor / any MCP client
│ stdio (MCP protocol)
▼
postgres_mcp_server.py (FastMCP layer — resources & tools)
│ async
▼
postgres_manager.py (asyncpg connection pool)
│
▼
PostgreSQL Database
| Category | Capability |
|---|---|
| Schema | List all tables, inspect column definitions |
| Reads | Select with filters, ordering, and row limits |
| Writes | Insert, update, delete rows |
| DDL | Create and drop tables |
| Raw SQL | Execute arbitrary queries |
| Safety | Parameterised queries throughout (no SQL injection) |
| Logging | Structured stdout logs on every tool/resource call |
Resources are read-only, URI-addressable data feeds the AI client can subscribe to.
| URI | Description |
|---|---|
postgres://tables | JSON list of all tables in the database |
postgres://schema/{table_name} | Column names, types, and constraints for a table |
postgres://data/{table_name} | First 100 rows of a table (safe preview) |
Tools are callable actions the AI can invoke on your behalf.
execute_queryExecute any raw SQL statement and get results back as JSON.
query: str — the SQL to run
create_tableCreate a new table with custom column definitions.
table_name: str
columns: [{"name": "id", "type": "SERIAL PRIMARY KEY"}, ...]
drop_tableDrop a table permanently.
table_name: str
insert_dataInsert a single row into a table.
table_name: str
data: {"column": value, ...}
update_dataUpdate rows matching a condition.
table_name: str
data: {"column": new_value, ...}
condition: "id = %s"
condition_params: [42]
delete_dataDelete rows matching a condition.
table_name: str
condition: "status = %s"
condition_params: ["inactive"]
select_dataQuery a table with optional filtering, ordering, and pagination.
table_name: str
columns: ["id", "name"] (optional, default: *)
condition: "age > %s" (optional)
condition_params: [18] (optional)
order_by: "created_at DESC" (optional)
limit: 100 (optional, default: 100)
uv package manager (recommended) — or pip# 1. Clone the repository
git clone https://github.com/VivekMalipatel/Postgres_MCP_Server.git
cd Postgres_MCP_Server
# 2. Create and activate a virtual environment
python -m venv .mcp
source .mcp/bin/activate # macOS / Linux
# .mcp\Scripts\activate # Windows
# 3. Install dependencies
pip install -r requirements.txt
Create a .env file in the project root:
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=your_database
POSTGRES_USER=your_username
POSTGRES_PASSWORD=your_password
Add the following block to your Claude Desktop MCP config file
(~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"PostgreSQL MCP": {
"command": "/absolute/path/to/.mcp/bin/uv",
"args": [
"run",
"--with", "mcp[cli]",
"--with", "asyncpg",
"--with", "httpx",
"--with", "python-dotenv",
"--with", "psycopg2-binary",
"mcp",
"run",
"/absolute/path/to/postgres_mcp_server.py"
],
"env": {
"POSTGRES_HOST": "localhost",
"POSTGRES_PORT": "5432",
"POSTGRES_USER": "your_username",
"POSTGRES_PASSWORD": "your_password",
"POSTGRES_DB": "your_database"
}
}
}
}
Replace all
/absolute/path/to/with the actual paths on your machine.
You can omit theenvblock if you are using a.envfile instead.
python postgres_mcp_server.py
The server starts and waits on stdin for MCP protocol messages. In normal use, your AI client launches it automatically via the config above.
| Package | Purpose |
|---|---|
mcp[cli] | MCP protocol + FastMCP framework |
asyncpg | High-performance async PostgreSQL driver |
psycopg2-binary | Synchronous PostgreSQL driver (fallback) |
python-dotenv | .env file loading |
httpx | Async HTTP client (available to tools) |
uvicorn | ASGI server (for future HTTP transport) |
uv | Fast Python package runner |
Postgres_MCP_Server/
├── postgres_mcp_server.py # FastMCP server — resources, tools, lifespan
├── postgres_manager.py # Async DB manager (connection pool, CRUD)
├── requirements.txt
└── .env # (create this — not committed)
MIT — free to use, modify, and distribute.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for PostgreSQL MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/postgres_mcp_server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

This is a Model Context Protocol (MCP) server for interacting with AIStor object stores.

A Model Context Protocol server that lets AI assistants run SQL queries against AWS Athena databases and retrieve results.

A Model Context Protocol (MCP) server that exposes access to an InfluxDB v2 instance using the InfluxDB OSS API v2.