mcp

v0.2.0
@flightassistant/mcp Checked 2 days ago Published 2 days ago

MCP server and CLI that lets Claude, Cursor, and Codex diagnose PX4 .ulg flight logs with evidence-backed findings.

FlightAssistant connects your AI editor to deterministic PX4 flight-log diagnostics over the Model Context Protocol. Your agent reads a .ulg, runs the checks, and comes back with a root cause tied to exact ULog topics and timestamps. Supports PX4 ULog (.ulg) files up to 512 MB from multicopters, fixed-wing, and VTOL aircraft, tested on PX4 1.8 through 1.17. You need Node.js 20+ and a FlightAssistant account.

Summary extracted from the README.

FlightAssistant MCP

npm node license

Ask Claude, Cursor, or Codex why your drone crashed, and get an answer you can verify.

FlightAssistant connects your AI editor to deterministic PX4 flight-log diagnostics over the Model Context Protocol. Your agent reads a .ulg, runs the checks, and comes back with a root cause tied to exact ULog topics and timestamps.

> Why did my quad lose position and come down?

  Verdict: FINDING
  [HIGH]   Horizontal position estimate lost → Descend failsafe      T+37.4 s
  [HIGH]   Log ended while armed and airborne                        T+73.1 s
  [MEDIUM] Primary IMU fault & estimator innovation spike           T+18.9 s
  Not evaluated: ESC telemetry (not logged)
  • Evidence, not guesses. Findings come from signal processing on the logged topics, not from a model.
  • Explicit coverage. Anything the log didn't record is reported as not evaluated, never as a pass.
  • Your model, your editor. Reasoning runs in the subscription you already have. No server-side LLM cost.
  • Works where your logs are. Analyze a .ulg straight from disk or an SD card.

Supports PX4 ULog (.ulg) files up to 512 MB from multicopters, fixed-wing, and VTOL aircraft, tested on PX4 1.8 through 1.17.


Quick start

You need Node.js 20+ and a FlightAssistant account.

npx -y @flightassistant/mcp setup

This will:

  1. Open your browser so you can sign in and approve an API key.
  2. Save the key to ~/.flightassistant/config.json (readable only by you, never duplicated into editor configs).
  3. Add FlightAssistant to every supported editor it finds on this machine: Claude Desktop, Claude Code, Cursor, Windsurf, VS Code, and OpenAI Codex.

Restart your editor, then ask it about a flight:

Analyze ~/logs/flight_42.ulg and tell me whether it crashed and why.

That's it. Every flight you analyze also appears in your dashboard with interactive plots.


Example prompts

  • "Analyze ~/logs/flight_42.ulg. Did it crash? What was the root cause?"
  • "Plot the EKF innovations and battery voltage around the failsafe in my latest flight."
  • "What happened in the five seconds before position was lost?"
  • "Did any parameters differ from the airframe defaults in a way that matters for this crash?"

You don't need to name tools. Your agent sees everything FlightAssistant offers when it connects and picks what it needs. The ones people mention most:

Tool What it does
analyze_local_log Analyze a .ulg on your disk or SD card and return the full report. (local server only)
get_flight_report Verdict and ranked findings for a flight already on your account.
plot Render a PNG of a built-in view or any logged fields.
rename_flight / delete_flight Rename a flight label or permanently delete a flight from your account.

Claude Code plugin

This repository also includes a ready-to-use Claude Code plugin (.claude-plugin/plugin.json, .mcp.json, and 2 PX4 triage skills: flight-triage, tuning-audit):

claude --plugin-dir /path/to/flightassistant

Manual setup

Prefer to edit config files yourself? Create an API key (fi_…) in your dashboard under API keys & setup, then pick a mode:

Local (recommended) Remote
Install Runs via npx Nothing to install
Reads .ulg files from your disk Yes No (upload by URL instead)
Endpoint stdio https://mcp.flightassistant.app/mcp

Local:

claude mcp add flightassistant \
  -e FLIGHTASSISTANT_API_KEY=fi_your_key_here \
  -- npx -y @flightassistant/mcp

Remote:

claude mcp add --transport http flightassistant https://mcp.flightassistant.app/mcp \
  --header "Authorization: Bearer fi_your_key_here"
{
  "mcpServers": {
    "flightassistant": {
      "command": "npx",
      "args": ["-y", "@flightassistant/mcp"],
      "env": { "FLIGHTASSISTANT_API_KEY": "fi_your_key_here" }
    }
  }
}

Local:

{
  "mcpServers": {
    "flightassistant": {
      "command": "npx",
      "args": ["-y", "@flightassistant/mcp"],
      "env": { "FLIGHTASSISTANT_API_KEY": "fi_your_key_here" }
    }
  }
}

Remote:

{
  "mcpServers": {
    "flightassistant": {
      "url": "https://mcp.flightassistant.app/mcp",
      "headers": { "Authorization": "Bearer fi_your_key_here" }
    }
  }
}

Local:

[mcp_servers.flightassistant]
command = "npx"
args = ["-y", "@flightassistant/mcp"]

[mcp_servers.flightassistant.env]
FLIGHTASSISTANT_API_KEY = "fi_your_key_here"

Remote (export FLIGHTASSISTANT_API_KEY in your shell first):

[mcp_servers.flightassistant]
url = "https://mcp.flightassistant.app/mcp"
bearer_token_env_var = "FLIGHTASSISTANT_API_KEY"

Run npx -y @flightassistant/mcp as a stdio server with FLIGHTASSISTANT_API_KEY set, or connect to https://mcp.flightassistant.app/mcp over Streamable HTTP with an Authorization: Bearer <key> header.


Command line & CI

The same diagnostics run without an editor:

npx -y @flightassistant/mcp analyze ~/logs/flight_42.ulg          # readable report
npx -y @flightassistant/mcp analyze ~/logs/flight_42.ulg --json   # JSON for scripts
npx -y @flightassistant/mcp flights                                # list your flights
npx -y @flightassistant/mcp report <flight_id>                     # fetch an existing report

In CI, set FLIGHTASSISTANT_API_KEY as a secret. The command exits 0 whenever analysis succeeds, so gate on the verdict (pass, finding, or inconclusive) yourself:

npx -y @flightassistant/mcp analyze flight.ulg --json > report.json
jq -e '.report.verdict == "pass"' report.json

All commands

Command Description
setup Sign in and configure detected editors
login Sign in and save an API key, without touching editor configs
whoami Show the saved account and key prefix
logout Remove the saved key from this machine
analyze <file.ulg> Upload and analyze a local log
report <flight_id> Fetch the report for an existing flight
flights List your flights
serve Start the stdio MCP server (the default with no command)
Option Description
--json Machine-readable output
--timeout <sec> Max seconds to wait for processing (default 180)
--api-key <key> Use this key instead of the saved one or the environment
-v, --version / -h, --help Version / help

Configuration

The API key is resolved in this order: --api-key, then FLIGHTASSISTANT_API_KEY, then the key saved by setup or login.

Variable Description
FLIGHTASSISTANT_API_KEY Personal API key (fi_…). Optional after setup or login.
FLIGHTASSISTANT_API_URL API base URL. Only needed for self-hosted deployments.

Troubleshooting

The tools don't show up in my editor. Restart the editor after setup; most clients only read MCP config at launch. If your editor wasn't detected, use the manual setup for it.

Your editor says "failed to connect" or "server exited". The local server stops at launch when no API key is available. Run npx -y @flightassistant/mcp setup (or login), then restart the editor.

"Not authenticated" or 401 errors. Run npx -y @flightassistant/mcp whoami. If no key is saved, or the key was revoked, run setup again.

"Could not be parsed as a PX4 ULog." Only PX4 .ulg files are supported. ArduPilot .bin and .tlog files aren't.

Processing timed out. Large logs can take longer. Retry with --timeout 600.

npx errors about the Node version. Run node -v. FlightAssistant needs Node.js 20 or newer.


Security & privacy

  • Your API key is stored locally at ~/.flightassistant/config.json with owner-only permissions (0600), and is sent only to the FlightAssistant API. setup does not write your key into editor config files.
  • Remote MCP (https://mcp.flightassistant.app/mcp) supports OAuth 2.1 with PKCE (/.well-known/oauth-protected-resource) as well as personal Authorization: Bearer fi_... keys.
  • Logs you analyze are uploaded to your FlightAssistant account so reports and plots appear in your dashboard. Note that .ulg files can contain GPS coordinates (vehicle_gps_position) and vehicle metadata, which are accessible to the AI client you connect.
  • Revoke a key anytime from your dashboard. It stops working immediately. logout removes the local copy.

Release notes

0.2.0

  • Breaking: removed the compare_flights tool and the compare-flights prompt and plugin skill. Multi-flight comparison now lives in the FlightAssistant web app and chat. To look at several flights from an agent, call get_flight_report on each one, or get_vehicle with include_trends for component trends across a vehicle's flights.
  • The remote server now reports its real package version instead of a fixed 0.1.3.

PX4 is a trademark of the Linux Foundation. FlightAssistant is not affiliated with the PX4 project.

MIT License