ROS MCP
Provides tools for controlling robots in ROS 2 environments, including listing and publishing topics, calling services, sending action goals, and launching ROS GUI tools.
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., "@ROS MCPlist available topics and publish to /cmd_vel to move the robot"
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.
ROS MCP
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 asGazeboorrqt_graphon 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 sameROS_DOMAIN_IDon the same local network.
Overview of MCP Tools
Topic Management: List, monitor, and publish to ROS2 topicsNode Control: List and inspect running ROS2 nodesService Interaction: Call ROS2 services with customAction Support: Send goals to ROS2 actionsGUI Integration: Launch ROS2 GUI tools via WebSocket serverEnvironment Debugging: Check ROS2 setup and configurationProcess 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.)
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
git clone git@github.com:Yutarop/ros-mcp.git
cd ros-mcp
pip install "websockets>=15.0.1"Activate .venv and install dependencies
uv venv
source .venv/bin/activate
uv pip install -e .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.
{
"mcpServers": {
"ros-general": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/ros-mcp",
"run",
"bash",
"-c",
"export ROS_LOG_DIR=/tmp && export ROS_DOMAIN_ID=${ROS_DOMAIN_ID:-YOUR_ROS_DOMAIN_ID} && source /opt/ros/humble/setup.bash && python3 /ABSOLUTE/PATH/TO/PARENT/FOLDER/ros-general.py"
]
}
}
}💡 Replace the following placeholders:
/ABSOLUTE/PATH/TO/PARENT/FOLDER/ros-mcpReplace with the absolute path the ros-mcp directory. For example: /home/ubuntu/ros-mcpYOUR_ROS_DOMAIN_IDReplace 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:echo $ROS_DOMAIN_IDIf nothing is printed, the domain ID is not set, and the default value 0 will be used. Alternatively, you can set it manually using the following command:
export ROS_DOMAIN_ID=10 # Replace 10 with your desired domain ID/ABSOLUTE/PATH/TO/PARENT/FOLDER/ros-general.pyReplace with the absolute path to your ros-general.py script. For example: /home/ubuntu/ros-mcp/ros-general.py
Running the Servers
Start MCP server
Make sure your virtual environment is activated before running the MCP server:
(ros-mcp) $ uv run ros-general.pyStart socket server
python3 socket_server.py💡not in the virtual environment!
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/Yutarop/ros-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server