PostgreSQL MCP Server (Enhanced)
@GarethCott
About PostgreSQL MCP Server (Enhanced)
No overview available yet
Basic information
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"enhanced-postgres-mcp-server": {
"command": "docker",
"args": [
"build",
"-t",
"mcp/postgres",
"-f",
"Dockerfile",
"."
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is PostgreSQL MCP Server (Enhanced)?
A Model Context Protocol server that provides both read and write access to PostgreSQL databases. It enables LLMs to inspect database schemas, execute queries, modify data, and create or modify database schema objects. This is an enhanced version of the original read-only PostgreSQL MCP server by Anthropic, adding write capabilities and schema management.
How to use PostgreSQL MCP Server (Enhanced)?
Configure it in the "mcpServers" section of your claude_desktop_config.json. Use either Docker (run docker run -i --rm mcp/postgres) or NPX (run npx -y @modelcontextprotocol/server-postgres), providing a PostgreSQL connection URL such as postgresql://host:port/db-name. Then invoke tools like /query, /insert, /update, /createTable, /createFunction, /createTrigger with the required arguments.
Key features of PostgreSQL MCP Server (Enhanced)
- Execute read-only SQL queries with prepared statements
- Insert, update, and delete records in tables
- Create and alter tables, indexes, functions, and triggers
- Automatic schema discovery as MCP resources
- Parameterized queries for SQL injection prevention
- Transactional handling with proper COMMIT/ROLLBACK
Use cases of PostgreSQL MCP Server (Enhanced)
- LLM-driven inspection of database schemas and data
- Automated data entry and record updates via natural language commands
- Schema evolution, such as adding columns or creating indexes
- Setting up database functions and triggers through conversational AI
FAQ from PostgreSQL MCP Server (Enhanced)
How does this version differ from the original PostgreSQL MCP server?
The original server provides read-only access. This enhanced version adds write capabilities (INSERT, UPDATE, DELETE) and schema management tools like create table, function, trigger, index, and alter table.
What security measures are implemented?
All data modification operations use transactions with COMMIT/ROLLBACK handling. Insert/update operations use parameterized queries to prevent SQL injection. The read-only query tool uses prepared statements to block multi‑statement injection attacks.
How do I connect to a PostgreSQL database?
Provide a PostgreSQL connection URL in the server configuration (e.g., postgresql://user:password@host:port/db-name). For Docker on macOS, use host.docker.internal if the server runs on the host network. Add ?sslmode=no-verify to bypass SSL verification if needed.
Can I create functions and triggers with this server?
Yes. Tools /createFunction and /createTrigger allow creating PostgreSQL functions (specifying language, parameters, body) and triggers (defining when, events, forEach, optional condition).
Does the server use transactions for modifications?
Yes. Each execution of the execute tool is performed within a transaction with proper COMMIT or ROLLBACK handling. Insert, update, and delete tools also run inside a transaction context.
More Databases MCP servers
MongoDB Lens
furey🍃🔎 MongoDB Lens: Full Featured MCP Server for MongoDB Databases
Redis MCP Server
redisThe official Redis MCP Server is a natural language interface designed for agentic applications to manage and search data in Redis efficiently
MCP Alchemy
runekaagaardA MCP (model context protocol) server that gives the LLM access to and knowledge about relational databases like SQLite, Postgresql, MySQL & MariaDB, Oracle, and MS-SQL.
Chroma MCP Server
chroma-coreA Model Context Protocol (MCP) server implementation that provides database capabilities for Chroma
Multi Database MCP Server
FreePeakA powerful multi-database server implementing the Model Context Protocol (MCP) to provide AI assistants with structured access to databases.
Comments