Ardupilot Mavlink Mcp

io.github.rmeadomavic由 GitHub 帳號 rmeadomavic 發布v0.1.0更新於 Oct 24, 2026

Live ArduPilot control over MAVLink: state, params, modes, prearm diagnosis, gated arm. SITL-first.

已驗證STDIO僅桌面位置與生活開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理透過 MAVLink 讀取 ArduPilot 載具狀態,並在明確開啟後送出指令,優先以 SITL 為主。

可以做什麼
透過 MAVLink 連線(TCP、UDP 或序列埠)連接載具,預設連線本機 SITL,並以資源或工具結果讀取快取的遙測資料:模式、解鎖狀態、GPS、電池、姿態與位置。讀取最近的 STATUSTEXT 與預解鎖訊息,說明無法解鎖的原因。讀取、以萬用字元列出並設定參數,寫入以回傳值確認。依載具類型以名稱切換飛行模式。執行解鎖或上鎖,回報 COMMAND_ACK 結果,遭拒時提供預解鎖原因,且不會強制解鎖。
適用情境
適合讓助理當下檢查執行中的 ArduPilot 載具,而不是在降落後分析日誌,例如診斷無法解鎖的原因、核對參數與模式。主要面向 SITL 開發與檯架測試。
執行需求
需在本機安裝 Python 套件(pipx 或 uv tool install)並以 stdio 程序執行。需要可連線的 ArduPilot 載具或 SITL 實例,以 pymavlink 連線字串提供,例如 tcp:127.0.0.1:5760、udp:127.0.0.1:14550 或 serial:/dev/ttyACM0:115200。假定使用 MAVLink2。執行動作需加 --enable-actuation 參數;真實連線還需 --allow-real-vehicle。
安裝前請注意
此伺服器可以解鎖並指揮真實載具,錯誤指令可能讓螺旋槳轉動或使載具飛走。動作預設關閉,真實連線需同時傳入 --enable-actuation 與 --allow-real-vehicle 才會放行;凡未明確為回送位址的連線都視為真實載具。參數寫入、模式切換、解鎖與上鎖皆為破壞性操作;對 ARMING_CHECK 的寫入會被拒絕。僅 ArduCopter SITL 經過驗證,Rover、Plane 與 Sub 尚未測試,且尚未在真實硬體上飛行。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ardupilot Mavlink Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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:

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

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

bash
pipx install ardupilot-mavlink-mcp          # or: uv tool install ardupilot-mavlink-mcpardupilot-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:

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

Claude Desktop / any mcpServers config:

json
{  "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

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

License

MIT — Kyle Adomavicius

來源:README.md,提交 569d9d0

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.0最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分