Labsco
MCP SERVER

HAProxy MCP Server

by tuannvm

Administer HAProxy through its Runtime API from an assistant — server states, pool changes, sessions, maps and ACLs — over a TCP port or a Unix socket.

Network, Endpoint & Fleet Management
Summary
Either connection path alone is enough to be useful.

You do not need both: the stats page gives you metrics without exposing the admin socket, and when you use stats only there is no need to define Runtime API host and port at all. That matters because the Runtime API is an administrative channel — this same connection enables and disables backend servers. Restrict the TCP port or tighten socket permissions before pointing an assistant at production.

What it is

A Go MCP server that maps onto HAProxy's Runtime API commands, so an assistant can inspect and administer a live load balancer. It can also read HAProxy's web statistics page, and the two sources work independently or together.

What you get
  • Statistics and process info — `show_info` and `show_stat` map directly onto the Runtime API commands of the same names, with counters manageable alongside
  • Topology discovery — frontends, backends, server states and configuration details listed
  • Dynamic pool management — servers added and removed, enabled and disabled, and their properties adjusted
  • Session control — active sessions viewed and managed
  • Maps and ACL files managed, health checks and agent-based monitoring controlled
  • Errors viewed, echo tests run, and help information retrieved
  • Stats page integration as a second source, usable on its own when the Runtime API is not reachable
Requirements

A reachable HAProxy Runtime API, a stats page, or both — at least one must be configured for the server to work. Over TCP set `HAPROXY_HOST` and `HAPROXY_PORT` (default 9999) with `HAPROXY_RUNTIME_MODE` at `tcp4`; over a socket set `HAPROXY_RUNTIME_MODE` to `unix` and `HAPROXY_RUNTIME_SOCKET` (default `/var/run/haproxy/admin.sock`). For the stats page set `HAPROXY_STATS_ENABLED` and `HAPROXY_STATS_URL`. Transport is `MCP_TRANSPORT`, stdio or http. Install via `brew install haproxy-mcp-server`, a release binary, `go install github.com/tuannvm/haproxy-mcp-server/cmd/server@latest`, or the container at `ghcr.io/tuannvm/haproxy-mcp-server:latest`.

Setup effort

One command — brew install haproxy-mcp-server