ROS MCP
Natural language interface for controlling ROS robots using the Model Context Protocol
Key Features
Use Cases
README
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.)
- 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
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-mcp -
YOUR_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:bashecho $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:
bashexport 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.py
Start socket server
python3 socket_server.py
💡not in the virtual environment!
Star History
Repository Owner
User
Repository Details
Programming Languages
Tags
Topics
Join Our Newsletter
Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.
Related MCPs
Discover similar Model Context Protocol servers
Model Context Protocol Server for Home Assistant
Seamlessly connect Home Assistant to LLMs for natural language smart home control via MCP.
Enables integration between a local Home Assistant instance and language models using the Model Context Protocol (MCP). Facilitates natural language monitoring and control of smart home devices, with robust API support for state management, automation, real-time updates, and system administration. Features secure, token-based access, and supports mobile and HTTP clients. Designed to bridge Home Assistant environments with modern AI-driven automation.
- ⭐ 468
- MCP
- tevonsb/homeassistant-mcp
MCP Miro Server
Miro board integration for AI assistants via Model Context Protocol.
MCP Miro Server provides a standardized MCP server interface to the Miro platform, enabling AI assistants to access and manage Miro boards programmatically. It supports a wide range of board and item operations, including creating, listing, updating, and deleting boards and their contents. Secure OAuth token access ensures integration with users’ Miro accounts. Designed to work seamlessly with AI tools like Claude Desktop, it allows efficient and automated Miro workspace management.
- ⭐ 57
- MCP
- k-jarzyna/mcp-miro
mcp-miro
Model Context Protocol server for integrating MIRO Whiteboard with AI workflows.
mcp-miro is a Model Context Protocol (MCP) compliant server that connects the MIRO Whiteboard Application to AI-based systems, such as Claude Desktop. It enables board manipulation, sticky note creation, bulk operations, and more through standardized MCP interfaces. Users can authenticate via OAuth and interact with MIRO boards programmatically for collaborative whiteboarding and automation tasks. The server can be installed using Smithery or mcp-get and supports debugging with the MCP Inspector.
- ⭐ 97
- MCP
- evalstate/mcp-miro
QGISMCP
Integrate QGIS with Claude AI via Model Context Protocol
QGISMCP connects QGIS to Claude AI through the Model Context Protocol (MCP), enabling seamless two-way communication between the GIS platform and the AI assistant. It features a QGIS plugin that sets up a socket server and a dedicated MCP server for processing commands, facilitating tasks such as project manipulation, layer management, and Python code execution directly from Claude. This integration empowers users to streamline project creation, layer loading, and advanced automation within QGIS through AI-driven interaction.
- ⭐ 691
- MCP
- jjsantos01/qgis_mcp
Advanced Unity MCP from Code Maestro
Control Unity with AI through natural language commands.
Advanced Unity MCP from Code Maestro enables direct interaction with the Unity Editor using natural language commands powered by AI. It bridges AI assistants like Code Maestro Desktop App, GitHub Copilot, Cursor, and others to the Unity Editor using the Model Context Protocol (MCP). Users can automate Unity tasks such as asset management, scene configuration, building projects, and more without manual intervention. The system supports both direct and relay server connections for flexible integration with various AI clients.
- ⭐ 70
- MCP
- codemaestroai/advanced-unity-mcp
MetaTrader MCP Server
Let AI assistants trade for you using natural language.
MetaTrader MCP Server is a bridge that connects AI assistants such as Claude and ChatGPT to the MetaTrader 5 trading platform via the Model Context Protocol (MCP). It enables users to perform trading actions on MetaTrader 5 through natural language instructions. The system supports real-time data access, full account management, and secure local credential handling, offering both MCP and REST API interfaces.
- ⭐ 120
- MCP
- ariadng/metatrader-mcp-server
Didn't find tool you were looking for?