MCP.Market

Postgres MCP server

by edelciomolina·io.github.edelciomolina/postgres-mcp·v1.7.0·5 stars

PostgreSQL MCP wrapper with .env credential mapping, tool selection, and safe read-only defaults.

B82/100grade B
What users say
No reviews yet
Be the first
Safety scan
B82/100

full report

Adoption
Growing

5 stars110 downloads/wk

Reviews

Write one

Nobody has reviewed Postgres MCP yet.

If you have run it, two minutes of your experience saves the next person an afternoon.

Postgres MCP tools (16, 3 write)

write = sends, deletes, buys or posts

Read from the package source without running it. The installed server may list more.

  • pg_analyze_database

    Analyze PostgreSQL database performance and configuration.

  • pg_debug_database

    Diagnose common PostgreSQL issues - connections, locks, performance, replication.

  • pg_execute_mutationwrite action

    Execute data modification operations - INSERT, UPDATE, DELETE, or UPSERT. NOT enabled by default; must be opted-in via tool= arg.

  • pg_execute_querywrite action

    Execute SELECT queries and data retrieval operations - operation="select/count/exists" with query and optional parameters.

  • pg_execute_sqlwrite action

    Execute arbitrary SQL statements with optional transaction support. NOT enabled by default; must be opted-in via tool= arg.

  • pg_get_setup_instructions

    Get platform-specific PostgreSQL setup and connection instructions.

  • pg_inspect_schema

    Inspect PostgreSQL schema - list tables and columns, view ENUM types. Read-only.

  • pg_manage_constraints

    Manage PostgreSQL constraints - get, create foreign keys, drop constraints.

  • pg_manage_functions

    Manage PostgreSQL functions - get, create, or drop functions.

  • pg_manage_indexes

    Manage PostgreSQL indexes - get, create, drop, reindex, and analyze usage.

  • pg_manage_query

    Manage PostgreSQL query analysis and performance - EXPLAIN plans, slow queries, statistics.

  • pg_manage_rls

    Manage PostgreSQL Row-Level Security - enable/disable RLS and manage policies.

  • pg_manage_schema

    Manage PostgreSQL schema - get schema info, create/alter tables, manage enums.

  • pg_manage_triggers

    Manage PostgreSQL triggers - get, create, drop, enable/disable.

  • pg_manage_users

    Manage PostgreSQL users and permissions - get permissions, create/drop/alter users, grant/revoke.

  • pg_monitor_database

    Get real-time monitoring information for a PostgreSQL database.

Public scan report

scanner v0.1.9 · 2026-09-27 · same rubric, same numbers if you re-run it

no findings
  • Code scan3 source files scanned25/25
  • –Live reliabilityno gateway calls yet and no remote to proben/a
  • –Tool poisoningtools not inspected (local package is not executed); not countedn/a
  • Auth qualitylocal package, no credentials required12/15
  • Maintenancelast push 105 days ago8/15
  • Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Overall 82/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

How Postgres MCP compares

Against every graded Databases MCP server, from our own scans and uptime checks. Updated after each scan run.

Safety score
82/100
higher than 55% of 802 Databases servers
Tools
16
the typical Databases server has 8
Tools that change things
19%
typical: 10%. Fewer write tools means less an agent can break
GitHub stars
5
more than 73% of 602 Databases servers
Downloads a week
110
more than 60% of 328 Databases servers with a package

What its tools let an agent do: 13 read · 3 change

Install Postgres MCP in Claude Code, Cursor or VS Code

Runs npx -y @edelciomolina/postgres-mcp on your machine. Read the scan report first; the gateway never runs local packages.

claude mcp add postgres-mcp -- npx -y @edelciomolina/postgres-mcp
Add to Cursor

What the publisher says

From the Postgres MCP repository's README, as published. We do not edit it. Read it on GitHub

English | 🌐 Português

Postgres MCP 🔌 Native MCP server for PostgreSQL - reads credentials from .env at runtime with flexible key mapping, configurable tool selection, and read-only mode by default.

✨ What it does

Most LLMs interact with databases by guessing - assuming table names, inventing column names, and writing queries that may fail or expose sensitive data. Postgres MCP solves this by giving the LLM a structured, safe interface to actually understand the database before touching it.

Built with @modelcontextprotocol/sdk and pg, it provides:

  • 🧠 Semantic knowledge graph - the LLM gets a complete map of schemas, tables, columns, foreign keys, inferred relations, risk levels, and business domains - built from the real schema, not invented
  • 🛡️ Read-only by default - no writes, no DDL, no arbitrary SQL unless you explicitly opt in; pgclassifyquery_risk lets the LLM check a query's safety before running it
  • 🔐 Runtime credential resolution - credentials are read from .env at startup; nothing sensitive lives in mcp.json
  • 🎯 Explicit tool selection - every tool is opt-in via tool= args, so the LLM only sees what you choose to expose

📋 Requirements

  • ⚙️ Node.js >= 18
  • 📄 A .env file with database credentials (anywhere in the project tree - see .env Discovery)

🚀 Installation

There are two ways to use this package. Choose the one that best fits your workflow.

Option 1 - No installation (via npx, recommended for quick start)

No installation needed. npx downloads and runs the package on demand. Add -y as the first argument to skip the confirmation prompt.

{
  "servers": {
    "Postgres Tools": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@edelciomolina/postgres-mcp"
      ],
      "env": {
        "MCP_KEY_HOST":    "DB_HOST",
        "MCP_KEY_PORT":    "DB_PORT",
        "MCP_KEY_NAME":    "DB_NAME",
        "MCP_KEY_SSLMODE": "DB_SSLMODE",
        "MCP_KEY_USER":    "DB_USER",
        "MCP_KEY_PASS":    "DB_PASS"
      }
    }
  }
}

This starts the server with the default read-only tool set - no tool= arguments needed. To enable write-capable tools, see Write-capable tools.

💡 Using Supabase, Neon, Railway or another platform that only provides a connection string? Use MCPKEYURL pointing to DATABASE_URL (or whatever variable name the platform uses). The server will prioritize the URL and ignore the individual variables. See Connection via URL.

Option 2 - Install via VS Code (MCP extension marketplace)

VS Code supports discovering and installing MCP servers directly in the editor, without using the terminal.

Shortened. The full README is on GitHub.

Nothing above is checked by us. What we check is on the safety report.

Postgres MCP: common questions

Is Postgres MCP server safe?
Mostly: it is graded B (82/100). Read the Postgres MCP safety report
How do I install Postgres MCP?
It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
Does Postgres MCP need an API key?
No secret keys are declared. It reads 6 settings from the environment.
Is Postgres MCP maintained?
The last commit was 143 days ago (2026-06-13). The latest release is v1.7.0.
What can I use instead of Postgres MCP?
Servers from other publishers that do the same job: PostgreSQL MCP server, PostgreSQL MCP Server and Quarry MCP server.
How does Postgres MCP compare with other Databases MCP servers?
safety score 82/100 (higher than 55% of 802 Databases servers); tools 16 (the typical Databases server has 8); tools that change things 19% (typical: 10%. Fewer write tools means less an agent can break). Full comparison.

Alternatives to Postgres MCP

Same job from other publishers: the closest match first, then the best rated.

  • PostgreSQL
    MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
    B
  • PostgreSQL MCP Server
    PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants
    B
  • Quarry
    Safety-railed database access: Postgres, MySQL, SQLite, Redis. Read-only by default.
    A
  • PostgreSQL MCP Server
    PostgreSQL MCP server with 203 tools, connection pooling, HTTP/SSE, OAuth 2.1, and tool filtering
    A
  • DB Explorer
    Read-only SQL for PostgreSQL, MySQL and SQLite: schema, safe SELECTs, EXPLAIN, index advice
    B