Files
haproxy-mcp/haproxy_mcp/tools/__init__.py
kaffa 7bee373684 refactor: Modularize MCP server with command batching
- Split monolithic mcp/server.py (1874 lines) into haproxy_mcp/ package:
  - config.py: Configuration constants and environment variables
  - exceptions.py: Custom exception classes
  - validation.py: Input validation functions
  - haproxy_client.py: HAProxy Runtime API client with batch support
  - file_ops.py: Atomic file operations with locking
  - utils.py: CSV parsing utilities
  - tools/: MCP tools organized by function
    - domains.py: Domain management (3 tools)
    - servers.py: Server management (7 tools)
    - health.py: Health checks (3 tools)
    - monitoring.py: Monitoring (4 tools)
    - configuration.py: Config management (4 tools)

- Add haproxy_cmd_batch() for sending multiple commands in single TCP connection
- Optimize server operations: 1 connection instead of 2 per server
- Optimize startup restore: All servers in 1 connection (was 2×N)
- Update type hints to Python 3.9+ style (built-in generics)
- Remove unused imports and functions
- Update CLAUDE.md with new structure and performance notes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 03:50:42 +00:00

21 lines
561 B
Python

"""MCP Tools for HAProxy management."""
from .domains import register_domain_tools
from .servers import register_server_tools
from .health import register_health_tools
from .monitoring import register_monitoring_tools
from .configuration import register_config_tools
def register_all_tools(mcp):
"""Register all MCP tools with the server.
Args:
mcp: FastMCP server instance
"""
register_domain_tools(mcp)
register_server_tools(mcp)
register_health_tools(mcp)
register_monitoring_tools(mcp)
register_config_tools(mcp)