Get the FREE Ultimate OpenClaw Setup Guide →

ros2

MCP server from kakimochi/ros2-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio kakimochi-ros2-mcp-server uv --directory /path/to/ros2-mcp-server run bash -c export ROS_LOG_DIR=/tmp && source /opt/ros/humble/setup.bash && python3 /path/to/ros2-mcp-server/ros2-mcp-server.py \
  --env ROS_LOG_DIR="/tmp"

How to use

This MCP server integrates FastMCP with ROS 2 to allow AI assistants to control a robot by publishing Twist messages to the /cmd_vel topic. It runs as a ROS 2 node and accepts movement commands from MCP clients (such as Claude) via FastMCP's asyncio pipeline. The server translates high-level commands like move forward at a specified speed for a given duration into ROS 2 Twist messages, enabling time-based control of a real or simulated robot. You can verify behavior by monitoring the /cmd_vel topic and observing the robot's response to issued commands.

How to install

Prerequisites:\n- ROS 2 Humble installed and sourced.\n- Python 3.10.\n- uv (Python package manager) for dependency management.\n- numpy and fastmcp Python packages.\n\nInstallation steps:\n1. Clone the repository:\nbash\ngit clone https://github.com/kakimochi/ros2-mcp-server.git\cd ros2-mcp-server\n\n2. Use the Python version specified (3.10) via a local environment as shown in the repository. A .python-version file is provided:\nbash\ncat .python-version\n3.10\n\n3. Create and activate a uv virtual environment:\nbash\nuv venv --python /usr/bin/python3.10\nsource .venv/bin/activate\n\n4. Install Python dependencies in editable mode:\nbash\nuv pip install -e .\n\n5. Ensure ROS 2 Humble is sourced in your shell and that ROS is available to Python.\nbash\nsource /opt/ros/humble/setup.bash\n

Additional notes

Environment variables and ROS setup issues are common. If you encounter ROS logging directory errors, set ROS_LOG_DIR to a writable directory (e.g., /tmp). Confirm you are using Python 3.10 for ROS 2 Humble compatibility. The MCP server currently supports only the /cmd_vel topic with Twist messages; extending to other topics would require additional code changes. When configuring clients like Claude, ensure the path to the repository is correctly mounted in the uv command.

Related MCP Servers

Sponsor this space

Reach thousands of developers