Mcpg MCP Server

A production-grade PostgreSQL Model Context Protocol (MCP) server.

Remote serverstreamable-http

What is the Mcpg MCP server?

Mcpg MCP server exists for a simple reason — assistants are far more useful when they can act on Mcpg directly instead of describing what you should do. A production-grade PostgreSQL Model Context Protocol (MCP) server.

What you get

Pull the pre-built image from the GitHub Container Registry (published on every tagged release — :latest tracks the newest, or pin a version like :0.6.5):

  • Safe by default. — Read-only access mode. Every user-supplied SQL
  • One server, broad surface. — Application data access (queries, search,
  • PostgreSQL-native everything. — No ORM, no abstraction tax — uses
  • Production-shaped, not demo-shaped. — Connection pooling, per-request
  • Observability built in. — Prometheus /metrics endpoint on the
  • Test-driven, multi-version. — 2,500+ unit tests plus an integration

Setting it up

Being a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.

What the assistant can call

Once Mcpg is connected, these are the calls the assistant has available:

  • Variable — Default
  • MCPG_ALLOW_DDL — false
  • MCPG_ALLOW_SHELL — false
  • MCPG_ALLOW_LISTEN — false
  • MCPG_SHELL_TIMEOUT_SEC — 60
  • MCPG_SHELL_MAX_OUTPUT_BYTES — 67108864
  • MCPG_SUBPROCESS_BIN_ALLOWLIST — —
  • MCPG_SUBPROCESS_CPU_SECONDS — —
  • MCPG_SUBPROCESS_MEMORY_MB — —
  • Core — The Core tool exposed by this server
  • Audit — The Audit tool exposed by this server

Configuration and credentials

You will need 8 environment variables: MCPG_DATABASE_URL, MCPG_HTTP_AUTH_TOKEN, ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, XAI_API_KEY, GROQ_API_KEY, MCPG_HTTP_HOST. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Before you rely on it

  • Your data travels to the provider's service, so the usual questions apply about what you send and what they retain.
  • With 11 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Mcpg.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the mcpg mcp server does with a few real requests.

Choosing this one

Among the database access options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Mcpg's toolset — Variable, MCPG_ALLOW_DDL, MCPG_ALLOW_SHELL and 8 more — is a fair guide to whether it matches your workflow. It is maintained by devopam; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Available tools

ToolWhat it does
VariableDefault
MCPG_ALLOW_DDLfalse
MCPG_ALLOW_SHELLfalse
MCPG_ALLOW_LISTENfalse
MCPG_SHELL_TIMEOUT_SEC60
MCPG_SHELL_MAX_OUTPUT_BYTES67108864
MCPG_SUBPROCESS_BIN_ALLOWLIST
MCPG_SUBPROCESS_CPU_SECONDS
MCPG_SUBPROCESS_MEMORY_MB
CoreThe Core tool exposed by this server.
AuditThe Audit tool exposed by this server.

How to install the Mcpg MCP server

{
  "mcpServers": {
    "mcpg": {
      "command": "uvx",
      "args": ["mcpg"],
      "env": {
        "MCPG_DATABASE_URL": "your-value",
        "MCPG_HTTP_AUTH_TOKEN": "your-value",
        "ANTHROPIC_API_KEY": "your-value",
        "OPENAI_API_KEY": "your-value",
        "GEMINI_API_KEY": "your-value",
        "XAI_API_KEY": "your-value",
        "GROQ_API_KEY": "your-value",
        "MCPG_HTTP_HOST": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
MCPG_DATABASE_URLEndpoint or connection string the server talks to.Yes
MCPG_HTTP_AUTH_TOKENCredential the server authenticates with.Yes
ANTHROPIC_API_KEYCredential the server authenticates with.Yes
OPENAI_API_KEYCredential the server authenticates with.Yes
GEMINI_API_KEYCredential the server authenticates with.Yes
XAI_API_KEYCredential the server authenticates with.Yes
GROQ_API_KEYCredential the server authenticates with.Yes
MCPG_HTTP_HOSTEndpoint or connection string the server talks to.Optional

Example prompts to try

  • Use Mcpg to Variable.
  • Use Mcpg to MCPG ALLOW DDL.
  • Use Mcpg to MCPG ALLOW SHELL.

Frequently asked questions

It connects Mcpg to MCP-compatible AI assistants such as Claude and Cursor, exposing 11 tools (Variable, MCPG_ALLOW_DDL, MCPG_ALLOW_SHELL, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Mcpg directly.