
Flipper Zero를 위한 AI 기반 MCP 서버. Claude 또는 모든 MCP 클라이언트를 사용하여 WiFi를 통해 SubGHz, NFC, RFID, IR, BLE, GPIO 등을 제어합니다.
Flipper Zero의 WiFi Dev Board v1(ESP32-S2)에서 직접 실행되는 Rust MCP(Model Context Protocol) 서버로, AI 에이전트가 네트워크를 통해 Flipper Zero를 제어할 수 있게 해줍니다.
이 프로젝트는 MCP 서버를 Flipper 자체에 올립니다. MCP 호환 AI 클라이언트(Claude Desktop, Claude Code 등)라면 무엇이든 연결하여 Flipper의 기능을 도구로 사용할 수 있습니다 — SubGHz, NFC, RFID, IR, GPIO, BadUSB, iButton, 파일 저장소 등.
USB로 연결된 호스트 컴퓨터가 필요한 다른 프로젝트와 달리, flipper-mcp는 Flipper에 부착된 ESP32-S2 WiFi 모듈에서 실행됩니다. Flipper는 독립적이고 네트워크로 접근 가능한 도구가 됩니다.
LOCAL (same network):
MCP Client ──HTTP──► flipper-mcp.local:8080 (ESP32-S2) ──UART──► Flipper Zero
REMOTE (cross-network):
MCP Client ──HTTP──► Relay Server ◄──WebSocket── ESP32-S2 ──UART──► Flipper Zero
ESP32-S2는 MCP 프로토콜을 구현하는 HTTP 서버를 실행합니다. MCP 도구 호출을 115200 baud의 UART를 통해 Flipper Zero CLI 명령으로 변환합니다. 컴패니언 릴레이 서버는 모든 네트워크에서 원격 접속을 가능하게 합니다.
flipper-mcp.local로 mDNS 광고어떤 장치에 연결해야 하나요?
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install espup
espup install
source ~/export-esp.sh # Run this in every new terminal
cargo install espflash
cargo install ldproxy
sudo apt install -y git curl gcc build-essential pkg-config libudev-dev libssl-dev python3 python3-venv cmake ninja-build
전체 설정 안내는 docs/SETUP.md를 참조하세요
source ~/export-esp.sh
cd firmware
cargo build --release --target xtensa-esp32s2-espidf
espflash flash --monitor target/xtensa-esp32s2-espidf/release/flipper-mcp
Flipper SD 카드의 SD:/apps_data/flipper_mcp/config.txt에 config.txt를 생성하세요:
wifi_ssid=YourNetworkName
wifi_password=YourPassword
device_name=flipper-mcp
또는 컴패니언 FAP를 사용하여 Flipper에서 직접 구성할 수 있습니다 (5단계 참조):
Apps → Tools → Flipper MCP → Configure WiFi
설정 파일 없이 첫 부팅 시, ESP32는 대기하며 상태 파일에 status=needs_config를 기록합니다. Flipper FAP가 Status 화면에 이를 표시합니다.
AI 클라이언트를 구성하기 전에, curl로 서버에 접근 가능한지 확인하세요:
# Quick health check
curl http://flipper-mcp.local:8080/health
# Full verification — initialize + list all available tools
./scripts/test-connection.sh
# If mDNS isn't resolving on your OS, pass the IP directly:
./scripts/test-connection.sh 192.168.x.xxx
Flipper MCP → Status 메뉴에서 Flipper의 IP를 확인한 후 테스트하세요:
BLE 비컨 브로드캐스트 (스푸핑된 BLE 광고 전송):
curl -X POST http://192.168.0.58:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ble_beacon","arguments":{"data":"020106"}}}'
BLE HID 키보드 (무선 키보드를 에뮬레이트하고 입력):
# Start HID emulation
curl -X POST http://192.168.0.58:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ble_hid_start","arguments":{}}}'
# Type a message
curl -X POST http://192.168.0.58:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"ble_hid_type","arguments":{"text":"Hello from Flipper!"}}}'
# Stop HID emulation
curl -X POST http://192.168.0.58:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"ble_hid_stop","arguments":{}}}'
IR 전송 (IR 리모컨 코드 전송):
# NEC protocol IR code (generic TV power button)
curl -X POST http://192.168.0.58:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"ir_tx","arguments":{"protocol":"NEC","address":"00","command":"01","repeat":0}}}'
SubGHz 수신 (433.92 MHz에서 무선 신호 청취):
curl -X POST http://192.168.0.58:8080/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"subghz_rx","arguments":{"frequency":433920000,"duration":5000}}}'
192.168.0.58을 Flipper의 실제 IP 주소로 바꾸세요.
그런 다음 Claude Desktop 설정(claude_desktop_config.json)에 추가하세요:
{
"mcpServers": {
"flipper": {
"url": "http://flipper-mcp.local:8080/mcp"
}
}
}
flipper-app/의 컴패니언 Flipper MCP 앱을 Flipper Zero에 설치하세요. ufbt로 빌드하고 .fap을 SD:/apps/Tools/에 복사하세요:
cd flipper-app && ufbt # produces flipper_mcp.fap
# Copy flipper_mcp.fap to your Flipper SD card under apps/Tools/
앱은 Apps → Tools → Flipper MCP에 나타나며 다음을 제공합니다:
앱은 SD 카드 파일을 통해 통신합니다 (GPIO 헤더 외에 추가 배선 불필요). Configure WiFi는 첫 부팅 마법사입니다 — 휴대폰, 브라우저, PC 스크립트가 필요 없습니다.
자체 호스팅 (바이너리를 어디서든 실행):
./scripts/build-relay.sh
./target/release/flipper-mcp-relay --listen 0.0.0.0:9090
# Then add relay_url to config.txt on the Flipper SD card:
# relay_url=ws://your-server:9090/tunnel
클라우드 배포 (AWS 또는 GCP, TLS + DNS 포함):
# Bootstrap state storage, then deploy
./infra/bootstrap/aws.sh # or ./infra/bootstrap/gcp.sh
cd infra/aws && cp terraform.tfvars.example terraform.tfvars
tofu init && tofu apply
# Outputs the relay URL and a ready-to-paste wifi-config.sh command
전체 안내는 RELAY.md를 참조하세요.
커스텀 도구는 TOML 설정 파일을 통해 또는 SD 카드에 FAP 앱을 설치하여 추가할 수 있습니다. 모든 도구에 대한 복사-붙여넣기 curl 명령은 OPERATIONS.md를 참조하세요.
flipper-mcp를 사용하는 데 Claude 구독이 필요하지 않습니다. Open WebUI는 MCP Streamable HTTP(v0.6.31+)를 기본 지원하는 무료 자체 호스팅 ChatGPT 스타일 인터페이스입니다. Ollama와 함께 사용하면 완전히 로컬에서 오프라인으로 AI 기반 Flipper 제어가 가능합니다.
# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull a model with tool-calling support
ollama pull llama3.1 # 8B — good balance of speed and capability
# or: ollama pull qwen2.5 # strong tool-calling, good at structured output
# or: ollama pull mistral # lightweight, fast tool use
# Docker (recommended) — connects to Ollama on localhost automatically
docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
-e WEBUI_AUTH=False \
-v open-webui:/app/backend/data \
--name open-webui \
ghcr.io/open-webui/open-webui:main
# Or without Docker:
pip install open-webui
open-webui serve
브라우저에서 **http://localhost:3000**을 여세요.
http://flipper-mcp.local:8080/mcp (또는 http://192.168.x.x:8080/mcp)https://relay.example.com/mcphttp://host.docker.internal:8080/mcp 사용팁: Workspace → Models → (사용 중인 모델) → Advanced Parameters에서 더 작은 모델의 경우 Function Calling을 Default로 설정하세요. 강력한 내장 도구 지원이 있는 모델(Llama 3.1 8B+, Qwen 2.5, Mistral)에만 Native로 전환하세요.
연결되면 Open WebUI 채팅에서 다음을 시도해 보세요:
다단계 에이전트 작업은 더 큰 모델(Llama 3.1 70B, Qwen 2.5 72B, 또는 OpenAI 호환 API를 통한 클라우드 모델)에서 가장 잘 작동합니다. 더 작은 모델은 단일 도구 호출을 안정적으로 처리합니다.
flipper-mcp/
├── firmware/ # ESP32-S2 firmware (Rust, esp-idf-svc)
├── relay/ # Companion relay server (Rust, tokio/axum)
├── flipper-app/ # Flipper Zero FAP — in-device management UI (C, ufbt)
├── infra/ # OpenTofu IaC — cloud relay deployment (AWS + GCP)
├── config/ # Example module configurations
├── scripts/ # Build, flash, and setup helper scripts
└── docs/ # Architecture, setup, API, troubleshooting
완전한 프로젝트 컨텍스트, 기술 사양, 시스템 아키텍처, 그리고 이 프로젝트의 개발을 계속하는 데 필요한 모든 것은 AGENTS.md를 참조하세요.
MIT
| 단계 | 연결 대상 | 비고 |
|---|
| 펌웨어 플래싱 | WiFi Dev Board USB-C | 보드에 Flipper와 별도인 자체 USB 포트가 있음 |
| 시리얼 모니터링 | WiFi Dev Board USB-C | 플래싱과 동일한 USB 연결 |
| SD 카드 설정 파일 | Flipper Zero SD 카드 | SD를 Flipper에 삽입하거나, 분리하여 PC에 마운트 |
| 서버 제어 명령 | Flipper Zero SD 카드 | apps_data/flipper_mcp/에 server.cmd 파일 생성 |
| UART 통신 | 자동 | WiFi Dev Board와 Flipper는 GPIO 헤더로 연결됨 |
| MCP HTTP 요청 | WiFi Dev Board IP:8080 | WiFi 네트워크를 통해 연결 |
| 화면 | 기능 |
|---|
| Status | ESP32에 새 상태 업데이트를 요청하고 IP, SSID, 서버 상태, 버전을 표시 |
| Start / Stop / Restart | MCP HTTP 서버 수명 주기를 제어 |
| Reboot Board | ESP32 WiFi Dev Board를 재시작 |
| Configure WiFi | SSID + 비밀번호를 입력하는 온스크린 키보드; SD 카드에 config.txt를 기록 |
| View Logs | ESP32가 30초마다 기록하는 스크롤 가능한 진단 로그 |
| Tools List | ESP32에 현재 등록된 모든 MCP 도구의 스크롤 가능한 목록 |
| Refresh Modules | ESP32에서 FAP 검색 재스캔 + modules.toml 재로드를 트리거 |
| 카테고리 | 도구 | 설명 |
|---|
| SubGHz | subghz_tx, subghz_rx, subghz_decode_raw, subghz_chat, subghz_tx_from_file | 무선 주파수 작업 |
| NFC | nfc_detect, nfc_read, nfc_emulate, nfc_field | NFC 태그 상호작용 |
| RFID | rfid_read, rfid_emulate, rfid_write | 저주파 RFID |
| Infrared | ir_tx, ir_rx | IR 리모컨 |
| GPIO | gpio_read, gpio_write, gpio_set_mode | 핀 I/O 제어 |
| BadUSB | badusb_run, badusb_list | USB HID 공격 |
| iButton | ibutton_read, ibutton_emulate | 1-Wire 키 포브 |
| Storage | storage_list, storage_read, storage_write, storage_remove, storage_stat | SD 카드 파일 관리 |
| System | system_device_info, system_power_info, system_power_reboot, system_ps, system_free, system_uptime | 장치 관리 |
| BLE | ble_info, ble_beacon, ble_beacon_stop, ble_hid_start, ble_hid_type, ble_hid_press, ble_hid_mouse, ble_hid_stop | Bluetooth Low Energy (비컨 브로드캐스트 + HID 에뮬레이션) |
| Apps | app_launch_{name} (SD 카드에서 자동 검색) | 애플리케이션 관리 |
| 프롬프트 | 수행 작업 |
|---|
| "Scan for NFC tags near the Flipper" | nfc_detect를 호출하여 근처 태그를 읽음 |
| "List all files on the Flipper's SD card" | /ext에서 storage_list를 호출 |
| "Transmit this SubGHz signal on 433.92 MHz: ..." | 주어진 주파수로 subghz_tx를 호출 |
| "Read any RFID card that's presented to the Flipper" | rfid_read를 호출하고 태그 데이터를 반환 |
| "What apps are installed on the Flipper?" | app_list를 호출하여 설치된 FAP를 열거 |
| "Send this IR signal to turn off the TV" | 지정된 프로토콜과 데이터로 ir_tx를 호출 |
| "Show me the Flipper's system info and free memory" | system_info + system_free를 호출 |
| "Read the NFC tag, then save its data to /ext/nfc/captured.nfc" | 다단계: nfc_read → storage_write |
| "Monitor 315 MHz for 10 seconds and decode anything you hear" | 주파수와 지속 시간으로 subghz_rx를 호출 |