postgres-mcp-server

akbarsaputrait/postgres-mcp-server

3.1

If you are the rightful owner of postgres-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The MCP Server - PostgreSQL Edition is designed to help users manage their PostgreSQL databases more efficiently by providing tools for analysis, optimization, and debugging.

🚀 MCP Server - PostgreSQL Edition

Manage your PostgreSQL databases smarter, not harder!
This MCP server helps you analyze, optimize, and debug your Postgres setups with ease.


🌟 What It Can Do

🔍 Analyze Your Database (analyze_db)

Get a deep dive into your PostgreSQL database:

  • Check your configuration
  • Review performance stats
  • Assess security risks
  • Get actionable improvement tips!
// Quick example
{
  "connectionString": "postgresql://user:password@localhost:5432/dbname",
  "analysisType": "performance" // Options: "configuration" | "performance" | "security"
}

👀 More.. Coming soon!

🛠 Prerequisites

  • Node.js >= 22.0.0
  • Bun >= 1.2.6
  • PostgreSQL server

⚡ How To Install

  1. Clone the repository
  2. Install dependencies:
    bun i
    
  3. Build the server:
    bun run build
    
  4. Add to MCP settings file:
    {
      "mcpServers": {
        "mcp-server-postgres": {
          "command": "node",
          "args": ["/path/to/postgresql-mcp-server/build/index.js"],
          "disabled": false,
          "alwaysAllow": []
        }
      }
    }
    

🚀 Dev Mode

  • bun run build - Start development server with hot reload
  • bun run watch - Run ESLint

🔒 Security First

  • Connection pooling and timeouts
  • String validation
  • SSL/TLS support

📝 Todos

  • Integrate with Drizzle ORM
  • Able to analyze schema & relations
  • etc.

This project was created using bun init in bun v1.2.6. Bun is a fast all-in-one JavaScript runtime.

Inspired from https://github.com/nahmanmate/postgresql-mcp-server