Postgresql MCP
@sarmadparvez
About Postgresql MCP
A general-purpose PostgreSQL MCP server with full read-write support, atomic transactions, and schema inspection. Connect Claude, Cursor, Windsurf, or any MCP-compatible AI client to any PostgreSQL database — local, Supabase, AWS RDS, or self-hosted. No cloud lock-in, no Azure de
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@sarmadparvez/postgresql-mcp",
"postgresql://user:pass@localhost:5432/mydb"
]
}
}
}Tools
5Execute a read-only SQL SELECT query and return results as JSON
Execute a write SQL statement (INSERT, UPDATE, DELETE, TRUNCATE, CREATE, DROP). Returns rows affected.
List all tables with their columns, types, and constraints for a given schema (default: public)
List all tables in the database with row counts
Execute multiple SQL statements as a single atomic transaction. Rolls back all on any error.
Overview
What is Postgresql MCP?
Postgresql MCP is a general-purpose MCP server for PostgreSQL databases that provides full read-write support, atomic transactions, and schema inspection. It connects MCP-compatible AI clients such as Claude, Cursor, and Windsurf to any PostgreSQL database—local, Supabase, AWS RDS, or self-hosted—without cloud lock-in or Azure dependency.
How to use Postgresql MCP?
Configure the server by providing a connection string to your PostgreSQL database. An optional read-only mode can be enabled via a flag in the connection string. Once connected, you can execute SELECT, INSERT, UPDATE, DELETE, DDL statements, and multi-statement transactions with automatic rollback on failure.
Key features of Postgresql MCP
- Full read-write support for PostgreSQL databases
- Atomic transactions with automatic rollback
- Schema inspection capabilities
- Optional read-only mode via connection string flag
- Supports SELECT, INSERT, UPDATE, DELETE, and DDL
- Compatible with any MCP AI client (Claude, Cursor, Windsurf)
Use cases of Postgresql MCP
- Allow AI assistants to run database queries and retrieve live data
- Enable AI agents to perform schema analysis and table creation
- Facilitate automated data entry and updates through natural language
- Support safe read-only exploration of production databases
FAQ from Postgresql MCP
What database operations does Postgresql MCP support?
It supports SELECT, INSERT, UPDATE, DELETE, DDL statements, and multi-statement transactions with automatic rollback.
Can I use Postgresql MCP in read-only mode?
Yes, an optional read-only mode can be enabled via the connection string flag.
What kinds of PostgreSQL databases can I connect to?
Any PostgreSQL database—local instances, Supabase, AWS RDS, or self-hosted setups.
Is Postgresql MCP tied to any cloud provider?
No. It has no cloud lock-in and no dependency on Azure or any other provider.
Which AI clients are compatible with Postgresql MCP?
It works with any MCP-compatible AI client, including Claude, Cursor, and Windsurf.
More Databases MCP servers
MotherDuck's DuckDB MCP Server
motherduckdbLocal MCP server for DuckDB and MotherDuck
mcp_mysql_server
xwb602625136Model Context Protocol (MCP) server that supports secure interaction with MySQL databases and has anomaly analysis capabilities.更加牛逼!更加好用!不仅止于mysql的增删改查功能; 还包含了数据库异常分析能力;且便于开发者们进行个性化的工具扩展
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
MongoDB MCP Server
mongodb-jsA Model Context Protocol server to connect to MongoDB databases and MongoDB Atlas Clusters.
MySQL MCP Server
designcomputerA Model Context Protocol (MCP) server that enables secure interaction with MySQL databases
Comments