# Flight tools

> Flight dynamics and flight control design tools that AI assistants drive over the Model Context Protocol (MCP).

Canonical page: https://aerospace-superintelligence.com/tools/

Status: available (early access; the source repository is not public yet).

Aircraft flight-dynamics analysis and flight-control design tools that any MCP-capable assistant (Claude, ChatGPT, local models) can operate directly: trim an aircraft, linearize it, analyze its modes, rate its flying qualities, design its control laws, simulate it and run Monte Carlo dispersions. Written in Rust, with no MATLAB or Simulink dependency.

## Coverage

- **Atmosphere and airspeeds**: ISA atmosphere to 51 km, airspeed conversions, flight condition from any two quantities.
- **Six-degree-of-freedom aircraft**: rigid-body model with table-driven aerodynamics and optional unsteady lift states; trim, linearization, mode naming.
- **Linear analysis**: state space and transfer functions, modal analysis, frequency and step response, stability margins.
- **Control design**: filter synthesis, automatic gain tuning, LQR, eigenstructure assignment, H∞ loop shaping, loop-at-a-time analysis, gain scheduling. Control design depends only on linear models, so it also works with models from flight-test identification or another tool.
- **Flying qualities**: MIL-F-8785C modal levels, roll performance, CAP, attitude bandwidth and phase delay, Gibson dropback, Neal–Smith, C*.
- **Nonlinear simulation**: controllers in the loop, sensor models, actuator rate limits, Dryden turbulence and gusts, comparison with measured data.
- **Monte Carlo**: dispersed parameters, initial states, turbulence and sensor noise, with exceedance probabilities and confidence intervals.
- **Envelope sweeps**: batch trim, linearize and rate across flight-condition grids, flight-path angles, mass and CG cases.
- **System identification**: output-error and filter-error maximum likelihood, Cramér–Rao bounds, identification input design.

## Safe to hand to an assistant

- Projects are addressed by name, not path, so a remote client cannot read or write outside the projects directory.
- Saves are written to a temporary directory and read back before replacing the previous copy.
- Loading or clearing refuses to discard unsaved results unless told to.
- The server will not listen beyond the local machine without a bearer token.

## Get started

Build (the binary is `target/release/asi-mcp`):

```bash
cd tools
cargo build --release
```

Local, over stdio (for example Claude Code):

```bash
claude mcp add aerospace -- /path/to/asi-mcp stdio
```

Remote, over streamable HTTP behind TLS with a bearer token; point the client at `https://your-host/mcp` with `Authorization: Bearer <token>`:

```bash
ASI_MCP_TOKEN=$(openssl rand -hex 32) asi-mcp http --bind 0.0.0.0:8787 --allowed-host tools.example.com
```

## Tool reference

<!-- TOOLS:BEGIN -->
70 tools, generated from the server's own tool list.

### Flight condition and aircraft

- `flight_condition`: Resolve a standard-day flight condition from exactly two of: mach, altitude_ft, altitude_m, kcas, keas, ktas, tas_mps, qbar_psf, qbar_pa.
- `list_aircraft`: List available aircraft models and linearization presets.
- `get_aircraft`: Get an aircraft's full definition (mass, inertia, geometry, aero coefficient tables, limits) and its state/input/output channel names and units.
- `define_aircraft`: Define a new rigid-body aircraft (SI units, angles in radians).

### Trim and linearization

- `trim_level_flight`: Trim an aircraft in wings-level steady flight (level, climb or descent) at a flight condition.
- `trim`: General trim: choose free states/inputs and target state derivatives/outputs (counts must match), with optional slaving constraints.
- `trim_maneuver`: Trim a steady maneuver: coordinated turn (bank_deg or load_factor; ball-centred or zero-sideslip coordination), wings-level pull-up/push-over (load_factor), steady-heading sideslip (beta_deg), or level.
- `linearize`: Linearize about an operating point (central differences).
- `import_linear_model`: Import an external linear model (e.g. from flight-test system identification or another tool) so it can be analyzed like a linearized one.

### Linear analysis

- `modal_analysis`: Eigenvalues as modes: natural frequency, damping, time constant, time to half/double, state participation, and classical names (short_period, phugoid, dutch_roll, roll, spiral, ...).
- `frequency_response`: Bode response of one input→output channel of a linear model, plus gain/phase/delay margins treating loop_sign × G as the loop transfer function with negative feedback.
- `transfer_function`: Transfer function (numerator/denominator, poles, zeros, DC gain) of one input→output channel of a linear model.
- `step_response`: Step response of a linear model to one input (perturbation from the operating point).
- `step_metrics`: Step-response metrics for one channel: rise time, overshoot, peak time, settling time, final value.

### Control design

- `design_filter`: Design a compensation filter from a frequency-domain spec.
- `filter_response`: Bode response of a designed filter.
- `define_controller`: Define a feedback controller as SISO paths from plant outputs (sensors) to plant inputs (actuators): u_to += gain · filters · y_from, closed loop u = command + K·y, and/or MIMO state-space blocks (system with input_names =…
- `design_gains`: Automatic gain design: tune chosen path gains (or block output/input gains: {"block": 0, "actuator": "aileron"} or {"block": 0, "sensor": "phi"}) within bounds to meet closed-loop modal targets (e.g. short_period damping 0.7)…
- `design_lqr`: LQR state-feedback design on a linear model with Bryson's-rule weights: largest acceptable deviation per state (state_max), output (output_max, e.g. nz, with the proper cross term) and input (input_max). integrate adds integral…
- `design_eigenstructure`: Eigenstructure assignment by state feedback (or output feedback from chosen sensors): move named open-loop modes to new damping/frequency (or real eigenvalue) and shape their eigenvectors, e.g. decouple the Dutch roll from bank…
- `design_loop_shaping`: H∞ loop-shaping design (Glover–McFarlane) of one loop or several (MIMO): shape the open loop with W1 (e.g. k(s + 0.5)/s for integral action and crossover) and the method adds the robustly stabilising K∞; the controller is one…
- `close_loop`: Close the loop between a linear model and a controller.
- `loop_analysis`: Loop-at-a-time stability analysis: break one actuator (side=input) or sensor (side=output) loop with all others closed.
- `gain_sweep`: Root-locus style gain sweep: closed-loop eigenvalues as one path's gain varies; reports the first destabilizing gain.
- `check_stability_margins`: Check a controller's loop stability margins against a requirement table by crossing frequency: the built-in MIL-F-9490D Table III (mil_f_9490d: {"airspeed": "operational" | "limit_airspeed" | "below_vo_min" |…

### Gain scheduling

- `store_design_point`: Store gains designed at one operating point (a scattered-gain design point) for later scheduling.
- `fit_gain_schedule`: Fit a gain schedule table from stored design points against one (1-D) or two (2-D) scheduling variables, e.g. x = 'fc.qbar_pa', y = 'fc.mach'.
- `lookup_gain`: Evaluate a gain table (linear/bilinear interpolation, clipped at the edges).
- `export_gain_table`: Export a gain table as JSON or CSV.
- `schedule_controllers`: Gain scheduling of MIMO block controllers by output blending (method "blend", default) or by interpolating state-consistent designs' matrices (method "interpolate", e.g. observer-form H∞ designs from design_loop_shaping with…
- `schedule_rate_limits`: How fast a gain schedule may be flown through.
- `check_schedule`: Frozen-point check of a (scheduled) controller across flight conditions: at each (e.g. every 5 KCAS from below the first design point to beyond the last) trim, linearise, evaluate the schedule there and report closed-loop…
- `design_gains_over_sweep`: Automatic gain design at every case of a sweep (warm-started from neighbouring cases).
- `design_lqr_over_sweep`: LQR (optionally with integral action) designed at every case of a sweep with the same weights, so gains vary smoothly with flight condition.
- `evaluate_controller_over_sweep`: Evaluate a controller across every converged case of a sweep: closed-loop stability, loop margins and Nichols check at each break point, optional closed-loop MIL-F-8785C levels.

### Flying qualities

- `flying_qualities`: Rate flying qualities against MIL-F-8785C modal requirements for an aircraft class and flight-phase category: short-period damping, frequency and CAP (n/α computed from 1/Tθ2 if not given), phugoid, Dutch roll (ζ, ζωn, ωn)…
- `equivalent_system`: Low-order equivalent system (LOES) of a high-order pitch response: q/F = K(s + 1/Tθ2)e^{−τs}/(s² + 2ζωs + ω²) and/or n_z/F = K e^{−τs}/(s² + 2ζωs + ω²), matched over a frequency range (default 1–10 rad/s) by Hodgkinson's…
- `attitude_bandwidth`: Attitude bandwidth (gain and phase) and phase delay per MIL-HDBK-1797.
- `cstar`: C* criterion: the normalised step response of C* = Δn_pilot + (V_co/g)·q (V_co default 400 ft/s; optional pilot-station offset) with overshoot, rise time and peak time; give an envelope (time, lower, upper) from your…
- `dropback`: Gibson pitch-attitude dropback (DB/qss, qmax/qss) from a held pulse input.
- `neal_smith`: Neal–Smith pitch-tracking analysis: a pilot model Kp·e^(−0.3s)·(lead or lag) closes the attitude loop with −90° closed-loop phase at the required bandwidth (default 3.5 rad/s) and ≤ 3 dB droop, minimizing the resonant peak.
- `roll_performance`: Roll performance (MIL-F-8785C 3.3.4: Table IXa for Class I and II, IXb for Class IV and IXf for Class III with speed_range VL/L/M/H): nonlinear simulation of an abrupt full-aileron roll from wings-level trim, timed to the…
- `roll_sideslip_coupling`: MIL-F-8785C roll–sideslip coupling (3.3.2.2–3.3.2.4) from a lateral linear model, open or closed loop: ψβ (phase of the Dutch-roll component of sideslip, exact from the mode's residue) and the p/β phase, roll-rate oscillation…
- `flight_path_stability`: Flight-path and speed stability (MIL-F-8785C 3.2.1.3 and 3.2.1.1): trims at neighbouring true airspeeds with the throttle fixed and elevator only, giving dγ/dV in deg/kt (Level 1/2/3 ≤ 0.06/0.15/0.24; positive on the back side of…
- `pitch_control_forces`: Pitch control forces from the elevator hinge model (MIL-F-8785C): stick force per g from steady pull-ups and push-overs over the 3.2.2.2.1 load-factor range, every local gradient rated against Table V (centre stick or wheel; a…
- `control_system_dynamics`: Control-system dynamics (MIL-F-8785C) with the airplane flown by force: each control with a hinge model is driven through its feel system (control_hinges.<surface>.feel: mass, damping, spring, breakout; irreversible with an…
- `turn_coordination`: Turn coordination (MIL-F-8785C 3.3.2.6) from the aircraft's control hinge model: steady coordinated turns at 60° (Class IV), 45° (I, II) or 30° (III) bank in both directions with pedal force ≤ 40 lb, and the same turns with the…

### Simulation and Monte Carlo

- `simulate`: Nonlinear 6-DOF simulation from a trimmed operating point (fixed-step RK4).
- `compare_simulation`: Compare a stored simulation with measured time histories (flight test or another simulator): per channel mean/rms/max error, normalized rms, correlation and Theil inequality coefficient.
- `export_simulation`: Export a stored simulation as CSV (time plus chosen channels).
- `run_monte_carlo`: Monte Carlo: many nonlinear simulations of one maneuver with dispersed aircraft parameters (aero coefficients, mass, CG, inertia, thrust; optionally correlated, e.g. from estimate_parameters), dispersed initial states, and a…
- `run_monte_carlo_over_sweep`: Monte Carlo at every case of a sweep (each case's aircraft and mass/CG variant, flight condition, flight-path angle and maneuver), with the same dispersions, limits, controller (fixed or scheduled gains) and the same random…
- `export_monte_carlo`: Every run of a stored Monte Carlo (mc-N) as CSV: run index, status, sampled parameters, metrics, violated limits, saturation and envelope flags.

### Flight-condition sweeps

- `run_sweep`: Batch sweep: trim, linearize and (optionally) rate an aircraft over a grid of two flight-condition axes × flight-path angles × mass/CG cases, with continuation between neighbouring cases.
- `query_sweep`: Filter (inclusive column ranges), sort and select columns of a sweep table.
- `export_sweep`: Export a sweep table as CSV.

### System identification

- `estimate_parameters`: Estimate aerodynamic coefficients (e.g. pitch_moment.alpha, pitch_moment.q_hat, lift.alpha) from measured flight data by the output-error maximum-likelihood method: the nonlinear model is run from the measured initial state with…
- `estimate_parameters_filter_error`: Filter-error maximum-likelihood estimation for flight data recorded in turbulence: a Kalman filter with gust states (first-order Markov winds, scale gust_scale_m) runs inside the estimator, so turbulence is not mistaken for model…
- `design_identification_input`: Identification input design: searches doublets, 3-2-1-1 multisteps and Schroeder-phased multisines over a range of time scales, reduces each amplitude to respect response limits (e.g. alpha excursion), and ranks them by predicted…
- `predict_identification_accuracy`: Predicted identification accuracy of a planned test: Cramér–Rao bounds of chosen coefficients from the nominal model's response to planned inputs with the expected sensor noise, plus correlated pairs and the response excursions.

### Projects and results

- `list_results`: List stored results: operating points, linear models, filters, controllers, design points and gain tables.
- `get_result`: Fetch any stored result by id (op-, lm-, flt-, ctl-, dp-, tbl-, sim-, swp-, mc-).
- `delete_results`: Delete results (op-, lm-, flt-, ctl-, dp-, tbl-, sim-, swp-, mc-) or aircraft from the workspace.
- `clear_workspace`: Start an empty workspace (built-in aircraft only).
- `save_project`: Save the whole workspace (aircraft, operating points, linear models, filters, controllers, design points, gain tables, sweeps, simulations) as a named project of plain JSON files in the server's projects directory.
- `load_project`: Load a saved project, replacing the current workspace (ids are preserved).
- `list_projects`: List saved projects, the current project and whether the workspace has unsaved changes.
- `export_project`: Export a project (a saved one by name, or the current workspace) as one JSON bundle in the reply's content: aircraft, operating points, models, controllers, design points, gain tables, sweeps, and optionally simulations and Monte…
- `import_project`: Save a bundle from export_project as a named project in this server's projects directory (validated and verified like save_project).
- `merge_project`: Merge another project (saved name, or a bundle's content) into the current workspace.
<!-- TOOLS:END -->
