Token导航 LogoToken导航TokenDH.com
MCP Drone Example logo
运维云端stdio官方级别未说明来源级核验

MCP Drone Example

MCP Server

一个用于控制无人机连接、状态获取和导航的Python工具,适用于无人机开发和测试场景。

工具数

12

提示词数

0

GitHub Stars

0

资源数

0
Python云端部署Docker

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

tranhien1612

提供方

tranhien1612

最后核验

2026/5/17 20:22

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run server.py

详细介绍

mcp无人机示例

安装库

python>=3.10
uv
mcp

创建Gemini API密钥

首选 https://aistudio.google.com/ ->获取API密钥->创建API密钥

创建项目并安装库

客户端

uv init client
uv venv
.venv\Scripts\activate

uv add mcp python-dotenv google-genai

服务器

uv init server
uv venv
.venv\Scripts\activate

uv add mcp python-dotenv google-genai pymavlink

服务器

uv run server.py

客户端

uv run client.py http://localhost:8081/sse

日志示例

Initialized SSE Client Session.
Listing tools...
Connected to server with tools: ['show', 'get_weather', 'add_number', 'add_connection', 'remove_connection', 'arm', 'disarm', 'takeoff', 'landing', 'get_drone_status', 'change_flight_mode', 'goto_location']
MCP Client started! Type 'quit' to exit.

Query: get drone infor
[Gemini requested tool call: get_drone_status with args: {}]
Tool raw result: meta=None content=[TextContent(type='text', text='{\n  "status": "No active connection"\n}', annotations=None, meta=None)] structuredContent={'result': '{\n  "status": "No active connection"\n}'} isError=False
Gemini: OK. The drone status is: "No active connection".

Query: add connection with ip 192.168.1.91, port 14550 
[Gemini requested tool call: add_connection with args: {'port': 14550, 'connection_ip': '192.168.1.91'}]
Tool raw result: meta=None content=[TextContent(type='text', text='Connecting to udp:192.168.1.91:14550', annotations=None, meta=None)] structuredContent={'result': 'Connecting to udp:192.168.1.91:14550'} isError=False
Gemini: OK.

Query: get drone infor
[Gemini requested tool call: get_drone_status with args: {}]
Tool raw result: meta=None content=[TextContent(type='text', text='{\n  "status": "Connected",\n  "imu_roll_deg": -0.014809072710236069,\n  "imu_pitch_deg": 0.04246878074785927,\n  "imu_yaw_deg": 140.8556675046444,\n  "angular_velocity": {\n    "rollspeed_rad_s": 0.0013123913668096066,\n    "pitchspeed_rad_s": 0.000613159965723753,\n    "yawspeed_rad_s": -0.00036382442340254784\n  },\n  "latitude": -35.3642619,\n  "longitude": 149.1655429,\n  "altitude_m": 20.001,\n  "battery_voltage_V": 12.6,\n  "battery_remaining_%": 0,\n  "acceleration_raw": {\n    "x": 0.0,\n    "y": 0.0,\n    "z": -1.001\n  },\n  "gyro_raw": {\n    "x": 0.005,\n    "y": 0.004,\n    "z": 0.003\n  },\n  "mag_raw": {\n    "x": -146,\n    "y": -187,\n    "z": -529\n  },\n  "mode": "GUIDED",\n  "system_status": 4,\n  "type": 2,\n  "system_id": 1,\n  "component_id": 0\n}', annotations=None, meta=None)] structuredContent={'result': '{\n  "status": "Connected",\n  "imu_roll_deg": -0.014809072710236069,\n  "imu_pitch_deg": 0.04246878074785927,\n  "imu_yaw_deg": 140.8556675046444,\n  "angular_velocity": {\n    "rollspeed_rad_s": 0.0013123913668096066,\n    "pitchspeed_rad_s": 0.000613159965723753,\n    "yawspeed_rad_s": -0.00036382442340254784\n  },\n  "latitude": -35.3642619,\n  "longitude": 149.1655429,\n  "altitude_m": 20.001,\n  "battery_voltage_V": 12.6,\n  "battery_remaining_%": 0,\n  "acceleration_raw": {\n    "x": 0.0,\n    "y": 0.0,\n    "z": -1.001\n  },\n  "gyro_raw": {\n    "x": 0.005,\n    "y": 0.004,\n    "z": 0.003\n  },\n  "mag_raw": {\n    "x": -146,\n    "y": -187,\n    "z": -529\n  },\n  "mode": "GUIDED",\n  "system_status": 4,\n  "type": 2,\n  "system_id": 1,\n  "component_id": 0\n}'} isError=False
Gemini: OK. I have retrieved the drone information. The drone status is Connected. The latitude is -35.3642619, longitude is 149.1655429, and altitude is 20.001 meters. The battery voltage is 12.6V. The flight mode is GUIDED.

Query: go to position with lat: -35.360000 lon: 149.1640000, alt:10
[Gemini requested tool call: goto_location with args: {'longitude': 149.164, 'altitude': 10, 'latitude': -35.36}]
Tool raw result: meta=None content=[TextContent(type='text', text='Drone navigating to (-35.360000, 149.164000, 10.0m)', annotations=None, meta=None)] structuredContent={'result': 'Drone navigating to (-35.360000, 149.164000, 10.0m)'} isError=False
Gemini: OK. I've sent the drone to latitude -35.36, longitude 149.164, and altitude 10.

目录标签

目录标签

Python云端部署Docker无人机控制本地部署Python工具无人机开发状态监控导航控制

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

12

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP