Prototype · Preview: every server in the official registry, synced every 30 minutes. Reviews and accounts come in a later step.
PopNx MCPMCP servers for people who use AI · explained in plain words

PostgreSQL MCP Server

by musaddiq-devversion 0.1.2i★ –iRuns on your computer
Registry nameio.github.musaddiq-dev/postgresql-mcp-server

Install

Overview

Description from the maker (original English)

Python MCP server for PostgreSQL database inspection and querying

PopNx MCP’s three pillars

These three are never merged into one score: opinions, measurements and popularity are different things.

What you can do with it

We have not written a plain-language summary for this one yet. Below are the facts we read from the registry.

  • Connection: Runs on your computer
  • Transport: stdio
  • Category: Databases & datasets
  • You need to fill in: POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB

Install

Pick the AI app you use, then copy the settings.

Before you install

  • Basic checks: 1 of 1 passed
  • Runs on your computer with your user’s permissions (files, network, apps).
  • You fill in yourself: POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, POSTGRES_READ_QUERY_LIMIT

Values marked secret are keys to your account. Never share them or paste them into a chat.

You need

  • PyPIPython’s uv installed (for the uvx command)

Which app do you use?

Pick your app above. We remember it, so next time the button says “Install in …”.

Open Claude Desktop → Settings → Developer → Edit Config, and paste this into claude_desktop_config.json

{
  "mcpServers": {
    "postgresql": {
      "command": "uvx",
      "args": [
        "mdev-postgresql-mcp-server"
      ],
      "env": {
        "POSTGRES_HOST": "your-value",
        "POSTGRES_PORT": "your-value",
        "POSTGRES_USER": "your-value",
        "POSTGRES_PASSWORD": "your-value",
        "POSTGRES_DB": "your-value",
        "POSTGRES_READ_QUERY_LIMIT": "your-value"
      }
    }
  }
}

Run this in your terminal

claude mcp add postgresql --env POSTGRES_HOST=your-value --env POSTGRES_PORT=your-value --env POSTGRES_USER=your-value --env POSTGRES_PASSWORD=your-value --env POSTGRES_DB=your-value --env POSTGRES_READ_QUERY_LIMIT=your-value -- uvx mdev-postgresql-mcp-server

Fill in the empty values before running it.

Open in Cursor

Or copy the settings yourself

Paste into .cursor/mcp.json in your project, or ~/.cursor/mcp.json

{
  "mcpServers": {
    "postgresql": {
      "command": "uvx",
      "args": [
        "mdev-postgresql-mcp-server"
      ],
      "env": {
        "POSTGRES_HOST": "your-value",
        "POSTGRES_PORT": "your-value",
        "POSTGRES_USER": "your-value",
        "POSTGRES_PASSWORD": "your-value",
        "POSTGRES_DB": "your-value",
        "POSTGRES_READ_QUERY_LIMIT": "your-value"
      }
    }
  }
}

Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.

Open in VS Code

Or copy the settings yourself

Paste into .vscode/mcp.json in your project

{
  "servers": {
    "postgresql": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "mdev-postgresql-mcp-server"
      ],
      "env": {
        "POSTGRES_HOST": "your-value",
        "POSTGRES_PORT": "your-value",
        "POSTGRES_USER": "your-value",
        "POSTGRES_PASSWORD": "your-value",
        "POSTGRES_DB": "your-value",
        "POSTGRES_READ_QUERY_LIMIT": "your-value"
      }
    }
  }
}

Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.

This one runs on your computer, and ChatGPT can only connect to servers on the internet. Pick another app.

Your choice stays on this device in a cookie; no account needed.

Values you fill in

  • POSTGRES_HOST required env
    PostgreSQL host
  • POSTGRES_PORT required env
    PostgreSQL port
  • POSTGRES_USER required env
    PostgreSQL username
  • POSTGRES_PASSWORD secret env
    PostgreSQL password
  • POSTGRES_DB required env
    PostgreSQL database name
  • POSTGRES_READ_QUERY_LIMIT env
    Maximum rows returned by read queries

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 6, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account musaddiq-dev, which owns the repo

  • … Not checked yet

    Still maintained

    We have not read this repo from GitHub yet

  • … Not checked yet

    Has a licence

    We have not read this repo from GitHub yet

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Compared with others in Databases & datasetsi

  • More stars than 0% of the other 953 servers in this category
  • Published to the registry more recently than 13% of the other 953 servers in this category
  • Basic checks equal to or better than 100% of the other 953 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is PostgreSQL MCP Server safe?

It passed 1 of 1 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

You need to fill in: POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed –, and the latest version (0.1.2) reached the registry 6 months ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.

What can I use instead?

In the same category: Supabase, MongoDB MCP Server, Elasticsearch MCP Server

Alternatives

Servers in the same category from other makers, sorted by stars.

Reading a card:★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Supabase

by supabase

Supabase’s official server lets AI create tables, query data and review project settings in your Supabase database.

Computer or cloud★ 2,993Apache-2.0Updated yesterday
Install

MongoDB MCP Server

by mongodb-js

MongoDB Model Context Protocol Server

Runs on your computer★ 1,157Apache-2.0Updated 2 days ago
Install

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

PostgreSQL MCP Server

A Python Model Context Protocol (MCP) server for inspecting and querying PostgreSQL databases from MCP-compatible clients. It provides schema discovery, safe read-only query execution, query explanation, table previews, index analysis, relationship inspection, and PostgreSQL resources for table metadata.

Features

  • List public tables and inspect table schemas
  • Execute read-only SQL in a PostgreSQL read-only transaction
  • Explain query plans without executing the target query directly
  • Preview table rows with a fixed limit
  • Inspect foreign-key relationships and indexes
  • Expose passive MCP resources for table lists and schema details

Safety Model

postgresql_execute_read_query runs with PostgreSQL read-only transaction mode, caps returned rows by POSTGRES_READ_QUERY_LIMIT, and rolls back after execution. The server also includes postgresql_execute_write_query, which only accepts a single INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, or TRUNCATE statement and can modify data/schema if the connected database user has permission. Do not auto-approve write-capable tools in your MCP client. For public or shared use, run the server with a dedicated read-only PostgreSQL user.

Requirements

  • Python 3.11+
  • PostgreSQL database
  • MCP-compatible client such as Claude Desktop, Cursor, VS Code, or another MCP host

Installation

When published to PyPI, install or run the server like a standard Python MCP package:

uvx mdev-postgresql-mcp-server

For local development from source:

git clone https://github.com/musaddiq-dev/postgresql-mcp-server.git

cd postgresql-mcp-server python -m venv .venv source .venv/bin/activate pip install -e .

Configuration

Copy the example environment file and update it with your database connection details.

cp .env.example .env
VariableDescriptionRequiredDefault
POSTGRES_HOSTPostgreSQL hostYeslocalhost
POSTGRES_PORTPostgreSQL portYes5432
POSTGRES_USERPostgreSQL usernameYesNone
POSTGRES_PASSWORDPostgreSQL passwordNoNone
POSTGRES_DBPostgreSQL database nameYesNone
LOG_LEVELPython logging level written to stderrNoINFO
POSTGRES_READ_QUERY_LIMITMaximum rows returned by read queriesNo1000

Example read-only user:

CREATE USER mcp_readonly WITH PASSWORD 'change-me';

GRANT CONNECT ON DATABASE your_database TO mcp_readonly; GRANT USAGE ON SCHEMA public TO mcp_readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO mcp_readonly; ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO mcp_readonly;

Running

mdev-postgresql-mcp-server

From a local checkout before PyPI publication, run:

python -m postgresql_mcp_server.server

MCP Client Configuration

For published installs, prefer uvx. MCP servers using stdio must write protocol messages only to stdout; this server writes logs to stderr through Python logging.

Claude Desktop / Cursor / Windsurf / Cline

Most MCP clients accept this mcpServers JSON shape:

{

"mcpServers": { "postgresql": { "command": "uvx", "args": ["mdev-postgresql-mcp-server"], "env": { "POSTGRES_HOST": "localhost", "POSTGRES_PORT": "5432", "POSTGRES_USER": "mcp_readonly", "POSTGRES_PASSWORD": "change-me", "POSTGRES_DB": "your_database" } } } }

For local development from this repository, use the installed console script path instead:

{

"mcpServers": { "postgresql": { "command": "/absolute/path/to/postgresql-mcp-server/.venv/bin/mdev-postgresql-mcp-server", "args": [], "env": { "POSTGRES_HOST": "localhost", "POSTGRES_PORT": "5432", "POSTGRES_USER": "mcp_readonly", "POSTGRES_PASSWORD": "change-me", "POSTGRES_DB": "your_database" } } } }

Claude Code CLI
claude mcp add postgresql \

--env POSTGRES_HOST=localhost \ --env POSTGRES_PORT=5432 \ --env POSTGRES_USER=mcp_readonly \ --env POSTGRES_PASSWORD=change-me \ --env POSTGRES_DB=your_database \ -- uvx mdev-postgresql-mcp-server

VS Code MCP

VS Code uses the same command/args/env model in its MCP configuration:

{

"servers": { "postgresql": { "type": "stdio", "command": "uvx", "args": ["mdev-postgresql-mcp-server"], "env": { "POSTGRES_HOST": "localhost", "POSTGRES_PORT": "5432", "POSTGRES_USER": "mcp_readonly", "POSTGRES_PASSWORD": "change-me", "POSTGRES_DB": "your_database" } } } }

Tools

ToolPurposeSafety
postgresql_list_tablesList public base tablesRead-only
postgresql_describe_tableShow columns and metadata for a tableRead-only
postgresql_execute_read_queryRun bounded SQL under read-only transaction modeRead-only
postgresql_execute_write_queryRun a single approved modifying SQL statement and commitDestructive
postgresql_explain_queryReturn PostgreSQL EXPLAIN output for a single queryRead-only
postgresql_get_database_summaryReturn database version and table countRead-only
postgresql_get_relationshipsInspect foreign-key relationshipsRead-only
postgresql_analyze_indexesInspect indexes and sizesRead-only
postgresql_preview_tableReturn up to 10 rows from a tableRead-only
postgresql_search_sql_definitionsSearch public SQL routines/functionsRead-only

Resources

  • postgres://list_tables returns public table names.
  • postgres://schema/{table_name} returns a generated schema statement for a table.

Smoke Check

Without a database, verify syntax with:

python -m py_compile src/postgresql_mcp_server/server.py

With a configured database, start the server and use your MCP client to call list_tables.

Distribution

This server is published through the standard Python MCP distribution path:

  • PyPI package: mdev-postgresql-mcp-server
  • MCP Registry name: io.github.musaddiq-dev/postgresql-mcp-server
  • Runtime hint: uvx
  • Transport: stdio

The mcp-name marker at the top of this README is required for MCP Registry ownership verification. Users should prefer uvx mdev-postgresql-mcp-server in local MCP client configurations.

Security Notes

  • Do not commit .env or MCP client configs containing credentials.
  • Use least-privilege database users.
  • Treat execute_write_query as destructive and require explicit user approval in your MCP client.
  • Review generated SQL before running write-capable tools.

License

MIT

Ask PopNx