mcp-postgres MCP Server

Servidor Model Context Protocol que expone introspección y consulta read-only sobre PostgreSQL. Diseñado para alimentar de contexto a Claude (Claude Code, Claude Desktop) sin riesgo de escritura.

Local serverstdioMIT

What is the mcp-postgres MCP Server?

mcp-postgres is an MCP project maintained in the cuevacelis/mcp_postgres repository. The maintainer describes its purpose as “Servidor Model Context Protocol que expone introspección y consulta read-only sobre PostgreSQL. Diseñado para alimentar de contexto a Claude (Claude Code, Claude Desktop) sin riesgo…”. Read the project documentation for the complete scope.

Local setup

The project provides a local client configuration using node. Follow the repository’s build and installation steps before copying it, and replace example paths with the paths on your own computer.

Configuration values

The example declares DB_HOST, DB_NAME, DB_USER, DB_PASSWORD, DB_SCHEMAS. Secret-looking values have been replaced with placeholders. Required and optional labels are shown only when the documentation states them.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
postgres_list_schemasLista esquemas accesibles.
postgres_list_tablesTablas de un esquema con conteo de columnas (paginado).
postgres_describe_tableColumnas, constraints (PK/FK/UNIQUE) e índices.
postgres_list_functionsFunciones/procedimientos con firma, retorno y lenguaje (paginado).
postgres_list_triggersTriggers con tabla, evento y timing (paginado).
postgres_get_function_definitionCódigo fuente de una función (con soporte de sobrecarga).
postgres_get_trigger_definitionDefinición completa de un trigger.
postgres_list_viewsVistas regulares y materializadas (paginado).
postgres_search_columnsBusca columnas por nombre/patrón en todos los esquemas permitidos.
postgres_query_tableSELECT seguro sobre una sola tabla con filtros estructurados.
postgres_execute_querySELECT/WITH avanzado (JOINs, CTEs, agregaciones). Single-statement, READ ONLY.
postgres_explain_queryEXPLAIN / EXPLAIN ANALYZE de un SELECT — perfila planes antes de ejecutar.
postgres_get_table_statsTamaño total/tabla/índices/toast, vacuum/analyze, índices con idx_scan = 0.

How to install the mcp-postgres MCP Server

{
  "mcpServers": {
    "postgres": {
      "command": "node",
      "args": [
        "/ruta/absoluta/al/proyecto/dist/index.js"
      ],
      "env": {
        "DB_HOST": "...",
        "DB_NAME": "...",
        "DB_USER": "...",
        "DB_PASSWORD": "YOUR_DB_PASSWORD",
        "DB_SCHEMAS": "public"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
DB_HOSTDeclared in the maintainer’s client configuration.Check documentation
DB_NAMEDeclared in the maintainer’s client configuration.Check documentation
DB_USERDeclared in the maintainer’s client configuration.Check documentation
DB_PASSWORDDeclared in the maintainer’s client configuration.Check documentation
DB_SCHEMASDeclared in the maintainer’s client configuration.Check documentation