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
MCP MongoDB Server
kiliczshA Model Context Protocol Server for MongoDB
MCP Server for MySQL based on NodeJS
benborlaA Model Context Protocol server that provides read-only access to MySQL databases. This server enables LLMs to inspect database schemas and execute read-only queries.

Redis
modelcontextprotocolModel Context Protocol Servers
Dbhub
bytebaseZero-dependency, token-efficient database MCP server for Postgres, MySQL, SQL Server, MariaDB, SQLite.
MCP Server for Milvus
zilliztechModel Context Protocol Servers for Milvus
Comments