Skip to main content

mbot MCP Extension

🎥Plug & Play
Watch the demo

This tutorial will get you started with deemkeen's MQTT MCP server for the MakeBlock mbot2 rover, and outline some code changes we made along the way.

TLDR

Command

/path/to/java -jar /path/to/mbotmcp-0.0.1-SNAPSHOT.jar

Environment Variables

MQTT_SERVER_URI: tcp://1.2.3.4:1883
MQTT_PASSWORD: <string or blank>
MQTT_USERNAME: <string or blank>

Configuration

  1. Launch the installer
  2. Press Yes to confirm the installation
  3. Get your MQTT server URI, and your username/password if your MQTT uses authentication
  4. Click Save Configuration
  5. Scroll to the top and click Exit from the upper left corner

Example Usage

The available commands allow you to drive the mbot2 rover around, including:

  • "turn left" or "turn right""
  • drive "forward" or "backward"
  • "explore" randomly
  • "stop" exploring
  • "beep"

The default distance to travel is 70cm (about 27 inches), and the turn angles are set to 90 degrees. You can change these values in the Python code on the mbot2. The mbot2 has a lot of other capabilities with the proximity sensors, lights, and color detection sensor on the bottom of the unit that you can add to the Python code, and will need to update the Java code to include those commands via MCP.

Goose Interaction

( O)> Let my mbot2 explore the area

Okay, let's get the mbot2 rover moving. I will send it on a mission to explore the area.

> Mbotexplore

( O)> stop the rover, turn left and move forward

Alright, I will stop the rover, turn to the left, and then move it forward.

> Mbotstop

> Mbotleft

> Mbotforward

( O)> let's move backward and beep so I know when it's finished

Sure, I will move the rover backward and beep when it's done.

> Mbotbackward

> Mbotbeep

Okay, the mbot2 has moved and beeped. What else would you like to do with the rover?