20aed903ba
- Voice pipeline: ESP32 WebSocket client → voice bridge → LLM → Piper TTS (Tower :8001) - Hints engine: 3 puzzles (LA_440, LEFOU_PIANO, QR_FINALE), anti-cheat, 3 hint levels - MCP hardware server: 6 tools (puzzle, audio, LED, camera, scenario, status), stdio transport - Analytics: ESP32 module + 6 web endpoints + Dashboard UI with chat interface - Security: auth middleware (Bearer NVS), rate limiting, input validation on 30 endpoints - Frontend: code-split (1.1MB → 210KB initial), ErrorBoundary, API timeout, WS reconnect - Tests: 24 Python + 38 TypeScript + 18 MCP = 80 project tests (+ 19 mascarade) - Specs: AI_INTEGRATION_SPEC, MCP_HARDWARE_SERVER_SPEC, QA_TEST_MATRIX_SPEC - Docs: SECURITY, DEPLOYMENT_RUNBOOK, voice pipeline guide, AI architecture map - 6 AI agent definitions (.github/agents/ai_*.md) - TUI orchestration script (tools/dev/zacus_tui.py) - Docker compose TTS for Tower + KXKM-AI - CHANGELOG, README, mkdocs.yml updated - Cycle detection (DFS) in runtime3 validator - Sprint plan: plans/SPRINT_AI_INTEGRATION.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.7 KiB
1.7 KiB
Custom Agent – AI MCP Hardware Server
Scope
MCP server bridging LLM tool calls to ESP32 hardware actions (lights, motors, sensors, locks).
Technologies
- MCP protocol (Model Context Protocol), JSON-RPC 2.0
- mascarade MCP client infrastructure
- ESP32 web API (HTTP + WebSocket)
Do
- Define MCP tool schemas for each hardware action (e.g.,
set_light,read_sensor,unlock_door). - Implement JSON-RPC 2.0 transport (stdio + HTTP/SSE for remote).
- Add device discovery via mDNS or static registry.
- Enforce auth tokens between mascarade and MCP server.
- Return structured results with status codes and sensor readings.
Must Not
- Expose hardware tools without authentication (token or mutual TLS).
- Allow unbounded concurrent tool calls to the same device (serialize per-device).
- Commit auth tokens or secrets to git.
Dependencies
- mascarade MCP infrastructure — client registration, tool routing.
- ESP32 web API — HTTP endpoints on each device for hardware control.
Test Gates
- Tool call round-trip latency < 500 ms (mascarade → MCP server → ESP32 → response).
- 100% success rate on all defined tools against a live or mock device.
References
- MCP specification: https://modelcontextprotocol.io
- mascarade MCP client:
/Users/electron/mascarade/core/mcp/
Plan d'action
- Valider le schéma des outils MCP.
- run: python3 tools/ai/mcp_schema_validate.py --schema mcp/tools.json
- Tester la latence aller-retour sur un device mock.
- run: python3 tools/ai/mcp_latency_bench.py --target mock --max-latency 500
- Vérifier l'authentification et la découverte des devices.
- run: python3 tools/ai/mcp_auth_test.py --require-token