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. - Socket Server (socketserver.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 r
Add this skill
npx mdskills install Yutarop/ros-mcpComprehensive ROS2 control with clear architecture, excellent demos, and detailed setup guidance
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.
https://github.com/user-attachments/assets/61143c37-fb73-4998-9cbc-844d92ae61d9
Open gazebo with TurtleBot3 and publish topic to move it.
Show me service list and call service to reset the world in Gazebo.
Show me action list and call action to move the TurtleBot3 forward for 1m.
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.
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 processesPlease refer here for more details.
pyproject.tomlgit clone git@github.com:Yutarop/ros-mcp.git
cd ros-mcp
pip install "websockets>=15.0.1"
uv venv
source .venv/bin/activate
uv pip install -e .
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"
]
}
}
}
/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:
echo $ROS_DOMAIN_ID
If 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.py
Replace with the absolute path to your ros-general.py script.
For example: /home/ubuntu/ros-mcp/ros-general.py
Make sure your virtual environment is activated before running the MCP server:
(ros-mcp) $ uv run ros-general.py
python3 socket_server.py
💡not in the virtual environment!
Install via CLI
npx mdskills install Yutarop/ros-mcpRos MCP is a free, open-source AI agent skill. 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. - Socket Server (socketserver.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 r
Install Ros MCP with a single command:
npx mdskills install Yutarop/ros-mcpThis downloads the skill files into your project and your AI agent picks them up automatically.
Ros MCP works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.