Provides a REST API transport layer for the Flappy simulator, exposing trajectory simulation capabilities through HTTP endpoints with auto-generated documentation.
Wraps the Purdue BioRobotics Flappy CLI simulator, enabling programmatic control of flapping-wing dynamics simulations and trajectory data collection for reinforcement learning and system identification studies.
flappy-mcp - Bio-inspired flapping dynamics for MCP agents
TL;DR: Control the Purdue BioRobotics "Flappy" simulator through MCP so agents can explore flapping-wing dynamics and log trajectories without headless GUIs.
Table of contents
What it provides
Scenario | Value |
Flappy CLI automation | Drive the Purdue BioRobotics from Python or MCP without bespoke shell scripts. |
Trajectory logging | Collect pose, velocity, and energy histories as JSON for reinforcement learning or system-identification studies. |
MCP transport | Expose the CLI via STDIO/HTTP so ToolHive and other clients can batch missions or plug results into
. |
Quickstart
1. Install the wrapper
Build the CLI from the Purdue SMARTLab Flappy sources (partners receive access on request—see the research page for contact details) and point this wrapper to the resulting flappy_cli binary:
2. Simulate a trajectory
Run as a service
CLI (STDIO transport)
Use python -m flappy_mcp --describe to inspect metadata without starting the server.
FastAPI (REST)
Invoke via the auto-generated docs at http://127.0.0.1:8004/docs.
python-sdk tool (STDIO / MCP)
Launch with uv run mcp dev examples/flappy_tool.py and wire in your agent.
ToolHive smoke test
Requires the Flappy CLI executable:
Agent playbook
Policy tuning - sweep control inputs and feed trajectories into reinforcement-learning pipelines.
Sensor synthesis - generate inertial traces for testing perception/estimation stacks.
Energy studies - derive energy usage from the returned stroke kinematics or augment the scenario before launching the CLI.
Stretch ideas
Couple with
diffsphgradients to evaluate loads alongside motion.Feed trajectories into
ctrltest-mcpfor closed-loop evaluation.Build deck.gl overlays of position data for mission rehearsal.
Install & maintenance
Runtime install: follow the Quickstart
uv pip install "git+https://github.com/Three-Little-Birds/flappy-mcp.git"step on machines that need the MCP wrapper.Validate dependencies: set
FLAPPY_BINto the compiledflappy_clipath, run$FLAPPY_BIN --help, and confirm the simulator launches without interactive prompts.Runtime expectations: CLI runs block until completion and may take several minutes for long scenarios; the built-in sinusoidal fallback returns instantly. All trajectories are returned as lists of
{t, angle}samples in SI units so downstream controllers can replay them verbatim.Keep fixtures in sync: document any generated trajectories or fixture updates so downstream services can replay them reliably.
Contributing
uv pip install --system -e .[dev]Run
uv run ruff check .anduv run pytestSubmit sample trajectories or metrics with your PR so reviewers can validate quickly.
MIT license - see LICENSE.