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.

npm install enhanced-postgres-mcp-server
INSTALL
IMPORT
SIG · ENHANCED-POSTGRES-
E
enhanced-postgres-mcp-server
databasejavascriptv1.0.1
harness data pending
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.

main
npx -y enhanced-postgres-mcp-server postgresql://user:pass@localhost:5432/db
npm install -g enhanced-postgres-mcp-server && enhanced-postgres-mcp-server postgresql://user:pass@localhost:5432/db
This is a CLI tool, not a library. Use npx to run it without installation.

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 issues
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.
fix
Review your MCP configuration and remove any previously defined custom tools with the same names.
affects: >=1.0.0
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.
fix
Use the appropriate tool: /query for SELECT, /execute for INSERT/UPDATE/DELETE, etc.
affects: >=1.0.0
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.
fix
Add ?sslmode=no-verify to the connection string, or set POSTGRES_SSL=false to disable auto-SSL for remote connections.
affects: >=1.0.0
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.
fix
Always specify both username and password in the connection string, e.g., postgresql://user:password@host:port/db
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'enhanced-postgres-mcp-server'
The package is not installed globally or npx is not available.
fix
Ensure Node.js >=18 is installed and run with: npx -y enhanced-postgres-mcp-server
Error: connect ECONNREFUSED ::1:5432
The server tried to connect to IPv6 localhost, but PostgreSQL is listening on IPv4.
fix
Use 127.0.0.1 instead of localhost in the connection string, or enable IPv6 in PostgreSQL.
Error: no pg_hba.conf entry for host "...", user "...", database "...", SSL off
PostgreSQL requires SSL for the connection but SSL was not configured or disabled.
fix
Add ?ssl=true to the connection string, or set POSTGRES_SSL=true environment variable.
TimeoutError: Connection to server timed out
The database server is unreachable or the connection string is malformed.
fix
Verify the host, port, and that the database is running. Test with: psql postgresql://user:password@host:port/db
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
16 hits · last 30 days
node
12
OpenAI (training)
2
Resources
enhanced-postgres-mcp-server — npm install enhanced-postgres-mcp-server · libregistry