mirror of
https://github.com/mattintech/pyBTMCP.git
synced 2026-07-11 14:11:53 +00:00
Features: - MCP server with tools for AI-controlled device simulation - FastAPI backend with REST API and WebSocket support - Real-time device updates via WebSocket - Web UI for manual device control - ESP32 firmware for BLE device simulation - Docker containerization with MQTT broker Supported device types: - Heart Rate Monitor (BLE Heart Rate Service) - Treadmill (BLE Fitness Machine Service) - Bike Trainer (BLE Cycling Power Service) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
530 B
Bash
24 lines
530 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
# Start Mosquitto MQTT broker in background
|
|
/usr/sbin/mosquitto -c /app/config/mosquitto.conf &
|
|
MOSQUITTO_PID=$!
|
|
|
|
# Wait for Mosquitto to be ready
|
|
sleep 1
|
|
|
|
# Start FastAPI/Web UI in background
|
|
python -m uvicorn src.api.main:app --host 0.0.0.0 --port 8000 &
|
|
UVICORN_PID=$!
|
|
|
|
# Trap to cleanup background processes on exit
|
|
cleanup() {
|
|
kill $UVICORN_PID 2>/dev/null || true
|
|
kill $MOSQUITTO_PID 2>/dev/null || true
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
# Run MCP server as main process (stdio)
|
|
exec python -m src.mcp.server
|