Official · MODEL CONTEXT PROTOCOL
**Chotu Robo Server - MCP Server for Arduino **
Integrate Arduino-based robotics (using the NodeMCU ESP32 or Arduino Nano 368 board) with AI using the MCP (Model Context Protocol) framework from Claude Anthropic
WHAT IT CONNECTS
**Chotu Robo Server - MCP Server for Arduino ** 为 AI Agent 提供什么
- **LED Control**: Blink an LED for a given duration.
- **Buzzer Control**: Sound a buzzer for a specified time.
- **Motor Control**: Run a motor at a certain speed for a set time.
- **Servo Control**: Move a servo motor to a specific angle.
- **Fan Control**: Turn a fan on/off.
- **Relay Control**: Switch a relay on or off.
- **Sensor Readings**:
- Read **temperature** from a sensor.
- Measure **distance** using an ultrasonic sensor.
- **AI-powered Commands**: Control the robot using AI-based prompts for actions like moving, starting, stopping, turning, and adjusting speed.
- **NodeMCU ESP32** or **Arduino Nano 368**: Microcontrollers responsible for controlling the hardware and communicating with the server.
- **Johnny-Five**: The JavaScript robotics and IoT library to interact with the hardware components.
- **MCP Framework**: The Model Context Protocol framework to handle requests and interactions with external systems, enabling AI-based communication.
- **Sensors & Actuators**:
- **LED** (for indicating status)
- **Buzzer**
- **Servo Motor**
- **Motor**
- **Relay Module**
- **Ultrasonic Distance Sensor**
- **Temperature Sensor**
- **Setup**:
- The **NodeMCU ESP32** or **Arduino Nano 368** board is connected to various sensors and actuators (LEDs, motors, etc.).
- The **Johnny-Five** library allows the server to control hardware components through the microcontroller.
- **MCP Integration**:
- The **McpServer** manages communication between the hardware and AI.
- The server provides several **tools** (commands) such as `blinkLED`, `buzz`, `runMotor`, `moveServo`, and more.
- Each tool is associated with a specific function, and the server waits for commands from the AI system to execute those actions.
- **AI Control**:
- **AI Prompts** are used to trigger actions like moving the robot (`move-chotu`), controlling speed (`set-chotu-speed`), and turning the robot (`turn-chotu`).
- The AI uses **Claude** or other AI assistants to send commands to the server. The server processes these commands and interacts with the hardware accordingly.
- **Real-Time Communication**:
- **StdioServerTransport** ensures the server can connect to external AI systems and execute commands in real-time.
- **User Commands**:
- The AI can send user-friendly commands like **"turn Chotu left"** or **"set speed to 5"** to control the robot's behavior.
- **`blinkLED`**: Blink the LED for a specified time.
- **`buzz`**: Activate the buzzer for a certain duration.
- **`runMotor`**: Start the motor at a given speed for a set period.
- **`moveServo`**: Move the servo motor to a specified angle.
- **`controlFan`**: Turn the fan on or off.
- **`toggleRelay`**: Switch a relay module on or off.
- **`readTemperature`**: Get the current temperature reading.
- **`readDistance`**: Measure the distance using the ultrasonic sensor.
- **`move-chotu`**: Move Chotu in specific steps (via AI prompt).
- **`start-chotu`**: Start Chotu and get ready to operate.
- **`stop-chotu`**: Stop Chotu and shut down operations.
- **`turn-chotu`**: Turn Chotu to a specified direction (left or right).
- **`set-chotu-speed`**: Set the speed for Chotu.
- **Hardware**:
- **NodeMCU ESP32** or **Arduino Nano 368** (or any supported Arduino/ESP32 board).
- Various sensors and actuators (LED, servo, motor, ultrasonic sensor, temperature sensor, relay).
- **Software**:
- Install **Node.js**.
- Install **Johnny-Five** for hardware control.
- Use the **MCP SDK** to integrate with AI.
- Use the **Arduino IDE** to program the microcontroller.
- Install **Node.js** and **Johnny-Five**:
- **Adding more sensors** like cameras or microphones.
- **Integrating advanced AI models** for better decision-making.
- **Developing a mobile app or web interface** to control the robot via a graphical interface.
- **Using a Raspberry Pi**:
- **Setup**: Use a Raspberry Pi to run the MCP server and control the hardware components.
- **Installation**:
- **Connecting to Java-based Server**:
- **Java Server Setup**: Create a Java-based MCP server to handle requests and communicate with the Raspberry Pi.
- **Java Code Example**:
- **Running the Server**:
- **Connecting Raspberry Pi to Java Server**:
- Ensure the Raspberry Pi and Java server are on the same network.
- Use WebSocket or REST API to send commands from the Java server to the Raspberry Pi.
- Example command from Java server to Raspberry Pi:
SECURITY
MCP 收录不等于安全审核
MCP 服务器可能获得模型上下文、凭据、本地文件或调用外部系统的权限。连接 Agent 前,请检查代码、环境变量、网络行为、软件包来源与维护状态。