SuperAPI AI Directory

mcp_server_ros_2

ROS 2 integration for AI-driven robotics applications and services.

Open website

About this tool

ROS2 MCP is an open-source (MPL-2.0) Model Context Protocol server designed to enable AI agents (such as Claude, Cursor, Codex, and any other MCP clients) to view, understand, and operate ROS 2 robots. It communicates directly with ROS 2 through rclpy, requiring no rosbridge and no modifications to the robot.

Purpose The server is used for AI-assisted ROS 2 development and robot operation. It enables agents to discover message types, publish/subscribe to topics, and call services, thereby validating behavior end to end, and it can be used to control robots, run QoS experiments, and analyze real-time data and robot/cluster status.

Main capabilities

  • Provides 24 tools, covering topic listing, subscription, publication, service calls, action lifecycle (goal, result, feedback, status, cancel), and more.
  • Supports all ROS 2 message types, including nested fields and custom message types (the package defining the message must be sourced before startup).
  • Automatically selects QoS for topics.
  • Includes four built-in prompts: base.ros2-topic-echo-and-analyze (subscribe to a topic, collect messages, and perform statistical analysis), base.ros2-topic-relay (subscribe to one topic and forward to another topic, supporting identity forwarding, rate limiting, and change-based filtering), base.ros2-node-health-check (check whether expected topics and services are available and operating normally, with optional publish rate monitoring), base.ros2-topic-diff-monitor (compare message differences between two topics, analyzing field by field).
  • Supports returning images, maps, and point clouds as PNG.
  • Provides a read-only mode, in which tools that can change the robot state are removed.
  • Transport methods: stdio (default), Streamable HTTP, and SSE (deprecated by the MCP specification, retained only for existing clients).

Usage

  • Quick start (Docker): requires Docker and an MCP client; no need to install ROS 2, as it is already included in the image. Run command: docker run -i --rm -e ROS2_MCP_READONLY=1 wisevision/ros2_mcp:jazzy as a stdio command. Then you can haveThe agent executes "List the ROS 2 topics" and "Read three messages from /chatter".
  • Using uv: on a machine where ROS 2 is installed and sourced (the server needs rclpy, use the Python matching the distribution, e.g. 3.12 on Jazzy).
  • Only after removing -e ROS2_MCP_READONLY=1 (or the --read-only flag) can the agent move objects; see the Security section.
  • For client-specific setup (VS Code Copilot, Claude Desktop, Warp, Codex CLI, custom messages), see the installation guide.
  • Documentation: wisevision.tech/docs.
  • Remote/multi-client: use Streamable HTTP. In the Docker example, set ROS2_MCP_HOST=0.0.0.0, and bind only to the loopback address via -p 127.0.0.1:port. Note: there is no authentication, so anyone who can reach the port can use all tools, including publishing topics. Keep it on loopback or a private network, and place an authenticating reverse proxy in front before exposing it more widely, while also considering read-only mode.
  • DDS discovery warm-up: after the container starts, the first tool call may return an incomplete list of topics/services. The server performs a one-time warm-up on the first tool call in the container environment, which can be adjusted via MCP_ROS_DISCOVERY_STABLE_SEC (default 1.0), MCP_ROS_DISCOVERY_TIMEOUT_SEC (default 5.0), and MCP_ROS_DISCOVERY_WARMUP=false.
  • For debugging, MCP Inspector is recommended and can be started via npm.

Use cases

  • AI-assisted ROS 2 development: let the agent discover message types, publish/subscribe to topics, and call services without boilerplate code or error-prone network configuration.
  • Robot control: in non-read-only mode, the agent can publish topics, call services, and send action goals, thereby operating a real robot.
  • QoS experimentation and real-time data analysis.
  • Seamless collaboration with VS Code Copilot and other MCP clients.
  • Simulation environments: provides a Gazebo drone demo and a forklift rosbag demo.

Limitations

  • ROS 1 is not supported (the server uses rclpy).
  • Requires Python 3.10 or later.
  • Read-only mode hides the following tools: ros2_topic_publish, ros2_publish_multiple_topics, ros2_service_call, ros2_send_action_goal, ros2_cancel_action_goal. Read-only mode uses a fail-closed policy: only tools explicitly reviewed as read-only are registered (listed in server/tool_safety.py), and tests fail if a newly added tool is not classified. ros2_service_call is hidden because the server cannot know whether an arbitrary service has side effects.
  • Streamable HTTP currently has no authentication, so you must protect it yourself via loopback, a private network, or a reverse proxy.
  • Roadmap (proposed, not committed): parameter tools, TF tools, Streamable HTTP authentication, node tools, Nav2-specific helpers, PyPI package; ROS 1 is not planned.
  • Commercial support: WiseVision (the maintainer) offers integration support, custom tools and prompts, and priority fixes; contact via wisevision.tech/contact or hello@wisevision.tech, quoted per project, no price list.
  • Every tool is free and open source and can be used in commercial products without asking.