PostgreSQL MCP Server (Model Context Protocol)

A FastMCP-powered Model Context Protocol server that gives AI assistants (Claude, Cursor, etc.) full, structured access to a PostgreSQL database — no SQL knowledge required from the user.

Local serverstdio

What is the PostgreSQL MCP Server (Model Context Protocol) MCP Server?

PostgreSQL MCP Server (Model Context Protocol) is an MCP project maintained in the vivekmalipatel/postgres_mcp_server repository. The maintainer describes its purpose as “A FastMCP-powered Model Context Protocol server that gives AI assistants (Claude, Cursor, etc.) full, structured access to a PostgreSQL database — no SQL knowledge required…”. Read the project documentation for the complete scope.

Local setup

The project provides a local client configuration using /absolute/path/to/.mcp/bin/uv. Follow the repository’s build and installation steps before copying it, and replace example paths with the paths on your own computer.

Configuration values

The example declares POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB. 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_query
create_table
drop_table
insert_data
update_data
delete_data
select_data

How to install the PostgreSQL MCP Server (Model Context Protocol) MCP Server

{
  "mcpServers": {
    "PostgreSQL MCP": {
      "command": "/absolute/path/to/.mcp/bin/uv",
      "args": [
        "run",
        "--with",
        "mcp[cli]",
        "--with",
        "asyncpg",
        "--with",
        "httpx",
        "--with",
        "python-dotenv",
        "--with",
        "psycopg2-binary",
        "mcp",
        "run",
        "/absolute/path/to/postgres_mcp_server.py"
      ],
      "env": {
        "POSTGRES_HOST": "localhost",
        "POSTGRES_PORT": "5432",
        "POSTGRES_USER": "your_username",
        "POSTGRES_PASSWORD": "YOUR_POSTGRES_PASSWORD",
        "POSTGRES_DB": "your_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_PORTDeclared 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_DBDeclared in the maintainer’s client configuration.Check documentation