Skip to content

builderpepc/Cozmo-MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cozmo-MCP

A basic MCP server made with FastMCP that allows MCP clients like Claude Desktop to control a Cozmo robot (a product of Digital Dream Labs and Anki). This MCP server uses the PyCozmo library to connect to and interact with the Cozmo robot.

Features

Here's what Cozmo-MCP can do right now, and what is planned:

  • Connect to Cozmo
  • Disconnect from Cozmo
  • Capture images from the camera (which the agent can process)
  • Move the left and right wheels
  • Turn in place
  • Set the head angle
  • Set the lift height
  • Take readings from sensors (via RobotState update messages - includes details about position, wheels, arm/head status, motion, power)
  • Read data from cliff sensor
  • Control camera configuration on connect (should be enabled, grayscale or color)
  • Play audio on speaker
  • Move based on sensor readings (move until some state is reached)
  • Display text/images/shapes on face screen
  • Control face animations
  • Set backpack light color
  • Wait for events from backpack touch sensor
  • Take readings from cube sensors (battery, accelerometers, animations)
  • NV RAM storage operations

For more details about Cozmo's capabilities, check the PyCozmo documentation.

Set up in Claude Desktop

This is just a toy project for now, so I haven't made it very portable yet. It will run using your system Python installation, and you will need to install dependencies manually.

First, clone the project:

git clone https://github.com/builderpepc/Cozmo-MCP

Then, install dependencies (adjust as needed based on your Python configuration):

cd Cozmo-MCP
python -m pip install -r requirements.txt

Now, open your claude_desktop_config.json file. You can locate it from within Claude Desktop settings. Update your mcpServers based on the contents shown below. You will need to update the path to your Cozmo-MCP directory, and you may need to change python to python3 depending on your configuration.

{
  "globalShortcut": "",
  "mcpServers": {
    "cozmo-robot-server": {
      "command": "python",
      "args": ["C:/full-path-goes-here/Cozmo-MCP/server.py"]
    }
  }
}

If there's enough interest, I'll make this run in Docker instead, so you won't need to install anything manually (except Docker, of course).

For other MCP clients, please adapt these instructions based on your client's documentation.

Connect to Cozmo and Run Commands

Before your MCP client can interact with Cozmo, you'll need to turn on its wifi network and connect to it. If you're using Claude Desktop or any other LLM not running on your device, you must be connected both to internet and Cozmo's wifi network simultaneously. This is because PyCozmo communicates to Cozmo over wifi, the same way the official Cozmo app does. If you're using a computer that can only connect to one network at a time, you may want to give it a wired internet connection so it can use its wifi adapter to communicate with Cozmo.

For details about turning on Cozmo's wifi network and connecting to it, reference this part of PyCozmo's README file. Note that after a period of inactivity, the wifi network may turn off. Once you have connected to Cozmo's wifi, your MCP client can start sending commands. For these instructions, Claude Desktop will be used as the MCP client.

Restart Claude Desktop if you have not done so after editing your configuration. Make sure there are no errors related to starting the Cozmo MCP server. Then, create a new thread, and tell Claude to connect to Cozmo and do something with it - for example, tell it to use Cozmo to take a picture and tell you what is visible. You can also give it more vague commands, such as "explore the room by moving Cozmo around and taking pictures, and report on your observations". Claude will dynamically decide what actions to take, even referencing camera images to inform next steps.

When you are done, tell Claude to disconnect from the robot to clean up.

Support

Bug reports can be made as issues in this GitHub repository.

There is a Discord community of Anki robot enthusiasts here. It is unaffiliated with this project.

Disclaimer

This project is not affiliated with the PyCozmo maintainers, Anki, or Digital Dream Labs.

About

MCP server for DDL/Anki Cozmo robots using PyCozmo

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages