ROS MCP

ROS MCP

Natural language interface for controlling ROS robots using the Model Context Protocol

26
Stars
3
Forks
26
Watchers
1
Issues
ROS MCP is a server that implements the Model Context Protocol (MCP) to enable natural language control of robots in ROS environments. It facilitates communication with ROS topics, services, and actions, supporting any ROS message type. The system integrates with GUI tools through a socket server and can be used with Claude Desktop for interactive robot management. Key functionalities include topic management, node control, service interaction, and process management for ROS2-powered robots.

Key Features

Implements Model Context Protocol server
Natural language command processing
ROS2 topic management (list, publish, monitor)
Service and action call support
Node control and inspection
WebSocket-based GUI tool launcher
Integration with Claude Desktop
Environment configuration and debugging tools
Customizable ROS domain ID support
Process cleanup and management for ROS nodes

Use Cases

Controlling ROS-compatible robots via natural language prompts
Automating robot operations in Gazebo or real environments
Executing ROS service calls and actions through conversational input
Monitoring and managing ROS2 topics and nodes interactively
Launching and visualizing ROS GUI tools from desktop application
Enabling non-expert users to interact with robots using regular language
Debugging and inspecting ROS2 environment setup
Integrating AI-based model context workflows with robotics systems
Remotely managing multiple robots on a ROS network
Educational demonstrations of AI-driven robot interfaces

README

ROS MCP

Trust Score ROS2-humble Industrial CI

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

bash
git clone git@github.com:Yutarop/ros-mcp.git
cd ros-mcp
pip install "websockets>=15.0.1"

Activate .venv and install dependencies

bash
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-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:

    bash
    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:

    bash
    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

Running the Servers

Start MCP server

Make sure your virtual environment is activated before running the MCP server:

bash
(ros-mcp) $ uv run ros-general.py

Start socket server

bash
python3 socket_server.py

💡not in the virtual environment!

Star History

Star History Chart

Repository Owner

Yutarop
Yutarop

User

Repository Details

Language Python
Default Branch main
Size 147 KB
Contributors 2
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Topics

mcp mcp-server ros2

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Model Context Protocol Server for Home Assistant

    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

    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

    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

    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

    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

    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?

    Be as detailed as possible for better results