show_statLABSCO 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_infoandshow_statmap 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
USE CASES
Seeing what state the load balancer is in
Read process information and statistics and get the numbers back as structured data rather than a scraped stats page.
Taking a backend out for maintenance
Find the server in the topology listing and disable it, then re-enable it when the work is finished.
Investigating a spike in errors
View the error records and current sessions together, so what is failing and what is in flight land in the same answer.
Watching metrics without opening the admin socket
Configure only the stats page — the Runtime API host and port can be left undefined entirely.
36 tools
Listed in project docs. Your client may show a different list.
show_infodebug_countersclear_counters_alldump_stats_fileshow_frontendshow_backendshow_servers_stateshow_mapshow_tableadd_serverdel_serverenable_serverdisable_serverset_weightset_maxconn_serverset_maxconn_frontendshow_sessshutdown_sessionshutdown_sessions_serveradd_mapdel_mapset_mapclear_mapcommit_mapadd_acldel_aclclear_aclcommit_aclenable_healthdisable_healthenable_agentdisable_agentshow_errorsechohelpBEFORE YOU INSTALL
What to know first
Tools you get
36 tools named in the project's documentation.
Requires
haproxy-mcp-server on PATH
INSTALLATION
Connect your client
Add the block to your client, or run the command directly.
Server setup
Configuration file
{
"mcpServers": {
"haproxy": {
"command": "haproxy-mcp-server",
"env": {
"HAPROXY_HOST": "localhost",
"HAPROXY_PORT": "9999",
"HAPROXY_RUNTIME_MODE": "tcp4",
"HAPROXY_RUNTIME_TIMEOUT": "10",
"MCP_TRANSPORT": "stdio"
}
}
}
}brew
brew install haproxy-mcp-server