loaditout.ai
SkillsPacksTrendingLeaderboardAPI DocsBlogSubmitRequestsCompareAgentsXPrivacyDisclaimer
{}loaditout.ai
Skills & MCPPacksBlog

mcp-postgres-server

MCP Tool

madmarin/mcp-postgres-server

A production-ready MCP server that exposes PostgreSQL databases via the Model Context Protocol

Install

$ npx loaditout add madmarin/mcp-postgres-server

Platform-specific configuration:

.claude/settings.json
{
  "mcpServers": {
    "mcp-postgres-server": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-postgres-server"
      ]
    }
  }
}

Add the config above to .claude/settings.json under the mcpServers key.

About

mcp-postgres-server

A production-ready Model Context Protocol (MCP) server that gives AI assistants (Claude, etc.) direct, safe access to your PostgreSQL database.

[](https://github.com/madmarin/mcp-postgres-server/actions/workflows/ci.yml) [](https://pypi.org/project/mcp-postgres-server/) [](https://pypi.org/project/mcp-postgres-server/) [](LICENSE)

---

What it does

mcp-postgres-server exposes five tools to any MCP-compatible client:

| Tool | Description | |------|-------------| | query | Execute a read-only SELECT statement and get JSON results | | execute | Run a write statement (INSERT, UPDATE, DELETE, DDL) — requires ALLOW_WRITE=true | | list_schemas | List all user schemas in the database | | list_tables | List tables/views in a schema with row estimates and sizes | | describe_table | Get columns, primary key, foreign keys, and indexes for a table |

---

Quickstart
1. Install
pip install mcp-postgres-server

Or install from source:

git clone https://github.com/madmarin/mcp-postgres-server
cd mcp-postgres-server
pip install -e .
2. Configure

Copy .env.example to .env and fill in your connection details:

cp .env.example .env

Minimum required:

DATABASE_URL=postgresql+psycopg://user:password@localhost:5432/mydb

If your password contains special characters (for example @, :, /, #, %), URL-encode it in DATABASE_URL.

Example:

# Raw password: p@ss:w0rd/with#chars%
DATABASE_URL=postgresql+psycopg://postgres:p%40ss%3Aw0rd%2Fwith%23chars%25@localhost:5432/mydb

You can encode safely with Python:

python3 -c "import urllib.

Tags

mcpmcp-serverpostgresqlpython

Reviews

Loading reviews...

Quality Signals

0
Installs
Last updated22 days ago
Security: AREADME

Safety

Risk Levelmedium
Data Access
read
Network Accessnone

Details

Sourcegithub-crawl
Last commit3/25/2026
View on GitHub→

Embed Badge

[![Loaditout](https://loaditout.ai/api/badge/madmarin/mcp-postgres-server)](https://loaditout.ai/skills/madmarin/mcp-postgres-server)