Pgconsole MCP Server

Postgres Editor with Guardrails

Local serverstdio

What is the Pgconsole MCP server?

Postgres Editor with Guardrails. That is what the pgconsole mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

Getting it running

@pgplex/pgconsole on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

The tools it exposes

The server publishes 6 tools. What each one is for:

  • Autocomplete — context-aware suggestions for tables, columns, joins, and CTEs
  • Formatting — pretty-print or collapse SQL to one line
  • Text-to-SQL — describe a query in natural language, get SQL back
  • Permission — shaped tools** — every agent can list_connections; catalog tools (list_objects, describe_table) appear once it has an accessible connection, and
  • Connection-scoped — permissions are granted per connection, not globally
  • Prerequisites — The Prerequisites tool exposed by this server

What it needs from you

  • Node.js 20+

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

This sits in the database access group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Pgconsole's toolset — Autocomplete, Formatting, Text-to-SQL and 3 more — is a fair guide to whether it matches your workflow. It is maintained by GitHub Actions; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
Autocompletecontext-aware suggestions for tables, columns, joins, and CTEs
Formattingpretty-print or collapse SQL to one line
Text-to-SQLdescribe a query in natural language, get SQL back
Permissionshaped tools** — every agent can list_connections; catalog tools (list_objects, describe_table) appear once it has an accessible connection, and execution tools unlock per grant: explain_query (explain), query (read), wr
Connection-scopedpermissions are granted per connection, not globally
PrerequisitesThe Prerequisites tool exposed by this server.

How to install the Pgconsole MCP server

{
  "mcpServers": {
    "pgconsole": {
      "command": "npx",
      "args": ["-y", "@pgplex/pgconsole"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Node.js 20+

Example prompts to try

  • Use Pgconsole to Autocomplete.
  • Use Pgconsole to Formatting.
  • Use Pgconsole to Text-to-SQL.

Frequently asked questions

It connects Pgconsole to MCP-compatible AI assistants such as Claude and Cursor, exposing 6 tools (Autocomplete, Formatting, Text-to-SQL, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Pgconsole directly.