ros2-mcp-server

ros2-mcp-server

45

ros2-mcp-server is a Python-based server that integrates the Model Context Protocol (MCP) with ROS 2, allowing AI assistants to control robots through ROS 2 topics. It supports asynchronous command processing and is designed for compatibility with the ROS 2 Humble distribution.

ros2-mcp-server

ros2-mcp-server is a Python-based server integrating the Model Context Protocol (MCP) with ROS 2 to allow AI assistants to control robots via ROS 2 topics.

Features

  • MCP Integration with FastMCP.
  • Operates as a ROS 2 node, publishing to /cmd_vel.
  • Supports time-based robot movement commands.
  • Asynchronous processing using asyncio with ROS 2's event loop.

Prerequisites

  • ROS 2 Humble distribution.
  • Python 3.10.
  • Python packages: rclpy, fastmcp, numpy.

Installation

  1. Clone the repository.
  2. Ensure Python 3.10 is set.
  3. Create and activate a virtual environment.
  4. Install dependencies.

MCP Server Configuration

  • Configure as MCP server for clients like Claude and Cline.

Usage

  • Use Claude to send movement commands to the robot.

Testing

  • Test with simulators like Gazebo or real robots.
  • Observe robot movement and validate with logs.

Troubleshooting

  • Check log directories, Python version, and server configuration for errors.

Limitations

  • Currently supports basic commands on /cmd_vel topic.