Haproxy MCP Server

A Model Context Protocol (MCP) server for HAProxy implemented in Go, leveraging HAProxy Runtime API and mcp-go.

Local serverstdioGo

What is the Haproxy MCP server?

A Model Context Protocol (MCP) server for HAProxy implemented in Go, leveraging HAProxy Runtime API and mcp-go. Exposed over MCP by the haproxy mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

What it actually does

The HAProxy MCP Server provides a standardized way for LLMs to interact with HAProxy's runtime API via the Model Context Protocol (MCP). This enables LLMs to perform HAProxy administration tasks, monitor server status, manage backend servers, and analyze traffic patterns, all through natural language interfaces.

  • Full HAProxy Runtime API Support — Comprehensive coverage of HAProxy's runtime API commands
  • Context-Aware Operations — All operations support proper timeout and cancellation handling
  • Stats Page Integration — Support for HAProxy's web-based statistics page for enhanced metrics and visualization
  • Secure Authentication — Support for secure connections to HAProxy runtime API
  • Multiple Transport Options — Supports both stdio and HTTP transports for flexibility in different environments
  • Enterprise Ready — Designed for production use in enterprise environments

Adding it to your client

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client. The configuration blocks on this page cover the common clients.

Its toolset

Everything the assistant can do here goes through one of these:

  • Miscellaneous — View errors, run echo tests, and get help information
  • Homebrew — The Homebrew tool exposed by this server
  • Testing — The Testing tool exposed by this server
  • Contributing — Contributions are welcome! Please feel free to submit a Pull Request

Configuration

You will need 8 environment variables: HAPROXY_HOST, HAPROXY_PORT, HAPROXY_RUNTIME_MODE, HAPROXY_RUNTIME_TIMEOUT, MCP_TRANSPORT, HAPROXY_RUNTIME_SOCKET, HAPROXY_STATS_ENABLED, HAPROXY_STATS_URL. 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.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • 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 haproxy mcp server does with a few real requests.

When to reach for it

Plenty of cloud and infrastructure servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Haproxy's toolset — Miscellaneous, Homebrew, Testing and 1 more — is a fair guide to whether it matches your workflow. It is maintained by tuannvm; 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
MiscellaneousView errors, run echo tests, and get help information
HomebrewThe Homebrew tool exposed by this server.
TestingThe Testing tool exposed by this server.
ContributingContributions are welcome! Please feel free to submit a Pull Request.

How to install the Haproxy MCP server

{
  "mcpServers": {
    "haproxy": {
      "command": "haproxy-mcp-server",
      "env": {
        "HAPROXY_HOST": "localhost",
        "HAPROXY_PORT": "9999",
        "HAPROXY_RUNTIME_MODE": "tcp4",
        "HAPROXY_RUNTIME_TIMEOUT": "10",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

Configuration as documented by the project. Restart the client after saving.

Configuration

VariableDescriptionRequired
HAPROXY_HOSTEndpoint or connection string the server talks to.Optional
HAPROXY_PORTConfiguration value read at startup.Optional
HAPROXY_RUNTIME_MODEConfiguration value read at startup.Optional
HAPROXY_RUNTIME_TIMEOUTConfiguration value read at startup.Optional
MCP_TRANSPORTConfiguration value read at startup.Optional
HAPROXY_RUNTIME_SOCKETConfiguration value read at startup.Optional
HAPROXY_STATS_ENABLEDConfiguration value read at startup.Optional
HAPROXY_STATS_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Haproxy to Miscellaneous.
  • Use Haproxy to Homebrew.
  • Use Haproxy to Testing.

Frequently asked questions

It connects Haproxy to MCP-compatible AI assistants such as Claude and Cursor, exposing 4 tools (Miscellaneous, Homebrew, Testing, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Haproxy directly.