特洛无人机
HTTP-SSEDJI特洛无人机MCP控制服务器
DJI特洛无人机MCP控制服务器
A Model Context Protocol (MCP) server implementation for controlling the DJI Tello drone. This server allows any MCP-compatible client to control a Tello drone through a standardized interface.
git clone <repository-url> cd drone-mcp
pip install -r requirements.txt
To enable your MCP client to connect to the Tello drone server, add the following configuration to your mcp.json file (usually located at ~/.cursor/mcp.json or in your project directory):
{ "tello-drone": { "url": "http://localhost:3000/sse" } }
This configuration allows MCP-enabled tools and models to automatically discover and connect to your Tello drone server.
Connect to your Tello drone's WiFi network (usually starts with "TELLO-").
Start the MCP server:
sudo python tello_mcp.py
The server will:
http://0.0.0.0:3000/sse/messageEnsure the server is running before you plan to use it in your client (cursor, windsurf, code).
The server provides the following MCP tools:
{ "name": "takeoff", "description": "Commands the Tello drone to take off", "inputSchema": { "type": "object", "properties": {} } }
{ "name": "land", "description": "Commands the Tello drone to land", "inputSchema": { "type": "object", "properties": {} } }
{ "name": "move", "description": "Moves the Tello drone in a specified direction", "inputSchema": { "type": "object", "properties": { "direction": { "type": "string", "enum": ["up", "down", "left", "right", "forward", "back"] }, "distance": { "type": "integer", "minimum": 20, "maximum": 500 } }, "required": ["direction", "distance"] } }
{ "name": "rotate", "description": "Rotates the Tello drone clockwise or counter-clockwise", "inputSchema": { "type": "object", "properties": { "direction": { "type": "string", "enum": ["cw", "ccw"] }, "degrees": { "type": "integer", "minimum": 1, "maximum": 3600 } }, "required": ["direction", "degrees"] } }
To connect an MCP client:
GET http://localhost:3000/sse
event: endpoint
data: /message?sessionId=<session-id>
{ "jsonrpc": "2.0", "id": 1, "method": "initialize" }
{ "jsonrpc": "2.0", "id": 2, "method": "listTools" }
{ "jsonrpc": "2.0", "id": 3, "method": "callTool", "params": { "name": "takeoff", "arguments": {} } }
The server implements comprehensive error handling:
All errors are logged and returned as proper JSON-RPC 2.0 error responses.
The server logs to stderr with detailed information about:
The server is built using:
mcp library for protocol handlingServer won't start:
Drone won't connect:
Commands fail:
MIT
Welcome to contribute.