diff --git a/CLAUDE.md b/CLAUDE.md index 87829c5..6d44e0d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -72,6 +72,7 @@ journalctl -u haproxy-mcp -f # Logs | `HAPROXY_SERVERS_FILE` | `/opt/haproxy/conf/servers.json` | Servers config path | | `HAPROXY_POOL_COUNT` | `100` | Number of pool backends | | `HAPROXY_MAX_SLOTS` | `10` | Max servers per pool | +| `HAPROXY_CONTAINER` | `haproxy` | Podman container name | | `LOG_LEVEL` | `INFO` | Logging level (DEBUG/INFO/WARNING/ERROR) | ## Zero-Reload Domain Management @@ -105,6 +106,17 @@ This will: - Backends always use HTTP (port 80 or custom) - SSL/TLS termination happens at HAProxy frontend - Each pool has 10 server slots (pool_N_1 to pool_N_10) +- **IPv6 supported**: Both IPv4 and IPv6 addresses accepted + +### Bulk Server Operations +```bash +# Add multiple servers at once +haproxy_add_servers("api.example.com", '[ + {"slot": 1, "ip": "10.0.0.1", "http_port": 80}, + {"slot": 2, "ip": "10.0.0.2", "http_port": 80}, + {"slot": 3, "ip": "2001:db8::1", "http_port": 80} +]') +``` ### Files | File | Purpose | @@ -228,13 +240,13 @@ Returns backend server status for a specific domain: **Status values:** `healthy` (all UP), `degraded` (partial UP), `down` (all DOWN), `no_servers` -## MCP Tools (19 total) +## MCP Tools (20 total) ### Domain Management | Tool | Description | |------|-------------| -| `haproxy_list_domains` | List all domains with pool mappings and servers | -| `haproxy_add_domain` | Add domain to available pool (no reload) | +| `haproxy_list_domains` | List domains (use `include_wildcards=true` for wildcards) | +| `haproxy_add_domain` | Add domain to available pool (no reload), supports IPv6 | | `haproxy_remove_domain` | Remove domain from pool (no reload) | ### Server Management @@ -242,6 +254,7 @@ Returns backend server status for a specific domain: |------|-------------| | `haproxy_list_servers` | List servers for a domain | | `haproxy_add_server` | Add server to slot (1-10), auto-saved | +| `haproxy_add_servers` | Bulk add servers (JSON array), auto-saved | | `haproxy_remove_server` | Remove server from slot, auto-saved | | `haproxy_set_server_state` | Set state: ready/drain/maint | | `haproxy_set_server_weight` | Set weight (0-256) | @@ -264,7 +277,7 @@ Returns backend server status for a specific domain: ### Configuration | Tool | Description | |------|-------------| -| `haproxy_reload` | Validate and reload config | +| `haproxy_reload` | Validate, reload config, auto-restore servers | | `haproxy_check_config` | Validate config syntax | | `haproxy_save_state` | Save server state to disk (legacy) | | `haproxy_restore_state` | Restore state from disk (legacy) | @@ -322,7 +335,7 @@ echo "set server pool_1/pool_1_1 state ready" | nc localhost 9999 ``` /opt/haproxy/ ├── mcp/ # MCP server (streamable-http) -│ └── server.py # Main MCP server (~1300 lines, 19 tools) +│ └── server.py # Main MCP server (~1500 lines, 20 tools) ├── conf/ │ ├── haproxy.cfg # Main HAProxy config (100 pool backends) │ ├── domains.map # Domain → Pool mapping