Control Unitree Go2 robot with natural language commands using MCP server and ROS2
The Unitree Go2 MCP Server is a server built on the Model Context Protocol (MCP) designed to enable the control and interaction of Unitree Go2 robots through natural language commands. These commands, processed by a Large Language Model (LLM), are translated into ROS2 instructions that direct the robot's actions. This server bridges the gap between human interaction and robotic execution via MCP, providing developers with an accessible tool for integrating intelligent robotics into various AI workflows.
The Unitree Go2 MCP Server leverages cutting-edge technologies to deliver seamless communication between AI applications and robotic systems. Its core capabilities are centered around the Model Context Protocol (MCP), which standardizes interactions with a wide range of tools and data sources, including ROS2. The server's key features include:
The server operates by receiving commands through an AI application, which are then processed by an LLM. The interpreted commands are translated into ROS2 instructions and sent to the Unitree Go2 robot for execution. This real-time data flow is critical for tasks requiring rapid response times and seamless interaction.
The Unitree Go2 MCP Server follows a modular architecture, consisting of several components that interact via the Model Context Protocol (MCP). The primary components include:
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
graph TD
A[AiApp] --> B[MCP Client]
B --> C[LLM Middleware]
C --> D[MCP Protocol]
D --> E[MCP Server]
E --> F[ROS2 Adapter]
F --> G[Unitree Go2 Robot]
style A fill:#eff5fc
style B fill:#f0edec
style C fill:#e1f5fe
style D fill:#f3e5f5
style E fill:#f8f5f0
style F fill:#e8f5e8
Ensure you have the necessary development environment to work with Unitree Go2:
https://github.com/unitreerobotics/unitree_ros2
Follow the setup instructions up to and including Step 2: Connect and test
.
Clone the repository for the Unitree Go2 MCP Server.
git clone https://github.com/lpigeon/unitree-go2-mcp-server.git
cd unitree-go2-mcp-server
uv
EnvironmentInstall Required Dependencies:
curl -LsSf https://astral.sh/uv/install.sh | sh
pip install uv
Optional: Create and Activate a Virtual Environment
uv venv
source .venv/bin/activate
Set up the configuration file mcp.json
.
{
"mcpServers": {
"unitree-go2-mcp-server": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/unitree-go2-mcp-server",
"run",
"server.py"
]
}
}
}
If you use Claude Desktop, navigate to the configuration file:
MacOS/Linux
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows
code $env:AppData\Claude\claude_desktop_config.json
Imagine a scenario where an LLM-powered AI application interacts with the Unitree Go2 MCP Server to manage a warehouse. Commands such as "Move the robot to shelf X and pick up item Y" are translated into executable instructions for the robot, streamlining inventory management tasks.
In another use case, the MCP server provides an interface between LLM-powered personal assistants (like Claude Desktop) and Unitree Go2 robots. Users can issue commands such as "Move forward when you feel tired," enabling assistance without manual input.
The Unitree Go2 MCP Server is compatible with various AI applications, including:
MCP Client | Resources | Tools | Prompts |
---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ |
Continue | ✅ | ✅ | ❌ |
Cursor | ❌ | ✅ | ❌ |
The server performs optimally with ROS2 environments and supports various LLMs. Below is a detailed performance matrix for the supported AI clients:
{
"mcpServers": {
"unitree-go2-mcp-server": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-unitree-go2"],
"env": {
"API_KEY": "your-api-key"
}
}
}
}
Ensure security by securing API keys and using environment variables. Regularly update server components to maintain compatibility with latest MCP standards.
The LLM processes the AI application's input, translating them into ROS2 instructions that are then executed by the robot.
Currently, full compatibility is supported for Claude Desktop, while Continue and Cursor have partial support. Check the official documentation for details.
Yes, you can customize your LLM by configuring the mcp.json
settings to point to your server or local instance of an LLM.
API keys are stored securely using environment variables in the configuration file. Regular updates to the server keep it compliant with MCP standards, ensuring secure interactions.
Contributions are welcome! Follow the contributing guidelines for instructions on how to get involved.
Contributions from the developer community play a crucial role in enhancing the capabilities of the Unitree Go2 MCP Server. Whether you want to fix bugs, add new features, or suggest improvements, your contributions are invaluable. Refer to the CONTRIBUTING.md for detailed guidelines on how to participate.
Explore a broader ecosystem of MCP-related tools and resources at:
This comprehensive documentation provides an in-depth view of how to set up, use, and integrate the Unitree Go2 MCP Server for building advanced robotic systems through natural language commands.
Learn to connect to MCP servers over HTTP with Python SDK using SSE for efficient protocol communication
Next-generation MCP server enhances documentation analysis with AI-powered neural processing and multi-language support
Build a local personal knowledge base with Markdown files for seamless AI conversations and organized information.
Integrate AI with GitHub using MCP Server for profiles repos and issue creation
Python MCP client for testing servers avoid message limits and customize with API key
Explore MCP servers for weather data and DigitalOcean management with easy setup and API tools