🐍 🏠 🐧 - Control robots with natural language via ROS 2 topics, services and actions
ROS MCP
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**ROS MCP** is a MCP server designed for controlling robots in ROS environments using natural language.
It supports communication via ROS topics, services, and actions, and works with any ROS message type.
Demo
Test to see if ros topics, services, and actions can be used.
https://github.com/user-attachments/assets/61143c37-fb73-4998-9cbc-844d92ae61d9
Prompt used (Topic)
> Open gazebo with TurtleBot3 and publish topic to move it.
Prompt used (Service)
> Show me service list and call service to reset the world in Gazebo.
Prompt used (Action)
> Show me action list and call action to move the TurtleBot3 forward for 1m.
Components
- **Socket Server** (socket_server.py): A lightweight server that runs on localhost:8765 to handle GUI-related operations.
It receives instructions from the MCP server to launch tools such as Gazebo or rqt_graph on the local display.
- **MCP Server** (ros-general.py): A Python-based server that implements the MCP.
It processes natural language input, maps it to ROS commands, and communicates with the socket server.
To enable node communication between the MCP server and the local machine, both must be configured with the same ROS_DOMAIN_ID on the same local network.
Overview of MCP Tools
- Topic Management: List, monitor, and publish to ROS2 topics
- Node Control: List and inspect running ROS2 nodes
- Service Interaction: Call ROS2 services with custom
- Action Support: Send goals to ROS2 actions
- GUI Integration: Launch ROS2 GUI tools via WebSocket server
- Environment Debugging: Check ROS2 setup and configuration
- Process Management: Clean up running ROS2 processes
Please refer here for more details.
Getting Started
Requirements
- ROS2 Humble Hawksbill (This project has only been tested with ROS2 Humble. Compatibility with other ROS2 distributions is not guaranteed.)
- claude desktop (Linux, macOS and Windows)
- Python 3.10+
- websockets >= 15.0.1
- uv package manager (Installing uv)
- Other dependencies as listed in pyproject.toml
Installation
Git clone and install websockets package
Activate .venv and install dependencies
Claude Settings (claude_desktop_config.json)
To use the MCP server correctly with Claude Desktop, you need to modify the claude_desktop_config.json file with appropriate values.
**💡 Replace the following placeholders:**
- /ABSOLUTE/PATH/TO/PARENT/FOLDER/ros-mcp
Replace with the absolute path the ros-mcp directory.
For example: /home/ubuntu/ros-mcp
- YOUR_ROS_DOMAIN_ID
Replace with the ROS domain ID used in your environment to enable ROS communication between the MCP server and your local machine. If you're not sure what your current domain ID is, you can check it by running the following command in your terminal: