Atlas / MCP servers / ericzakariasson / Postgres

PostgresBLOCK

mcp/ericzakariasson/postgres-13

MCP Server for Postgres

Verdict
BLOCK
Grade
D
Trust score
69 /100
Exposed tools
1 1r · 0w · 0d
Transport
stdio · streamable-http
License
MIT
Stars
180
01

Overview

From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.

A Model Context Protocol server for PostgreSQL databases. Enables LLMs to query and analyze PostgreSQL databases through a controlled interface.

https://github.com/user-attachments/assets/6571c20c-91c9-4a6e-8332-13b587b79fbf

Installation

[](https://cursor.com/en/install-mcp?name=postgres&config=eyJjb21tYW5kIjoibnB4IC0teWVzIHBnLW1jcC1zZXJ2ZXIgLS10cmFuc3BvcnQgc3RkaW8iLCJlbnYiOnsiREFUQUJBU0VfVVJMIjoicG9zdGdyZXNxbDovL3Bvc3RncmVzOnBvc3RncmVzQGxvY2FsaG9zdDo1NDMyL3Bvc3RncmVzIn19)

Add to your MCP client settings:

{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["--yes", "pg-mcp-server", "--transport", "stdio"],
"env": {
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
}
}
}
}

Configuration

  • DATABASE_URL - PostgreSQL connection string (required)
  • DANGEROUSLY_ALLOW_WRITE_OPS - Enable writes (default: false)
  • DEBUG - Enable debug logging (default: false)
  • PG_SSL_ROOT_CERT - Optional path to a TLS CA bundle (e.g., AWS RDS global bundle)

Usage

Transports

  • Default transport is stdio. Switch to HTTP with the --transport flag.
  • HTTP mode serves the MCP Streamable HTTP endpoint at /mcp on PORT (default 3000).
  • Clients that support Streamable HTTP should connect to http://localhost:3000/mcp.

Start commands:

# stdio transport (default, via installed CLI)
pg-mcp-server --transport=stdio

# http transport
pg-mcp-server --transport=http

Tools

  • `query` - Execute SQL queries
{ "sql": "SELECT * FROM users WHERE active = true LIMIT 10" }

Resources

  • `postgres://tables` - List all tables
  • `postgres://table/{schema}/{table}` - Get table schema and sample data

Example Prompts

Here's an example prompt to test if your MCP server is working:

Show me the first 5 users from the database
Read from source at commit c58e39969dcaOBSERVED · 2026-10-06
02

Connect

Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.

claude-code
claude mcp add pg-mcp-server -- npx -y [email protected]
claude-desktop
{
  "mcpServers": {
    "pg-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "[email protected]"
      ]
    }
  }
}
03

Exposed tools (1)

1 read · 0 write · 0 destructive.

ToolRiskDescription
queryread
04

Trust audit

BLOCKgrade D · trust 69/100 Do not install this without reading the findings. The audit found something that could harm you or your machine.

LayerWhat it checksResult
L0Provenance & inventoryPASS
L1Static analysis of the codeFAIL
L2Instruction surface (what it tells the agent)PASS
L3Class-specific surfacePASS
L4Behavioural (sandbox)SKIPPED

What the source does

Filesystem
none-observed
Network
none-observed
Shell
none-observed
Dependencies
not all pinned
Secrets in source
found

Findings (6)

HIGHHard-coded secrets · secret.db_uri · CWE-798, CWE-321
package.json:29
"inspector:stdio": "DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres npx @modelcontextprotocol/inspector bun run index.ts --transport=stdio",
HIGHHard-coded secrets · secret.db_uri · CWE-798, CWE-321
package.json:30
"inspector:http": "DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres npx @modelcontextprotocol/inspector bun run index.ts --transport=http",
MEDIUMHard-coded secrets · secret.db_uri · CWE-798, CWE-321
README.md:20
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
MEDIUMHard-coded secrets · secret.db_uri · CWE-798, CWE-321
README.md:122
"DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/postgres"
LOWSupply chain · supply.unpinned · CWE-829, CWE-1357
package.json
@modelcontextprotocol/sdk, postgres, zod, @types/bun, @types/node, prettier
Why it matters. 6 dependency range(s) float
Fix. pin exact versions or ship a lockfile
INFOInventory / provenance · inv.oversize · CWE-1104
assets/demo.mp4
assets/demo.mp4
Why it matters. 4493838 bytes not read

Gates applied: no_behavioural_pass.

Audited 2026-10-06 · audit v0.4.1 · source sha c58e39969dcafull audit observations/trust-audit/mcp-server/ericzakariasson__postgres-13.json · Report an issue / request a re-scan
05

Audit history

Every audit this server has had. A grade with a past is a grade somebody is still checking.

DateSourceVerdictGradeScoreChange
2026-10-06c58e39969dcaBLOCKD69first audit
06

Questions

What is the Postgres MCP server?

MCP Server for Postgres

What tools does Postgres expose?

1 in total: 1 read-only, 0 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.

Is Postgres safe to connect to an agent?

No — not without reading the findings first. The audit graded it D (69/100) and found 2 critical or high issues in the source. Each one is listed on this page with the file and line it is on.

What credentials does Postgres need?

No credential environment variables were found in its source, so it appears to need none.

How does Postgres run?

It speaks stdio and streamable-http, so it runs as a local process your client starts. It is published on npm as pg-mcp-server at 0.3.0.

How current is this page?

The grade is for one exact copy of the source (c58e39969dca), read on 2026-10-06. The repository is watched and re-audited when it changes.

Advertisement