Esta página se muestra en inglés. Una traducción al español está en curso.
MCP ConfigsMay 14, 2026·2 min de lectura

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.

Listo para agents

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 17/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
Mcp Config
Instalación
Stage only
Confianza
Confianza: Established
Entrada
Asset
Comando de staging seguro
npx -y tokrepo@latest install 251c0dd6-bd54-5c52-932a-42bf25b34b3e --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

Introducción

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.
🙏

Fuente y agradecimientos

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

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados