FPV_MCP - Betaflight MCP Server
An MCP (Model Context Protocol) server that allows Claude AI to interact with Betaflight flight controllers for FPV drone configuration, tuning, and management.
Overview
This MCP server enables natural language interaction with your FPV drone through Claude. Simply connect your drone via USB and ask Claude to read settings, adjust PIDs, manage blackbox logs, configure modes, and much more.
Tested with:
Betaflight 4.5.0
iFlight Blitz F722 (STM32F7)
Works with any Betaflight-compatible flight controller
Features
Connection Management
Auto-detect serial ports
Connect/disconnect flight controllers
Handle connection state properly
Read Configuration
Flight controller info (board, firmware, target)
PID settings and rates
Filter configuration
Battery settings
Motor configuration
VTX settings
OSD configuration
Blackbox settings
Feature flags
Write Configuration
Modify PIDs with validation (safe ranges 0-200)
Change rates and expo
Configure aux modes and switches
Adjust VTX settings (band, channel, power, pit mode)
Set failsafe configuration
Toggle features on/off
Sensor Data (Real-time)
Attitude (roll, pitch, yaw angles)
IMU data (gyro, accelerometer, magnetometer)
Battery status (voltage, current, mAh)
Motor output values
RC channel values
Safety Features
PID values validated before applying
Motor testing requires confirmation
Calibration checks arming state
Dangerous CLI commands blocked
Motor values clamped to safe PWM range
Changes require explicit save
Blackbox Management
Check blackbox storage status
Enter mass storage mode for log download
Erase blackbox logs
Parse blackbox headers for flight info
Installation
Prerequisites
Python 3.10 or higher
A Betaflight flight controller connected via USB
Claude Desktop or Claude Code
Install from source
Or with uv (recommended):
Using Virtual Environment
Configuration
Claude Desktop
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Claude Code
Or with a specific path:
Available Tools (45 total)
Connection (3 tools)
Tool | Description |
| List available serial ports |
| Connect to a Betaflight FC |
| Disconnect from FC |
Flight Controller Info (2 tools)
Tool | Description |
| Get firmware and board info |
| Get status, sensors, arming state |
PID & Rates (3 tools)
Tool | Description |
| Read current PID values |
| Modify PID values (with validation) |
| Get rates and expo settings |
Modes & Aux Channels (4 tools)
Tool | Description |
| List all flight modes (ARM, ANGLE, HORIZON, etc.) |
| Get aux channel to mode mappings |
| Map mode to aux channel range |
| Remove a mode mapping |
Profiles (4 tools)
Tool | Description |
| Get active PID/rate profile |
| Switch PID profile (1-3) |
| Switch rate profile (1-6) |
| Copy profile to another |
Failsafe & Safety (3 tools)
Tool | Description |
| Get failsafe settings |
| Configure failsafe behavior |
| Why can't I arm? |
| Comprehensive pre-flight checks |
VTX Control (5 tools)
Tool | Description |
| Get VTX settings |
| Change VTX channel (1-8) |
| Change VTX band (A, B, E, F, R) |
| Change VTX power level |
| Toggle pit mode on/off |
Sensor Data (5 tools)
Tool | Description |
| Current roll/pitch/yaw angles |
| Raw accelerometer/gyro/magnetometer |
| Voltage, current, mAh consumed |
| Current motor output values |
| RC receiver channel values |
Configuration (8 tools)
Tool | Description |
| Gyro and D-term filter settings |
| Battery voltage/capacity settings |
| Motor protocol, throttle limits |
| On-screen display settings |
| Data logging configuration |
| Onboard flash memory status |
| Enabled/disabled features |
| Toggle features on/off |
Motor Testing (2 tools)
Tool | Description |
| Spin individual motor (REMOVE PROPS!) |
| Stop all motors immediately |
Calibration (2 tools)
Tool | Description |
| Level calibration |
| Compass calibration |
Utilities (6 tools)
Tool | Description |
| Make the FC beep |
| Reboot the FC |
| Clear onboard flash |
| Set craft name |
| Save changes to EEPROM |
| Export config as CLI commands |
| Send raw CLI commands |
Usage Examples
Connection & Info
Modes & Switches
Tuning
VTX Control
Safety
Blackbox
Motor Testing (REMOVE PROPS FIRST!)
Backup & Restore
MSP Protocol
This server implements MSPv1 (MultiWii Serial Protocol) for communication with Betaflight. The protocol uses:
Baud rate: 115200
Message format:
$M< + length + command + data + checksum
Key MSP Codes Used
Code | Name | Description |
100 | MSP_IDENT | Legacy identification |
101 | MSP_STATUS | FC status |
102 | MSP_RAW_IMU | Raw sensor data |
108 | MSP_ATTITUDE | Orientation |
110 | MSP_ANALOG | Battery/RSSI |
112 | MSP_PID | PID values |
202 | MSP_SET_PID | Write PIDs |
34 | MSP_MODE_RANGES | Aux mode mappings |
75 | MSP_FAILSAFE_CONFIG | Failsafe settings |
88 | MSP_VTX_CONFIG | VTX configuration |
Project Structure
Troubleshooting
Serial port not found
Ensure FC is connected via USB
Close Betaflight Configurator (it locks the port)
On Linux:
sudo usermod -a -G dialout $USER
Connection timeout
Check FC is powered and not in DFU mode
Try unplugging and reconnecting USB
Verify baud rate is 115200
Permission denied
macOS: Grant terminal access to serial port
Linux: Check udev rules or add user to dialout group
Port busy error
Another application is using the serial port
Close Betaflight Configurator or other serial monitors
Safety Warnings
REMOVE PROPS before testing motors
Never arm indoors with props attached
Test failsafe before flying
Verify settings after making changes
Backup config before major changes
Contributing
Contributions welcome! Please:
Fork the repository
Create a feature branch
Submit a pull request
License
MIT
Acknowledgments
Betaflight - Flight controller firmware
MCP Protocol - Model Context Protocol by Anthropic
MultiWii Serial Protocol documentation
Built for the FPV community
This server cannot be installed