Unitree Go2 MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Unitree Go2 MCP ServerCheck the robot's battery status and move it to waypoint 'home'."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π€ MCP Web Portal β Unitree Go2 Robot Control Interface
A browser-based control and monitoring portal for the Unitree Go2 robot dog, built with Gradio and ROS2 keeping it 100% pythonic. The portal streams live camera feeds, displays sensor telemetry, provides remote navigation controls, supports autonomous waypoint missions, and integrates LLM-powered scene description.

Table of Contents
Related MCP server: WEATHGARDS
Feature Overview
Feature | Description |
π₯ Live Camera | Front-facing video stream + Intel RealSense RGB/Depth feed, with YOLO object detection overlaid on either camera |
πΊοΈ Map & Navigation | 2D occupancy-grid map rendering with Nav2 goal-setting from the browser |
πΉοΈ Remote Control | Virtual joystick / directional controller for driving the robot over |
π‘ Telemetry | Live battery %, pose (x/y/yaw), sport-mode state, and IMU roll/pitch/yaw |
π§ AI Scene Description | LLM-based image analysis of the camera feed (Azure OpenAI or local Ollama models via LiteLLM), with a configurable system prompt |
π Audio / Sounds | Upload audio files and play them through the robot's onboard speaker |
π‘ LED Controller | Adjust headlight color and brightness |
π ROS Graph View | Auto-generated visual graph of active ROS 2 topics, publishers, and subscribers |
π οΈ Development Tab | Diagnostic tools and dev utilities for debugging the ROS bridge/connections |
π MCP Server | Exposes all portal-managed topics/services as MCP tools so an LLM agent can inspect and control the robot |
π Waypoint Missions | Save and replay autonomous navigation waypoints ( |
Architecture

The robot connects to the host machine via rosbridge (default 127.0.0.1:9090), using either the DDS or WebRTC transport mode (MODE in config.py). All ROS 2 nodes are registered onto a shared executor in main.py, and their live data is surfaced to both the Gradio UI and the MCP server from the same DataStream object in web_backend/data_stream.py.
Project Structure
.
βββ main.py # App entry point β ROS2 init, node registration, Gradio launch
βββ config.py # Central settings: topic names, LLM config, rosbridge connection, UI flags
βββ server.py # MCP server exposing ROS2 topics/services as agent tools
βββ test.py # Test/scratch script
βββ pyproject.toml / uv.lock # uv-managed dependency lockfile
βββ requirements.txt # Full pinned dependency list (ROS2, Gradio, ML, MCP stack)
β
βββ web_backend/
β βββ action_sub.py # SportMode action interface (stand, sit, hello, dance, etc.)
β βββ audio_sub.py # Access to the Go2's onboard speaker
β βββ bm_status.py # Battery / motor / IMU (roll, pitch, yaw) status
β βββ camera.py # Main front camera access
β βββ camera_rs.py # RealSense RGB/Depth camera access (requires RealSense ROS2 pkg on the Go2)
β βββ data_stream.py # Core hub: ROS2 subscribers/publishers, YOLO inference, LLM calls, map builder
β
βββ web_frontend/
β βββ index.py # Main tab UI β camera, map, telemetry
β βββ action.py # Actions tab UI β waypoints, missions, sport commands
β βββ dev.py # Development tab UI β diagnostics
β βββ style.css # Custom CSS
β
βββ backends/ # Additional backend service modules
βββ utils/ # Shared helper utilities
β
βββ data/
β βββ yolo/best2.pt # YOLO model weights used for object detection
β βββ waypoints/waypoints.json# Saved navigation waypoints
β βββ sounds/ # Uploaded audio files for robot playback
β
βββ github_media/ # Screenshots / media used in repo documentationTech Stack
Based on the project's pinned requirements.txt, the portal is built on:
Robotics / middleware: ROS 2 (
rclpy,ros2clitooling),rosbridge-suitefor the WebSocket bridge to the robot,unitree_go/unitree_api/unitree_hgmessage packages, and theunitree_sdk2_pythonSDK (does not need seperate install, requirements.txt alread has it as an editable Git dependency)Navigation:
nav2-msgs,nav2-simple-commander,slam-toolbox,cartographer-ros-msgsfor occupancy-grid mapping and goal navigation. You may choose any code you like. I used following repogo2_slam_nav2Web UI:
gradio(v6.x) andgradio_clientfor the browser interface;fastapi/starlette/uvicornunderneathComputer vision:
opencv-python,ultralytics(YOLO) for object detection,torch/torchvisionLLM / agent layer:
litellm(unified model API),openai,ollama(Python client), andmcp(the official Model Context Protocol SDK) for the agent-facing tool serverAudio:
gTTS,pydubfor text-to-speech / audio handlingReal-time transport:
aiortc/aioice/avfor optional WebRTC-based video/data channelsMisc:
pandas,matplotlib/networkx(for the ROS topic/service graph visualization),redis,python-dotenv
Prerequisites
Ubuntu 22.04 (recommended)
ROS 2 Humble or later
Python 3.10+
Unitree ROS 2 SDK β unitreerobotics/unitree_ros2, installed and sourced
rosbridge_suite (```bash ros2 launch rosbridge_server rosbridge_websocket_launch.xml
```) (if you run it on laptop you can find it on 127.0.0.1:9090)
Nav2 (optional β required only for autonomous waypoint navigation)
Intel RealSense ROS 2 package installed on the Go2 (optional β required only for the RealSense RGB/Depth tab)
Ollama (optional β for local LLM inference instead of Azure OpenAI)
An NVIDIA GPU is not required, but the pinned requirements include CUDA-enabled
torch/nvidia-*wheels for faster YOLO inference if one is available
Installation
1. Clone the repository
git clone https://github.com/sallu-786/Unitree_Go2_Web_Portal.git
cd Unitree_Go2_Web_Portal2. Install Python dependencies
install from the pinned requirements.txt (note: this file includes ROS 2 Python packages, so it assumes a ROS 2 environment is already sourced/available):
pip install -r requirements.txt3. Source ROS 2 and the Unitree setup script
source /opt/ros/humble/setup.bash
source /home/<your-user>/unitree_ros2/setup.shUpdate
UNITREE_ROS2_SETUP_SH_PATHinconfig.pyto match the actual path on your machine.
4. Configure config.py
At minimum, review and set:
ROSBRIDGE_IP/ROSBRIDGE_PORTβ where rosbridge is runningMODEβ"DDS"or"WEBRTC"INTERFACEβ your network interface for ROS 2 (ip ato find it)ROBOTβ a friendly name for your robotTopic names (camera, cmd_vel, LIDAR, pose, odom, map, etc.) if they differ from your setup
UNITREE_ROS2_SETUP_SH_PATHandROS_JS_LIB_PATH
5. (Optional) Set up .env for API keys
Rather than hard-coding credentials in config.py, create a .env file:
# .env
AZURE_API_KEY=your_key_hereconfig.py hard-coded keys are unsafe β load them via python-dotenv instead:
from dotenv import load_dotenv
import os
load_dotenv()
AZURE_API_KEY = os.getenv("AZURE_API_KEY")6. Run the portal
python main.pyThe Gradio app launches at http://0.0.0.0:7860 by default.
Configuration Reference
All settings live in config.py. Key groups:
Connection
Setting | Purpose |
| Address of the rosbridge WebSocket server (default |
| Transport mode β |
| Network interface used for ROS 2 DDS traffic |
| Display name for the connected robot |
LLM / Scene Description
Setting | Purpose |
|
|
| Dict mapping mode β friendly name β LiteLLM model string |
| Default model per mode |
| Azure OpenAI credentials (use |
| Local Ollama endpoint (default |
| Prompts used for periodic scene description; the shipped example is tuned for factory-floor PPE/hazard detection |
| System prompt for the MCP-connected agent, instructing it to use tools for robot state/control and never claim success without a confirmed tool result |
UI Feature Flags
Setting | Purpose |
| Toggle individual UI panels on/off |
| Language code for text-to-speech ( |
| Seconds between periodic scene-description calls |
| Camera stream display dimensions |
|
|
Paths
Setting | Purpose |
| Path to YOLO weights ( |
| Directory for uploaded playback audio |
| JSON file storing saved navigation waypoints |
| Path to the Unitree ROS 2 |
| Path to the JS library used for browser-side map/nav rendering |
Topic Names β all remappable to match your robot's actual topic names: CAMERA_TOPIC_NAME, REALSENSE_CAMERA_COLOR, REALSENSE_CAMERA_DEPTH, CMD_VEL_PUB_TOPIC_NAME (+ _TYPE), LIDAR (+ LIDAR_MAX_POINTS), POSE (+ POSE_HEADER_FRAME_ID), ODOM, MAP, SPORTS, LFLOWCMD.
ROS Graph Styling β TOPIC_COLOR, PUBLISHER_COLOR, SUBSCRIBER_COLOR, NODE_SIZE, TOPIC_SIZE, PLOT_WIDTH, PLOT_HEIGHT control the appearance of the topic/service graph shown in the UI.
Running the MCP Portal
python main.pyThis will:
Initialize
rclpy, instantiate all ROS 2 subscriber/publisher nodes defined inweb_backend/, and register them on a shared executor.Launch the Gradio app with tabs for the main dashboard, actions/waypoints, and development diagnostics.
Start the background loop that periodically grabs a camera frame, runs it through the configured LLM, and updates the on-screen scene description.
MCP Server & LLM Agent Integration
server.py starts an MCP server that mirrors the robot's ROS 2 surface as callable tools β battery/pose/telemetry reads, topic/service introspection, and movement/action commands. Any MCP-compatible client (a custom agent script, an IDE assistant, or a chat UI wired up with an MCP connector) can attach to it and:
List and inspect active ROS 2 topics and services
Read live telemetry (battery, pose, sport-mode state, sensors)
Issue movement or action commands through the exposed tools
Get grounded, tool-verified answers rather than the model guessing at robot state
The MCP_AGENT_PROMPT in config.py explicitly instructs the connected agent to rely on tool calls for anything robot-related and to never report success unless a tool call actually confirms it β useful guardrails when letting an LLM drive a physical robot.
To customize which model powers the natural-language side of the agent, add entries to MODELS in config.py using LiteLLM's model string format, e.g.:
MODELS = {
"ollama": {
"Gemma3": "ollama/gemma3:latest",
"Llama3": "ollama/llama3:latest", # β new entry
}
}Accessing the Portal
Access Type | URL |
Local (same machine) |
|
LAN (other devices) |
|
Extending the Project
Add a new ROS 2 subscriber
Create a new subscriber class in
web_backend/, following the pattern of an existing one (e.g. the camera subscribers).Instantiate it inside
DataStream.__init__()inweb_backend/data_stream.py.Register the node with the executor in
main.py:executor.add_node(launcher.your_new_subscriber)Expose the data via a property or method on
DataStreamso the frontend can read it.
Add a new UI tab
Create
web_frontend/my_tab.pyand define aget_my_tab_page(demo, launcher)function using Gradio components.Wire it into
main.pyinside thegr.Tabs()block:with gr.Tab("My Tab"): get_my_tab_page(demo, launcher)
Change the LLM scene-description prompt
Edit SYSTEM_PROMPT and LLM_PROMPT in config.py:
SYSTEM_PROMPT = "You are a robot assistant."
LLM_PROMPT = "Describe the scene and highlight any hazards."Add a new LLM model β add an entry to the MODELS dict as shown above in the MCP section.
License & Acknowledgements
This project is intended for internal/research use. Please respect the licenses of its third-party dependencies, including Gradio, ROS 2, the Unitree SDK, and the MCP SDK. See the repository's LICENSE file for details.
Acknowledgements:
Unitree Robotics β Go2 robot platform
Gradio β Web UI framework
Nav2 β ROS 2 navigation stack
LiteLLM β Unified LLM API layer
Ollama β Local LLM inference
Model Context Protocol β Agent/tool integration standard
Ultralytics YOLO β Object detection
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA robot-control MCP server enabling LLMs to control Unitree robots and DJI Tello drones with mock and hardware backends, built-in routines, and sequence execution.12MIT
- FlicenseNot gradedqualityDmaintenanceExposes MCP tools that enable remote LLMs to query local Docker containers, OS processes, and system services in real time.-
- FlicenseNot gradedqualityDmaintenanceEnables controlling a Unitree GO2 robot's motion (forward, backward, left, right, stop, stand up, and move with custom velocities) via MCP tools, using ROS2 commands.-
- AlicenseNot gradedqualityDmaintenanceMCP server for controlling Unitree robots via DDS protocol, supporting G1, Go2, H1, H2, B2, A2, R1 and more. Enables LLM agents to command robots with high-level actions and safety guards.3MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sallu-786/Unitree_Go2_Web_Portal'
If you have feedback or need assistance with the MCP directory API, please join our Discord server