mcpField
A
ardupilot-mavlink-mcp

ardupilot-mavlink-mcp

Local
github.com/rmeadomavicOther4Updated 15w ago

About ardupilot-mavlink-mcp

ardupilot-mavlink-mcp is an MCP server for AI agents working with live ArduPilot vehicles over MAVLink, aimed at development and diagnosis, especially with SITL. It provides cached telemetry and guarded controls, with actuation disabled by default.

Key features

  1. 01Cached vehicle telemetry
  2. 02Pre-arm failure diagnosis
  3. 03Parameter reading and guarded writes
  4. 04Flight mode changes by name
  5. 05Gated arm and disarm controls
  6. 06Telemetry resource exposure

Use cases

  1. 01Diagnosing why a vehicle will not arm
  2. 02Inspecting telemetry during SITL testing
  3. 03Changing parameters or modes in SITL

MCP support

The server exposes MAVLink vehicle state and control operations as MCP tools, plus live telemetry as a resource. Write and actuation tools are gated; real-vehicle links require an additional explicit flag.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"rmeadomavic-ardupilot-mavlink": {
"command": "uvx",
"args": [
"ardupilot-mavlink-mcp"
]
}
}
}
Run commanduvx ardupilot-mavlink-mcp

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypiardupilot-mavlink-mcp0.1.0

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

ardupilot-mcp

An MCP server that lets an AI agent talk to an ArduPilot vehicle over MAVLink. Read state, inspect and change parameters, switch modes, read prearm failures, and (gated) arm or disarm. SITL-first.

Install: pipx install ardupilot-mavlink-mcp

mcp-name: io.github.rmeadomavic/ardupilot-mavlink-mcp

CI PyPI License: MIT Python MCP

Warning

This tool can ARM and command a real aircraft. A bad command can spin props or fly a vehicle away. Defaults are built to stop that: actuation is OFF unless you pass --enable-actuation, and even then it refuses a real (non-loopback) link unless you also pass --allow-real-vehicle. Develop against SITL. On hardware, bench-test with props off first. No warranty — you own the outcome.

Why

Most ArduPilot tooling for LLMs targets post-flight log analysis. This one drives the live link: connect to a running vehicle, read its state and params, change modes, and diagnose why it won't arm — in the moment, not after landing. The useful case: point an agent at a vehicle that won't arm, have it read the params and the prearm STATUSTEXT, and tell you why, instead of you squinting at a GCS message log. The arm tool reports the real COMMAND_ACK result and hands back the prearm reasons on refusal; it never force-arms.

Architecture

  agent (MCP client)                    ardupilot-mcp                     vehicle
 ┌──────────────────┐   JSON-RPC    ┌──────────────────────┐   MAVLink   ┌──────────┐
 │ Claude / etc.    │ ───stdio────▶ │  FastMCP tools       │ ──udp/tcp/  │ ArduPilot│
 │                  │ ◀───────────  │   │                  │   serial──▶ │  (SITL   │
 └──────────────────┘               │   ▼                  │ ◀────────── │  or FC)  │
                                    │  recv thread (1 reader)            └──────────┘
                                    │   ├─▶ message cache (latest/type)
                                    │   ├─▶ param store (request/collect)
                                    │   └─▶ COMMAND_ACK + STATUSTEXT
                                    └──────────────────────┘

MAVLink is an async stream; MCP tools are synchronous. One background thread owns the link and is the only reader — it caches the latest message of each type and routes PARAM_VALUE into a param store. Tool calls read from those caches (params block until the data arrives). No two threads ever call recv_match.

What it does

  • Reads vehicle state from cache, instantly. Mode, armed, GPS fix and sats, battery, attitude, position — served from cached telemetry, no blocking on the link.
  • Diagnoses a no-arm. ardupilot_arm returns the COMMAND_ACK result and, on refusal, the prearm STATUSTEXT (e.g. AHRS: waiting for home, Accels inconsistent). Safety checks are respected — no ARMING_CHECK=0, no force-arm magic number.
  • Gets and sets parameters on the real param table, with set confirmed by the echoed PARAM_VALUE.
  • Switches flight modes by name, mapped per vehicle type (Copter/Rover/Plane/Sub) — not hardcoded numbers.

Quick start (SITL)

You need an ArduPilot SITL instance. From an ardupilot checkout:

# starts ArduCopter SITL; serves MAVLink on tcp:127.0.0.1:5760
sim_vehicle.py -v ArduCopter --console

Install and run the server (read-only by default):

pipx install ardupilot-mavlink-mcp          # or: uv tool install ardupilot-mavlink-mcp
ardupilot-mavlink-mcp --connect tcp:127.0.0.1:5760

To allow parameter writes, mode changes, and arm/disarm against SITL, add --enable-actuation.

Use with an MCP client

Claude Code:

claude mcp add ardupilot -- ardupilot-mavlink-mcp --connect tcp:127.0.0.1:5760

Claude Desktop / any mcpServers config:

{
  "mcpServers": {
    "ardupilot": {
      "command": "ardupilot-mavlink-mcp",
      "args": ["--connect", "tcp:127.0.0.1:5760"]
    }
  }
}

Connection strings are pymavlink syntax: tcp:127.0.0.1:5760 (SITL), udp:127.0.0.1:14550, serial:/dev/ttyACM0:115200.

Tools

ToolKindWhat it does
ardupilot_connect—Connect to a vehicle. Default is local SITL.
ardupilot_vehicle_statereadMode, armed, GPS, battery, attitude, position — from cache.
ardupilot_recent_statustextreadRecent STATUSTEXT/prearm messages. Read this to see why arming failed.
ardupilot_get_paramreadRead one parameter.
ardupilot_set_paramwriteSet a parameter, confirmed via echoed PARAM_VALUE.
ardupilot_list_paramsreadList params, optional glob (ATC_RAT_*).
ardupilot_set_modewriteSend a request to set flight mode by name.
ardupilot_arm / ardupilot_disarmwriteGated. Confirmed via COMMAND_ACK.

Write tools are gated and carry the MCP destructiveHint. Live telemetry is also exposed as the resource ardupilot://telemetry.

Supported vehicles

VehicleFirmwareStatus
ArduCopter4.5✓ validated on SITL
ArduRover (UGV/USV)4.x~ mode map present, not yet validated
ArduPlane4.x~ mode map present, not yet validated
ArduSub4.x~ untested

MAVLink2 is assumed. Not flown on hardware — SITL only so far.

Safety model

  1. Actuation tools are OFF by default. Enable with --enable-actuation.
  2. Even enabled, actuation on a real link (serial or non-loopback network) is refused unless --allow-real-vehicle is also set.
  3. Link classification fails safe: anything not clearly loopback is treated as a real vehicle.
  4. arm, disarm, set_param, and set_mode all pass through this gate before sending.
  5. Arming has no force-arm option, and set_param rejects ARMING_CHECK writes (case-insensitive) on every link, even when both actuation flags are enabled.

Status

Working: reads plus gated parameter writes, mode changes, and arm/disarm against ArduCopter SITL. Validated three ways — unit tests (Python 3.10–3.12), a real-MAVLink-wire check (scripts/wire_check.py), and a live ArduPilot SITL run (scripts/sitl_check.py).

Open targets: validate Rover/Plane/Sub; mission upload/download and guided flight (takeoff/goto/land) are deferred — mission protocol is a stateful handshake and guided commands are fly-away risk. See ROADMAP.md.

Develop

git clone https://github.com/rmeadomavic/ardupilot-mcp && cd ardupilot-mcp
uv venv && uv pip install -e ".[dev]"
pytest -q
ruff check . && ruff format --check .
python scripts/wire_check.py            # offline real-wire check, no SITL needed

License

MIT — Kyle Adomavicius

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.