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

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 94/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Mcp
Installation
Npx
Confiance
Confiance : Established
Point d'entrée
npx --yes pg-mcp-server --transport stdio
Commande CLI universelle
npx tokrepo install 251c0dd6-bd54-5c52-932a-42bf25b34b3e
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