Metadata-Version: 2.1
Name: morph-pilot
Version: 1.0.0
Summary: MCP server for controlling KY UFO WiFi drones from Claude
Author: cklam12345
Project-URL: Repository, https://github.com/cklam12345/morphDrone
Keywords: mcp,drone,ky-ufo,claude,ai
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opencv-python>=4.5

# morph-pilot

MCP server that lets Claude control a **KY UFO WiFi drone** — fly it, move it, photograph with it, and capture live camera frames for vision AI.

Part of the [morph-sense](https://github.com/cklam12345) toolkit.

---

## Hardware

- **Drone:** KY UFO (cooingdv protocol) — widely available under many brand names
- **Connection:** Connect your laptop to the drone's WiFi AP (`192.168.1.1`)
- **Camera:** RTSP stream at `rtsp://192.168.1.1:7070/webcam`

---

## Install

```bash
pip install morph-pilot
```

Or run directly from source:

```bash
git clone https://github.com/cklam12345/morphDrone
cd morphDrone
pip install opencv-python
```

---

## Wire up Claude Code

Add to your project's `.claude/settings.json`:

```json
{
  "mcpServers": {
    "drone": {
      "command": "morph-pilot"
    }
  }
}
```

Or if running from source:

```json
{
  "mcpServers": {
    "drone": {
      "command": "python3",
      "args": ["/path/to/morphDrone/mcp/drone_server.py"]
    }
  }
}
```

Restart Claude Code — the drone tools will appear automatically.

---

## Tools

| Tool | Description |
|---|---|
| `connect` | Connect to drone and start heartbeat. **Call first.** |
| `calibrate` | Calibrate gyro — drone must be on a flat surface. Wait 5s before takeoff. |
| `take_off` | Toggle takeoff. Drone rises to hover altitude. |
| `land` | Toggle land. Drone descends and cuts motors. |
| `move` | Move on any axis. Values −100 to 100, duration in seconds. |
| `emergency_stop` | Instant motor cut-off. Drone drops — emergencies only. |
| `photograph` | Trigger onboard camera shutter. |
| `videotape` | Toggle onboard video recording. |
| `capture_frame` | Grab a JPEG frame from the live RTSP stream. Returns local file path. |

### `move` axis reference

| Axis | Negative (−100) | Positive (+100) |
|---|---|---|
| `roll` | Left | Right |
| `pitch` | Forward | Backward |
| `throttle` | Up | Down |
| `yaw` | Rotate left | Rotate right |

> **Note:** pitch and throttle are hardware-inverted on KY UFO — morph-pilot handles this automatically.

---

## Example conversation

> "Connect to the drone, calibrate, take off, fly forward for 2 seconds, then land."

Claude will call: `connect` → `calibrate` → `take_off` → `move(pitch=-50, duration=2)` → `land`

> "Capture a frame and tell me what the drone sees."

Claude will call: `capture_frame` → reads `/tmp/drone_frame.jpg` → describes the image.

---

## Network setup

| Address | Purpose |
|---|---|
| `192.168.1.1:7099` UDP | Flight commands |
| `192.168.1.1:7070` TCP | RTSP camera stream |
| `192.168.1.101` | Required local bind address |

---

## License

MIT
