mcvsphere/docker-compose.yml
Ryan Malloy 9e39c1c678 Refactor to modular mixin architecture with 74 tools
Major refactoring from monolithic server.py to modular MCPMixin pattern:

Architecture:
- src/esxi_mcp_server/ package with proper src-layout
- FastMCP MCPMixin pattern for tool organization
- Separate mixins for each functional area
- Shared VMwareConnection class with lazy datastore/network lookup

New Mixins Added:
- DiskManagementMixin: add_disk, remove_disk, extend_disk, list_disks,
  attach_iso, detach_iso
- NICManagementMixin: add_nic, remove_nic, change_nic_network,
  connect_nic, set_nic_mac, list_nics
- HostManagementMixin: get_host_info, enter/exit_maintenance_mode,
  list_services, start/stop_service, set_service_policy,
  get/configure_ntp, reboot_host, shutdown_host, get_host_hardware,
  get_host_networking
- OVFManagementMixin: deploy_ovf, export_vm_ovf, list_ovf_networks
- ResourcesMixin: Added move_datastore_file, copy_datastore_file

Streaming Support:
- Generator-based streaming for datastore downloads
- Memory-efficient large file handling with save_to parameter
- Chunked uploads from disk

Testing:
- test_client.py: MCP SDK-based test client
- Validates all 74 tools against real ESXi host

Build System:
- pyproject.toml with uv, ruff configuration
- Docker dev/prod modes with hot-reload
- Updated Makefile for uv-based workflow
2025-12-26 05:53:51 -07:00

64 lines
1.4 KiB
YAML

# ESXi MCP Server Docker Compose Configuration
# Supports dev (hot-reload) and prod modes via COMPOSE_PROFILES
services:
esxi-mcp-server:
build:
context: .
dockerfile: Dockerfile
container_name: esxi-mcp-server
restart: unless-stopped
profiles: ["prod"]
ports:
- "${MCP_PORT:-8080}:8080"
volumes:
- ./logs:/app/logs
env_file:
- .env
environment:
- MCP_TRANSPORT=sse
- MCP_HOST=0.0.0.0
- MCP_PORT=8080
networks:
- mcp-network
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s
deploy:
resources:
limits:
memory: 512M
cpus: '0.5'
reservations:
memory: 256M
cpus: '0.25'
# Development mode with hot-reload
esxi-mcp-server-dev:
build:
context: .
dockerfile: Dockerfile.dev
container_name: esxi-mcp-server-dev
profiles: ["dev"]
ports:
- "${MCP_PORT:-8080}:8080"
volumes:
- ./src:/app/src:ro
- ./logs:/app/logs
env_file:
- .env
environment:
- MCP_TRANSPORT=sse
- MCP_HOST=0.0.0.0
- MCP_PORT=8080
- LOG_LEVEL=DEBUG
networks:
- mcp-network
networks:
mcp-network:
driver: bridge