Cette page est affichée en anglais. Une traduction française est en cours.
MCP ConfigsMay 14, 2026·2 min de lecture

pg-mcp-server — Postgres MCP Server (Read-Only)

Connect LLMs to PostgreSQL via MCP with pg-mcp-server: run via npx, default stdio transport, and keep writes disabled unless explicitly enabled.

MCP Hub
MCP Hub · Community
Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
Mcp Config
Installation
Stage only
Confiance
Confiance : Established
Point d'entrée
Asset
Commande de staging sûr
npx -y tokrepo@latest install 251c0dd6-bd54-5c52-932a-42bf25b34b3e --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

Introduction

Connect LLMs to PostgreSQL via MCP with pg-mcp-server: run via npx, default stdio transport, and keep writes disabled unless explicitly enabled.

Best for: Developers who want controlled Postgres access for agents (read-only by default)

Works with: Any MCP client that can run stdio or streamable HTTP; requires DATABASE_URL

Setup time: 6-15 minutes

Key facts (verified)

  • GitHub: 176 stars · 15 forks · pushed 2025-11-03.
  • License: MIT · owner avatar + repo URL verified via GitHub API.
  • README-backed entrypoint: npx --yes pg-mcp-server --transport stdio.

Main

  • Keep writes off: README documents DANGEROUSLY_ALLOW_WRITE_OPS=false by default; start with read-only query + schema inspection.

  • Pick the transport your client supports: stdio is the default; HTTP mode serves a Streamable HTTP endpoint at /mcp (PORT defaults to 3000).

  • Use the provided resources (postgres://tables, postgres://table/{schema}/{table}) to keep prompts short and structured.

Source-backed notes

  • README provides an MCP client config snippet that runs npx --yes pg-mcp-server --transport stdio with DATABASE_URL set.
  • README lists env vars: DATABASE_URL, DANGEROUSLY_ALLOW_WRITE_OPS (default false), DEBUG, and PG_SSL_ROOT_CERT.
  • README documents tools/resources including query plus postgres://tables and postgres://table/{schema}/{table}.

FAQ

  • Can it connect over HTTP?: Yes. README says HTTP mode serves /mcp on PORT (default 3000).
  • Is it safe to enable writes?: Only if you understand the risk. Keep writes disabled until you have guardrails and allowlists.
  • Do I need a global install?: No. README supports running via npx --yes ... without installing globally.
🙏

Source et remerciements

Source: https://github.com/ericzakariasson/pg-mcp-server > License: MIT > GitHub stars: 176 · forks: 15

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires