Multigres Mcp

Postgres diagnostics and cluster operations for Multigres clusters.

LLM Mart 1 views 10 listing impressions

An MCP server for Multigres clusters. It gives an MCP client two groups of tools:

  • Postgres diagnostics through the Multigres gateway: schemas and objects, read-only SQL, query plans with hypothetical indexes, top queries, index advice and a health check. Every tool of postgres-mcp has a counterpart here, so there is no need to run postgres-mcp as well.
  • Cluster tools through multiadmin: cluster status, backups, node logs, and in the unrestricted mode switching the primary and starting or expiring backups.

The server is read-only by default. Write tools are registered only in the unrestricted mode.

It has been tested against a local Multigres Docker cluster built from commit 5fa0f2955ede (2026-11-10, PostgreSQL 17.7, two cells) on Linux with Docker Engine. Other setups have not been tested.

Install

Each release has a multigres-mcp-<version>.mcpb file. It is an MCP Bundle: clients that install bundles ask for the settings under "Configuration" and run the server. It is also a zip file whose server/ directory holds binaries for Linux and macOS on amd64 and arm64 and for Windows on amd64, which any other client can run directly.

Build

Requires Go 1.26 or later.

git clone https://github.com/JoongHyuk-Shin/multigres-mcp
cd multigres-mcp
go build -o multigres-mcp ./cmd/multigres-mcp

The server talks MCP over standard input and output. ./multigres-mcp --help prints the options.

packaging/build-mcpb.sh builds the release bundle into dist/. It also needs jq, Node.js and openssl.

Configuration

Every option can be given as a flag or as an environment variable. A flag wins over the variable.

Flag Variable Default Meaning
--database-url DATABASE_URI none, required Connection string of the Multigres gateway.
--admin-url MULTIGRES_ADMIN_URL none multiadmin HTTP address. The cluster tools are registered only when it is set.
--admin-token MULTIGRES_ADMIN_TOKEN none Bearer token for multiadmin started with --enable-auth.
--node-host-map MULTIGRES_NODE_HOST_MAP none reported=reachable host pairs, comma separated, for the direct node connections of read_node_log and of the node option of diagnose and get_top_queries. multiadmin reports each node's host as the cluster sees it; this replaces a host that the server cannot reach. Ports are not changed.
--access-mode MULTIGRES_MCP_ACCESS_MODE restricted restricted (read-only) or unrestricted (adds the write tools).
--sql-timeout MULTIGRES_MCP_SQL_TIMEOUT 25s Statement timeout for the SQL every tool sends. See "Things to know".

Direct node connections reuse the user, password and database of --database-url and take the host and port from multiadmin.

In the local Docker cluster both nodes report the host localhost, while their Postgres ports are reachable only at the container's address. Find that address in the Multigres checkout with:

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$(docker compose ps -q multigres)"

and pass it as --node-host-map localhost=<address>.

Adding it to an MCP client

With Claude Code, for the local Docker cluster (replace 172.18.0.2 with the address found above):

claude mcp add multigres -e DATABASE_URI=postgres://postgres:postgres@localhost:15432/postgres -- /path/to/multigres-mcp --admin-url http://localhost:15000 --node-host-map localhost=172.18.0.2

Other clients take the same command, arguments and environment in their server configuration, for example:

From the project's README.

Related servers

Vintage analog TV/VHS image tool for macOS: ntsc-rs signal emulation + RetroArch CRT shaders (librashader), glued together with SwiftUI/Metal

29 views

Read and write RAGE Package Format archives

28 views

MCP server for Geargrafx PC Engine / TurboGrafx-16 emulator

19 views

See how ChatGPT, Claude, Gemini and Perplexity read any website. Scored out of 100.

19 views