mcesptool/Makefile
Ryan Malloy 64c1505a00 Add QEMU ESP32 emulation support
Integrate Espressif's QEMU fork for virtual ESP device management:

- QemuManager component with 5 MCP tools (start/stop/list/status/flash)
- Config auto-detects QEMU binaries from ~/.espressif/tools/
- Supports esp32, esp32s2, esp32s3, esp32c3 chip emulation
- Virtual serial over TCP (socket://localhost:PORT) transparent to esptool
- Scan integration: QEMU instances appear in esp_scan_ports results
- Blank flash images initialized to 0xFF (erased NOR flash state)
- 38 unit tests covering lifecycle, port allocation, flash writes
2026-01-28 15:35:22 -07:00

91 lines
2.1 KiB
Makefile

# MCP ESPTool Server Makefile
.PHONY: help install dev test lint format clean docker-build docker-up docker-down docker-logs
# Default target
help:
@echo "MCP ESPTool Server Development Commands"
@echo ""
@echo "Setup & Installation:"
@echo " install Install project with uv"
@echo " dev Install in development mode"
@echo ""
@echo "Development:"
@echo " test Run test suite"
@echo " lint Run linting checks"
@echo " format Format code with ruff"
@echo " clean Clean build artifacts"
@echo ""
@echo "Docker Operations:"
@echo " docker-build Build development container"
@echo " docker-up Start development environment"
@echo " docker-down Stop development environment"
@echo " docker-logs View container logs"
@echo ""
@echo "MCP Integration:"
@echo " mcp-install Install server with Claude Code"
@echo " mcp-test Test MCP server integration"
# Installation
install:
uv sync
dev:
uv sync --dev
uv run pre-commit install
# Testing and Quality
test:
PYTHONPATH=src uv run pytest tests/ -v
test-watch:
PYTHONPATH=src uv run pytest-watch tests/
lint:
uv run ruff check src/ tests/
uv run mypy src/
format:
uv run ruff format src/ tests/
uv run ruff check --fix src/ tests/
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -rf build/ dist/ *.egg-info/
rm -rf .pytest_cache/ .coverage .mypy_cache/
# Docker Operations
docker-build:
docker compose build
docker-up:
docker compose up -d
@echo "Development environment started"
@echo "Run 'make docker-logs' to view logs"
docker-down:
docker compose down
docker-logs:
docker compose logs -f
# MCP Integration
mcp-install:
claude mcp add mcp-esptool-server "uvx mcp-esptool-server"
@echo "MCP server installed with Claude Code"
@echo "You can now use it in Claude conversations"
mcp-test:
uvx mcp-esptool-server --help
@echo "Testing MCP server installation..."
# Development shortcuts
run:
uv run mcp-esptool-server
run-debug:
uv run mcp-esptool-server --debug
run-production:
uv run mcp-esptool-server --production