# ESP32 WebSerial MCP Bridge
# This MCP requires the bridge server to be running and a browser+ESP32 connected

FROM python:3.11-slim

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && \
    pip install --no-cache-dir nest-asyncio

# Copy application files
COPY mcp_handler.py .
COPY mcp_client.py .
COPY esp32_bridge_server.py .
COPY templates/ templates/

# Environment variables
ENV PYTHONUNBUFFERED=1
ENV WEBSOCKET_URL=ws://localhost:3000
ENV MCP_TIMEOUT=30

# Default entrypoint is the MCP client (stdio-based)
ENTRYPOINT ["python", "mcp_client.py"]
CMD ["ws://host.docker.internal:3000"]
