Skip to content
Menu

MCP server / databases / source-linked

PostgreSQL MCP

This reference server is intentionally narrow: expose a PostgreSQL database to an agent for schema discovery and read-only analysis. That boundary is useful for audits and reporting, but it is not a write-capable database operator and is not a current maintained package.

Before you choose.

Identify the implementation and the job it supports.

Which implementation is this?
The modelcontextprotocol PostgreSQL server is an archived reference server for read-only schema inspection and SQL queries.
Implementation source ↗

This reference server is intentionally narrow: expose a PostgreSQL database to an agent for schema discovery and read-only analysis. That boundary is useful for audits and reporting, but it is not a write-capable database operator and is not a current maintained package.

Setup and connection.

The documented interface, authentication and installation path.

Connection / transport
stdio via NPX or Docker
Authentication
Database connection URL credentials; local process access

Use a read-only database user and configure `@modelcontextprotocol/server-postgres` with a PostgreSQL URL. The archived README's NPX example is `npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb`.

Setup reference ↗

Documented setup example. Review the source and credentials before running; this command was not executed for this article.

{"mcpServers":{"postgres":{"command":"npx","args":["-y","@modelcontextprotocol/server-postgres","postgresql://localhost/mydb"]}}}

What it actually exposes.

Concrete capabilities with maintainer sources.

Documented capability / 01

Run read-only SQL

The query tool executes SQL inside a READ ONLY transaction.

Documentation ↗
Documented capability / 02

Inspect schemas

Resources expose discovered table names, columns and data types as JSON schema information.

Documentation ↗
Documented capability / 03

Use standard local configs

The reference documents NPX and Docker configurations for common desktop clients.

Documentation ↗

Evidence and method.

What was checked and what was not tested.

WHO

Editorial record

Compiled by clawbot.ai.

HOW

Source method

Public maintainer documentation and repositories. This is not a hands-on product review.

WHEN

Last checked 2026-10-01

Setup examples are documented examples. Suggested trials and comparison advice are editorial guidance.

Sources support the adjacent factual statements. A source review does not establish uptime, performance, security or current account eligibility. Read the editorial policy.

Community signals.

Concrete reports from public community discussions, kept separate from product documentation.

Reddit r/mcp / Read-only mode is perceived as high value with lower operational risk / positive / community_report_with_concrete_workflow2025-08-06 · Nipurn_1234

I spent 3 weeks building my dream MCP setup and honestly, most of it was useless

The user prefers a read-only database connection and reports a concrete debugging win, while implicitly avoiding write access.

“Read-only database access for debugging and analytics is perfect; it found a signup drop in two minutes.”
Open community source ↗

Community evidence is anecdotal and may reflect one setup, version or account. It is included for discovery and risk-sensing, not as a representative rating or independent benchmark. Verify the current official documentation before acting on a report.

Try a specific task.

A bounded evaluation you can reproduce in your own environment.

Proposed workflow: answer a data question safely

Suggested evaluation, not an observed test result.

  1. Create a database role limited to the reporting schema and read-only transactions.
  2. Inspect the schema before writing a query.
  3. Run a bounded query, cite its timestamp and have a human review the interpretation.

What to inspect: A reproducible analysis trail without database mutation. No database connection or query was executed here.

Workflow reference ↗

Permissions and limitations.

Read these constraints before granting access.

Boundary / 01

The query transaction is read-only; inserts, updates and DDL are outside the documented capability.

Boundary reference ↗
Boundary / 02

The reference server is archived, so pin versions and review maintenance before using it in a production workflow.

Boundary reference ↗

Decide by workflow.

Make the expected output explicit before you connect.

A reproducible analysis trail without database mutation. No database connection or query was executed here.

Keep the task inputs, tool calls, output and any errors together when you evaluate. The trial above is a proposal, not a recorded result.

Compare the alternatives.

Specific reasons to choose another route, with the tradeoff shown.

Editorial decision guidance inferred from the linked documentation; no quality or speed benchmark.
AlternativeChoose it whenTradeoff
SQLite MCPEditorial choice: the data is a local SQLite file.Also archived and includes write tools, so isolate the file.
Documentation ↗
MongoDB MCPEditorial choice: the source is MongoDB or Atlas.MongoDB's current server adds managed and write-capable paths.
Documentation ↗

Questions before setup.

Answers specific to this implementation.

Can this server update a table?

No. The documented query tool runs inside a read-only transaction.
Documentation ↗

Should I expose a production database directly?

Use a least-privileged role and a controlled network path; this reference does not provide a production governance layer.
Documentation ↗