Postgres Mcp MCP Server

A lightweight MCP (Model Context Protocol) server built to query Postgres database using SQL or plain English commands. It provides comprehensive tools for database operations, table introspection…

Local serverstdioMIT

What is the Postgres Mcp Server?

Postgres Mcp is an MCP project maintained in the freakynit/postgres-mcp repository. The maintainer describes its purpose as “A lightweight MCP (Model Context Protocol) server built to query Postgres database using SQL or plain English commands. It provides comprehensive tools for database operations…”. Read the project documentation for the complete scope.

Installation

The documented npm package is @freakynit/postgres-mcp. The configuration below comes from the maintainer’s example; adapt its paths and account values to your environment.

Configuration values

The example declares POSTGRES_HOST, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DATABASE. Secret-looking values have been replaced with placeholders. Required and optional labels are shown only when the documentation states them.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
execute_raw_queryExecute SQL queries with permission validation and dry-run support
list_tablesList all non-system tables
describe_tablesGet comprehensive table information including columns, indexes, triggers, and constraints
switch_databaseSwitch the active database connection

How to install the Postgres Mcp Server

{
  "mcpServers": {
    "postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@freakynit/postgres-mcp@latest"
      ],
      "env": {
        "POSTGRES_HOST": "<POSTGRES HOST>",
        "POSTGRES_USER": "<POSTGRES USER>",
        "POSTGRES_PASSWORD": "YOUR_POSTGRES_PASSWORD",
        "POSTGRES_DATABASE": "<POSTGRES DATABASE>"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
POSTGRES_HOSTDeclared in the maintainer’s client configuration.Check documentation
POSTGRES_USERDeclared in the maintainer’s client configuration.Check documentation
POSTGRES_PASSWORDDeclared in the maintainer’s client configuration.Check documentation
POSTGRES_DATABASEDeclared in the maintainer’s client configuration.Check documentation