Unitree Go2 MCP server

Enables control of the Unitree Go2 quadruped robot through natural language commands, translating conversational instructions into precise ROS2 actions for walking, dancing, sitting, and performing gestures.
Back to servers
Setup instructions
Provider
Jungsoo Lee
Release date
May 10, 2025
Language
Go
Stats
34 stars

The Unitree Go2 MCP Server enables natural language control of the Unitree Go2 robot. It converts commands interpreted by a Large Language Model (LLM) into ROS2 instructions, allowing the robot to perform actions based on human language input.

Requirements

  • Unitree Go2 robot
  • Ubuntu 20.04 or 22.04
  • ROS2 environment: Humble (recommended) or Foxy

Installation

1. Setup unitree_ros2 Environment

First, you need to set up the unitree_ros2 environment by following the instructions at https://github.com/unitreerobotics/unitree_ros2.

Important: Complete setup up to "Step 2: Connect and test" in the repository linked above.

2. Clone the Repository

git clone https://github.com/lpigeon/unitree-go2-mcp-server.git
cd unitree-go2-mcp-server

3. Install uv

Install the uv package manager with one of these commands:

curl -LsSf https://astral.sh/uv/install.sh | sh

Or:

pip install uv

Optionally, create and activate a virtual environment:

uv venv
source .venv/bin/activate

4. Configure MCP Server

Set MCP settings in your mcp.json file. This configuration must be done on the PC connected to the Go2.

{
    "mcpServers": {
        "unitree-go2-mcp-server": {
            "command": "uv",
            "args": [
              "--directory",
              "/ABSOLUTE/PATH/TO/PARENT/FOLDER/unitree-go2-mcp-server",
              "run",
              "server.py"
            ]
        }
    }
}

The location of your mcp.json file depends on your operating system:

  • MacOS:

    code ~/Library/Application\ Support/Claude/claude_desktop_config.json
    
  • Linux (Ubuntu):

    code ~/.config/Claude/claude_desktop_config.json
    
  • Windows:

    code $env:AppData\Claude\claude_desktop_config.json
    

Usage

1. Configure ROS2 Path

Open server.py and set your UNITREE_ROS2_SETUP_SH_PATH (e.g., /home/username/unitree_ros2/setup.sh).

If using rosbridge (optional), also set LOCAL_IP, ROSBRIDGE_IP, and ROSBRIDGE_PORT (default is 9090).

2. Verify Robot Connection

Check if the Go2 robot is connected to the network by running:

ros2 topic list

You should see the /wirelesscontroller topic in the output. If not, check the connection between the Go2 robot and your network.

3. Run AI System with MCP Server

Run any AI system that has imported the unitree-go2-mcp-server.

4. Send Commands to the Robot

Try sending a simple command like: "Make the Go2 robot move forward at a velocity of 0.5 m/s for 3 seconds."

The server will translate this natural language command into the appropriate ROS2 instructions, and the robot will execute the movement.

5. Explore Capabilities

The MCP server understands contextual commands and can handle a variety of instructions for the Go2 robot, including:

  • Movement commands (forward, backward, turning)
  • Posture changes (sitting, standing)
  • Movement speed adjustments
  • Timed actions

Feel free to experiment with different natural language commands to control the robot.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "unitree-go2-mcp-server" '{"command":"uv","args":["--directory","/ABSOLUTE/PATH/TO/PARENT/FOLDER/unitree-go2-mcp-server","run","server.py"]}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "unitree-go2-mcp-server": {
            "command": "uv",
            "args": [
                "--directory",
                "/ABSOLUTE/PATH/TO/PARENT/FOLDER/unitree-go2-mcp-server",
                "run",
                "server.py"
            ]
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "unitree-go2-mcp-server": {
            "command": "uv",
            "args": [
                "--directory",
                "/ABSOLUTE/PATH/TO/PARENT/FOLDER/unitree-go2-mcp-server",
                "run",
                "server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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