A production-grade PostgreSQL Model Context Protocol (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.
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):
Being a remote server, there is no local install. You register the endpoint with your client, authorise it once, and the tools appear.
Once Mcpg is connected, these are the calls the assistant has available:
Variable — DefaultMCPG_ALLOW_DDL — falseMCPG_ALLOW_SHELL — falseMCPG_ALLOW_LISTEN — falseMCPG_SHELL_TIMEOUT_SEC — 60MCPG_SHELL_MAX_OUTPUT_BYTES — 67108864MCPG_SUBPROCESS_BIN_ALLOWLIST — —MCPG_SUBPROCESS_CPU_SECONDS — —MCPG_SUBPROCESS_MEMORY_MB — —Core — The Core tool exposed by this serverAudit — The Audit tool exposed by this serverYou 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.
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.
| Tool | What it does |
|---|---|
| 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. |
{
"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.
| Variable | Description | Required |
|---|---|---|
| MCPG_DATABASE_URL | Endpoint or connection string the server talks to. | Yes |
| MCPG_HTTP_AUTH_TOKEN | Credential the server authenticates with. | Yes |
| ANTHROPIC_API_KEY | Credential the server authenticates with. | Yes |
| OPENAI_API_KEY | Credential the server authenticates with. | Yes |
| GEMINI_API_KEY | Credential the server authenticates with. | Yes |
| XAI_API_KEY | Credential the server authenticates with. | Yes |
| GROQ_API_KEY | Credential the server authenticates with. | Yes |
| MCPG_HTTP_HOST | Endpoint or connection string the server talks to. | Optional |
Read-only SQL access to Postgres — let your assistant inspect schemas and answer questions from real data.
Manage your whole Supabase project in conversation — database, auth, storage, Edge Functions and branches.
Query, modify and analyse local SQLite databases in conversation — the fastest way to chat with a data file.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Official MongoDB server covering data, schemas and Atlas management — from find queries to spinning up clusters.
Serverless Postgres with database branching — point your assistant at Neon and let it work on disposable copies.