Registry / database / enhanced-postgres-mcp-server

enhanced-postgres-mcp-server

JSON →
library1.0.1jsnpmunverified

An MCP (Model Context Protocol) server for PostgreSQL with both read and write capabilities, extending Anthropic's read-only server. Version 1.0.1. It enables LLMs to inspect database schemas, execute queries, modify data, and manage schema objects (tables, functions, triggers, indexes). Differentiators: adds write operations (INSERT/UPDATE/DELETE) and schema management (CREATE TABLE/ALTER TABLE) beyond the original server. Ships TypeScript types, requires Node >=18, and is available on npm. Supports various connection configurations including SSL modes and environment variable overrides.

databaseai-ml
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

This is a CLI tool, not a library. Use npx to run it without installation.

npx -y enhanced-postgres-mcp-server postgresql://user:pass@localhost:5432/db

Configure the MCP server in Claude Desktop's claude_desktop_config.json, then use slash commands to query or modify PostgreSQL.

{ "mcpServers": { "postgres": { "command": "npx", "args": [ "-y", "enhanced-postgres-mcp-server", "postgresql://username:password@localhost:5432/mydb" ] } } } // After config, in Claude Desktop, run: // /query SELECT * FROM information_schema.tables LIMIT 5 // /execute INSERT INTO my_table (name) VALUES ('example')
Debug
Known footguns
breakingIf you switch from the original Anthropic server (read-only) to this enhanced version, existing queries using /query will work, but /execute, /insert, /update, /delete, /createTable etc. are new tools that may conflict with any custom tool definitions you have.
gotchaThe /query tool is read-only (runs in a read-only transaction). To modify data, you must use /execute, /insert, /update, or /delete. Do not use /query for DML statements.
gotchaSSL is auto-enabled for remote connections (non-localhost/127.0.0.1). This may cause connection failures if your remote server does not support SSL or uses self-signed certificates.
gotchaConnection string format can vary. Omitting username/password may lead to connection failures if your PostgreSQL configuration does not allow trust authentication for local sockets.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
9 hits · last 30 days
gptbot
3
bingbot
1
mj12bot
1
ahrefsbot
1
Resources