$ timeahead.in
/ servers/npm/@henkey/postgres-mcp-server
npm

@henkey/postgres-mcp-server

A Model Context Protocol (MCP) server that provides comprehensive PostgreSQL database management capabilities for AI assistants

189 stars2k/wkupdated 11d agogithub ↗
88good
▣ Overview

What it does

The server exposes PostgreSQL operations as MCP tools, enabling Claude and other AI assistants to query, modify, and manage Postgres databases directly. It consolidates database functionality into 17 tools covering schema introspection and modification, user and permission management, query performance analysis, index optimization, stored function and trigger management, constraints, row-level security policies, and real-time monitoring. The design merges originally separate tools into intelligent meta-tools for discovery while adding new features like transaction-aware mutations and comment management for schema documentation.

Who it's for

Backend engineers integrating Claude into dev and staging database environments for schema exploration and performance investigation. Database operators troubleshooting connection issues, identifying slow queries, or validating indexes. Data engineers automating ETL tasks or migrations between environments.

Common use cases

  • Analyze query performance with EXPLAIN ANALYZE plans and locate slow operations
  • Create and modify tables, indexes, and constraints via structured tool parameters instead of raw SQL
  • Execute parameterized SELECT, INSERT, UPDATE, DELETE, and UPSERT operations with automatic escaping
  • Copy or migrate data between two Postgres instances (dev-to-test, backup restore, etc.)
  • Troubleshoot database connectivity, locks, and configuration issues via built-in diagnostic tools

Setup pitfalls

  • Must pass a PostgreSQL connection string explicitly via --connection-string flag or POSTGRES_CONNECTION_STRING environment variable; no default is provided
  • Requires Node.js 18.0.0 or later; the server does not validate this at startup and may fail cryptically on older versions
  • Grants filesystem read and write access for data export/import operations; do not expose to untrusted prompts without scoping which tools are available
  • Project has no automated testing or CI pipeline; verify compatibility with your Postgres version before relying on it in production
▣ Score BreakdownMCPScore = Σ(raw × weight)
DimensionRawWeighted
Security
35%
100
35.0
Freshness
25%
100
25.0
Adoption
20%
63
12.6
Quality
10%
100
10.0
Trust
10%
50
5.0
Total
87.6
⚿ Capabilities & Risk Explainer
fs readfs writesecrets
◆ Risk level: medium
fs read + fs write + secrets — requires access to credentials or environment secrets.
⚙ Install config
Claude Desktop · Cursor · Windsurf · VS Code (Copilot) · Claude Code
add to your MCP client config:
{
  "mcpServers": {
    "henkeypostgres": {
      "command": "npx",
      "args": [
        "-y",
        "@henkey/postgres-mcp-server"
      ]
    }
  }
}
⚙ Maintenance health
17/ 100 · is this project alive?
contributors (1y)2
top contributor share83%
releases (1y)0
ci✗ none
⛁ Raw data
weekly downloads2k
github stars189
forks35
open issues2
license✓ present
readme length9664 chars
last publish0d ago
last commit11d ago
last updated10h ago
install verified✓ pass · 22d ago
owner of this server? claim your listing to get a verified badgeclaim →
🔔 Score drop alerts
get notified by email when this server's score drops 5+ points