ChotuRobo (Robot Control) MCP server

Connects Claude AI with physical hardware through a TypeScript server that translates natural language commands into robotic control actions for LEDs, motors, and sensors via WiFi communication.
Back to servers
Provider
Vishal Mysore
Release date
Mar 28, 2025
Language
TypeScript
Stats
37 stars

Chotu Robo Server is an MCP (Model Context Protocol) server that enables communication between artificial intelligence and Arduino-based robots. The server allows you to control hardware components like LEDs, motors, servos, and sensors through AI commands, creating an interface between digital intelligence and physical robotics.

Installation

Prerequisites

  • NodeMCU ESP32 or Arduino Nano 368 board
  • Various hardware components (LEDs, motors, servos, sensors)
  • Node.js installed on your computer
  • Arduino IDE

Setting Up the Hardware

  1. Connect your hardware components to the ESP32 or Arduino Nano board:
    • LEDs
    • Buzzer
    • Motors
    • Servo motors
    • Fan
    • Relay module
    • Temperature sensor
    • Ultrasonic distance sensor

Installing Required Software

  1. Install the necessary Node.js packages:
npm install johnny-five
npm install @modelcontextprotocol/sdk
  1. For ESP32 users, install board support in the Arduino IDE:
    • Open Arduino IDE
    • Go to File > Preferences
    • Add ESP32 board manager URL in "Additional Boards Manager URLs"
    • Install ESP32 boards from Tools > Board > Boards Manager

Configuring the Board

For Wireless Mode (ESP32)

  1. Upload the ESP32 web server code using Arduino IDE:
// Basic ESP32 web server code for Chotu Robo
#include <WiFi.h>
#include <WebServer.h>

const char* ssid = "YOUR_WIFI_SSID";
const char* password = "YOUR_WIFI_PASSWORD";

WebServer server(80);

void setup() {
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi...");
  }
  
  Serial.println("WiFi connected");
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  
  server.on("/", handleRoot);
  server.begin();
}

void loop() {
  server.handleClient();
}

void handleRoot() {
  server.send(200, "text/plain", "Chotu Robo Server Running");
}
  1. Replace the WiFi credentials with your network details.

For Wired Mode (Arduino Nano 368)

  1. Upload the Arduino Nano code using Arduino IDE:
// Basic Arduino Nano code for Chotu Robo
void setup() {
  Serial.begin(115200);
  // Setup pins for hardware components
  pinMode(13, OUTPUT); // LED pin
}

void loop() {
  if (Serial.available() > 0) {
    String command = Serial.readStringUntil('\n');
    processCommand(command);
  }
}

void processCommand(String command) {
  // Process serial commands
  if (command == "LED_ON") {
    digitalWrite(13, HIGH);
    Serial.println("LED turned ON");
  } else if (command == "LED_OFF") {
    digitalWrite(13, LOW);
    Serial.println("LED turned OFF");
  }
}

Starting the MCP Server

  1. Create a file named choturobo.js with the following content:
const { McpServer } = require('@modelcontextprotocol/sdk');
const { StdioServerTransport } = require('@modelcontextprotocol/sdk');
const { Board, Led, Servo, Motor } = require('johnny-five');

// Initialize the MCP Server
const server = new McpServer();
const transport = new StdioServerTransport();
server.connect(transport);

// Connect to the Arduino board
const board = new Board();

board.on('ready', function() {
  console.log('Board is ready!');
  
  // Initialize components
  const led = new Led(13);
  const servo = new Servo(9);
  const motor = new Motor([10, 11]);
  
  // Define MCP tools
  server.tool('blinkLED', async ({ time }) => {
    led.blink(500);
    await new Promise(resolve => setTimeout(resolve, time * 1000));
    led.stop();
    return { status: 'success', message: `LED blinked for ${time} seconds` };
  });
  
  server.tool('moveServo', async ({ angle }) => {
    servo.to(angle);
    return { status: 'success', message: `Servo moved to ${angle} degrees` };
  });
  
  server.tool('runMotor', async ({ speed, time }) => {
    motor.speed(speed);
    await new Promise(resolve => setTimeout(resolve, time * 1000));
    motor.stop();
    return { status: 'success', message: `Motor ran at speed ${speed} for ${time} seconds` };
  });

  // Add more tools as needed
});

// Start the server
server.start();
  1. Start the MCP server:
node choturobo.js
  1. For debugging, use the MCP Inspector:
npx @modelcontextprotocol/inspector node build/choturobo.js

Usage

Available Commands

The Chotu Robo Server responds to the following commands:

Command Description Parameters
blinkLED Blink an LED time: duration in seconds
buzz Activate a buzzer time: duration in seconds
runMotor Run a motor speed: 0-255, time: duration in seconds
moveServo Move a servo angle: 0-180 degrees
controlFan Control a fan state: true/false
toggleRelay Toggle a relay state: true/false
readTemperature Read temperature None
readDistance Measure distance None

AI Control Commands

When integrated with AI systems like Claude, you can use natural language commands:

AI Command Description Example
move-chotu Move the robot "Move Chotu forward by 5 steps"
start-chotu Start the robot "Start Chotu"
stop-chotu Stop the robot "Stop Chotu"
turn-chotu Turn the robot "Turn Chotu left"
set-chotu-speed Set robot speed "Set Chotu speed to 10"

Examples

Blinking an LED

// Example command to blink LED for 5 seconds
{
  "command": "blinkLED",
  "params": {
    "time": 5
  }
}

Moving a Servo

// Example command to move servo to 90 degrees
{
  "command": "moveServo",
  "params": {
    "angle": 90
  }
}

Running a Motor

// Example command to run motor at half speed for 3 seconds
{
  "command": "runMotor",
  "params": {
    "speed": 128,
    "time": 3
  }
}

Reading Sensor Data

// Example command to read temperature
{
  "command": "readTemperature"
}

// Example command to read distance
{
  "command": "readDistance"
}

Wireless vs. Wired Mode

Wireless Mode (ESP32)

In wireless mode, the robot connects to your local WiFi network and can receive commands remotely. After uploading the code to the ESP32:

  1. The board will connect to your WiFi network
  2. It will start a web server at the displayed IP address
  3. You can send commands to this IP address via HTTP requests

Example HTTP request:

POST http://192.168.1.100/command
Content-Type: application/json

{
  "command": "blinkLED",
  "params": {
    "time": 3
  }
}

Wired Mode (Arduino Nano)

In wired mode, the robot needs to be connected via USB to a computer running the MCP server. Commands are sent through the serial connection:

  1. The MCP server communicates with the Arduino through the serial port
  2. Commands are processed by the Arduino code
  3. The robot executes commands based on the uploaded program

This mode is useful for development and testing before moving to wireless operation.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later