Mmcp.market

Postgres MCP server

by ofershap·io.github.ofershap/postgres·v1.0.0

PostgreSQL MCP — query databases, inspect schemas, explain queries.

A88/100grade A
What users say
No reviews yet
Be the first
Safety scan
A88/100

full report

Adoption
New

0 stars25 downloads/wk

Reviews

Write one

Nobody has reviewed Postgres yet.

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

Postgres tools (5, 1 write)

write = sends, deletes, buys or posts

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

  • explain

    Explain the execution plan for a SQL query (EXPLAIN FORMAT TEXT, optional ANALYZE).

  • list_schemas

    List non-system PostgreSQL schemas in the connected database.

  • querywrite action

    Execute a SQL query against PostgreSQL. Returns results as a formatted table. Read-only by default.

  • schema

    Get tables in a PostgreSQL schema with columns and approximate row counts.

  • table_info

    Get detailed info about a single table: columns, types, constraints, and exact row count.

Public scan report

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

no findings
  • Code scan2 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 42 days ago12/15
  • Maintainer identityregistry namespace matches repository owner; GitHub account older than a year8/10
Overall 88/100. Components that don't apply are left out of the denominator. Any critical finding is an F.RubricAppeal a findingJSON

Install Postgres in Claude Code, Cursor or VS Code

Runs npx -y mcp-pg-server on your machine. Read the scan report first; the gateway never runs local packages.

claude mcp add postgres -- npx -y mcp-pg-server
Add to Cursor

What the publisher says

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

mcp-server-postgres

Query PostgreSQL, inspect schemas, and explain queries from your AI assistant. A daily-driver MCP for local and dev Postgres — same belt as docker and sqlite servers, not an enterprise DBA suite.

DATABASE_URL=postgres://user:pass@localhost:5432/mydb npx mcp-pg-server

Works with Claude Desktop, Cursor, VS Code Copilot, and any MCP client. Connects via DATABASE_URL or per-call connectionString.

Why

Postgres is the default for most new backends, local dev stacks, and agent workflows that need a real SQL database. You already run it in Docker or on localhost — this server lets your assistant query it, read schemas, and explain plans without leaving the IDE. Read-only by default so exploration stays safe; opt into writes when you need them.

Tools

Quick Start

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["mcp-pg-server"],
      "env": {
        "DATABASE_URL": "postgres://user:pass@localhost:5432/mydb"
      }
    }
  }
}

Claude Desktop

Add to claudedesktopconfig.json (macOS: ~/Library/Application Support/Claude/claudedesktopconfig.json):

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["mcp-pg-server"],
      "env": {
        "DATABASE_URL": "postgres://user:pass@localhost:5432/mydb"
      }
    }
  }
}

VS Code

Configure the MCP server in your VS Code settings to run npx mcp-pg-server with DATABASE_URL set.

Example prompts

  • "Show me the schema of the public tables"
  • "Query users: SELECT * FROM users LIMIT 10"
  • "Explain this join query"
  • "What schemas exist in this database?"
  • "How many rows are in the orders table?"

Safety

Read-only by default. The query tool accepts only SELECT, WITH, EXPLAIN, SHOW, and ANALYZE in readonly mode. Set readonly=false to enable INSERT, UPDATE, DELETE, and DDL.

Pass connectionString on any tool to override DATABASE_URL for a single call.

Development

npm install
npm run typecheck
npm run build
npm test
npm run format
npm run lint

See also

More MCP servers and developer tools on my portfolio.

Author

License

MIT © 2026 Ofer Shapira

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

Postgres: common questions

Is Postgres MCP server safe?
Yes, by our scan: it is graded A (88/100). Read the Postgres safety report
How do I install Postgres?
It runs on your machine. Copy the Claude Code, Cursor, VS Code or Claude Desktop config from the install section.
Does Postgres need an API key?
Not as far as the registry entry and our scan can tell: no credentials are declared or required.
Is Postgres maintained?
The last commit was 62 days ago (2026-08-12). The latest release is v1.0.0.
What can I use instead of Postgres?
Servers from other publishers that do the same job: LINQ to DB MCP server, PostgreSQL MCP Server and Grain SQL MCP server. Compare all Postgres alternatives.

Alternatives to Postgres

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

All Postgres alternatives →
  • LINQ to DB
    Inspect database schemas and execute SQL queries across multiple database providers with LINQ to DB.
    A
  • PostgreSQL MCP Server
    PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants
    B
  • Grain SQL
    Run SQL queries and inspect database schemas through safe, visible MCP tools.
    B
  • MCP Local WP
    WordPress database access via Local by Flywheel. Execute read-only MySQL queries and inspect schema.
    A
  • Read Only Local Postgres
    MCP server for read-only PostgreSQL database queries in Claude Desktop
    A

More from ofershap →