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.
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.
git clone https://github.com/lpigeon/unitree-go2-mcp-server.git
cd unitree-go2-mcp-server
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
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
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
).
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.
Run any AI system that has imported the unitree-go2-mcp-server
.
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.
The MCP server understands contextual commands and can handle a variety of instructions for the Go2 robot, including:
Feel free to experiment with different natural language commands to control the robot.
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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