mcp/ros2

Verified Publisher

By mcp

Updated 3 days ago

Python server implementing Model Context Protocol (MCP) for ROS2.

Image
Machine learning & AI
0

3.1K

mcp/ros2 repository overview

WiseVision ROS2 MCP Server

Python server implementing Model Context Protocol (MCP) for ROS2.

What is an MCP Server?

MCP Info

Image Building Info

AttributeDetails
Dockerfilehttps://github.com/wise-vision/mcp_server_ros_2/blob/a4d248c63980e1304c3c5a3288ee165f880e59f4/Dockerfile
Commita4d248c63980e1304c3c5a3288ee165f880e59f4
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/ros2 --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceMozilla Public License 2.0

Available Tools (14)

Tools provided by this ServerShort Description
ros2_action_request_resultWait for the RESULT of a ROS 2 action (GetResult) for a given goal_id.
ros2_action_subscribe_feedbackSubscribe to feedback messages of a ROS 2 action.
ros2_action_subscribe_statusSubscribe to '//_action/status' (action_msgs/msg/GoalStatusArray) and return a snapshot of status frames over a time window.
ros2_cancel_action_goalCancel a ROS 2 action goal via '//cancel_goal' (action_msgs/srv/CancelGoal).
ros2_get_message_fieldsReturns the fields of a given ROS2 message type.
ros2_get_messages_stored_in_influx_data_baseCalls the ROS2 ‘/get_messages’ service to retrieve past messages from a topic for data which is stored in InfluxDB.
ros2_interface_listReturns a list of available ROS 2 interfaces.
ros2_list_actionsList all available ROS 2 actions with their types and request fields.
ros2_send_action_goalSend a goal to a ROS 2 action by name and action type using provided goal fields.
ros2_service_callCall a ROS 2 service by name and type using provided fields.
ros2_service_listReturns a list of available ROS 2 services and their request fields.
ros2_topic_listReturns a list of available ROS 2 topics and their types.
ros2_topic_publishPublish a message to a ROS 2 topic by name and message type using provided field values.
ros2_topic_subscribeSubscribe to a ROS 2 topic by name collecting messages for a given time or count limit.

Tools Details

Tool: ros2_action_request_result

Wait for the RESULT of a ROS 2 action (GetResult) for a given goal_id. Before every use of this tool, the agent should ensure the target action exists (e.g., by calling 'ros2_list_actions').

ParametersTypeDescription
action_namestringAction name, e.g. '/fibonacci'
action_typestringFull action type, e.g. 'example_interfaces/action/Fibonacci' or 'pkg/ActionName'
goal_id_hexstring32-char UUID hex of the goal (no dashes).
timeout_secstring optionalSeconds to wait for GetResult; null → wait indefinitely.
wait_for_service_secnumber optionalSeconds to wait for the GetResult service to appear.

Tool: ros2_action_subscribe_feedback

Subscribe to feedback messages of a ROS 2 action. Optionally filter by goal_id_hex. Collects feedback for a fixed duration or until a maximum number of messages is received. Each message contains goal_id, feedback payload, and receive timestamp.

ParametersTypeDescription
action_namestringAction name, e.g. '/fibonacci'
action_typestringFull action type, e.g. 'example_interfaces/action/Fibonacci' or 'pkg/ActionName'
duration_secnumber optionalHow many seconds to keep spinning and collecting feedback.
goal_id_hexstring optionalOptional 32-char UUID hex of the goal (no dashes) to filter feedbacks.
max_messagesinteger optionalMaximum number of feedback messages to collect.

Tool: ros2_action_subscribe_status

Subscribe to '//_action/status' (action_msgs/msg/GoalStatusArray) and return a snapshot of status frames over a time window. Each frame contains goal_id, accept_stamp, status_code and status text.

ParametersTypeDescription
action_namestringAction name, e.g. '/fibonacci'
duration_secnumber optionalHow many seconds to collect status frames.
max_messagesinteger optionalMax number of individual statuses to collect in total.

Tool: ros2_cancel_action_goal

Cancel a ROS 2 action goal via '//cancel_goal' (action_msgs/srv/CancelGoal). You can cancel a specific goal by goal_id_hex or cancel all matching goals using cancel_all=True. Optionally limit cancellation to goals accepted before a given stamp (sec/nanosec). Before every use of this tool, the agent should ensure the target action exists (e.g., by calling 'ros2_list_actions').

ParametersTypeDescription
action_namestringAction name, e.g. '/fibonacci' or '/navigate_to_pose'
cancel_allboolean optionalIf true, send zero-UUID to cancel all matching goals.
goal_id_hexstring optional32-char UUID hex of the goal (no dashes). Omit when cancel_all=True.
stamp_nanosecinteger optionalNanoseconds part for the acceptance time filter.
stamp_secinteger optionalCancel goals accepted BEFORE this sec (default 0 → usually all).
wait_timeout_secnumber optionalTimeout (seconds) to wait for the service and response.

Tool: ros2_get_message_fields

Returns the fields of a given ROS2 message type.

ParametersTypeDescription
message_typestringFull ROS2 message type, e.g., std_msgs/msg/String

Tool: ros2_get_messages_stored_in_influx_data_base

Calls the ROS2 ‘/get_messages’ service to retrieve past messages from a topic for data which is stored in InfluxDB. Check if the /get_messages service is available before calling.

ParametersTypeDescription
message_typestringFull ROS2 message type used for decoding
topic_namestringName of the topic to retrieve messages from.
number_of_messagesinteger optionalNumber of messages to fetch.
time_endstring optionalISO8601 timestamp string to filter messages before a point in time.
time_startstring optionalISO8601 timestamp string to filter messages after a point in time.

Tool: ros2_interface_list

Returns a list of available ROS 2 interfaces.

Tool: ros2_list_actions

List all available ROS 2 actions with their types and request fields. This tool queries the current ROS graph to discover active action servers and returns a structured description for each action.

Tool: ros2_send_action_goal

Send a goal to a ROS 2 action by name and action type using provided goal fields. Before every use of this tool, the agent must call 'ros2_list_actions' and 'ros2_interface_list' to ensure the latest available actions and types are known. Optionally wait for the result with a timeout.

ParametersTypeDescription
action_namestringAction name, e.g. '/fibonacci' or '/navigate_to_pose'
action_typestringFull action type, e.g. 'example_interfaces/action/Fibonacci' or 'pkg/ActionName'
goal_fieldsobjectDictionary with goal message fields (1st section of .action file)
timeout_secnumber optionalTimeout (seconds) for waiting on the result when wait_for_result=true
wait_for_resultboolean optionalIf true, wait for GetResult and include final status/result

Tool: ros2_service_call

Call a ROS 2 service by name and type using provided fields. Will ask the user to confirm if some fields are missing unless 'force_call' is set to True. Before every use of this tool, the agent must call 'ros2 service list' and 'ros2 interface list' to ensure the latest interface information is available.

ParametersTypeDescription
fieldsobjectDictionary of fields to send in the service request.
service_namestringName of the service to call
service_typestringFull ROS 2 service type, before pass, check service type using tool ros2_service_list
force_callboolean optionalWhether to call the service even if some fields are missing

Tool: ros2_service_list

Returns a list of available ROS 2 services and their request fields.

Tool: ros2_topic_list

Returns a list of available ROS 2 topics and their types.

Tool: ros2_topic_publish

Publish a message to a ROS 2 topic by name and message type using provided field values. Supports single publish (default) or continuous publishing at a specified frequency for a duration. Before every use of this tool, the agent must call 'ros2_topic_list' and 'ros2_interface_list' to ensure the latest available topics and message types are known.

ParametersTypeDescription
dataobjectDictionary containing the message fields and values
message_typestringFull ROS 2 message type, e.g., 'std_msgs/msg/String'
topic_namestringName of the topic to publish to
durationnumber optionalOptional: Duration in seconds for continuous publishing. Must be used with frequency parameter.
frequencynumber optionalOptional: Publish frequency in Hz (messages per second). If provided with duration, publishes repeatedly.

Tool: ros2_topic_subscribe

Subscribe to a ROS 2 topic by name collecting messages for a given time or count limit. Before every use of this tool, the agent must call 'ros2_topic_list' to ensure it has the latest available topics

ParametersTypeDescription
topic_namestringName of the topic to subscribe to
durationnumber optionalIf provided, collects messages for this many seconds.
message_limitinteger optionalIf provided, stops after receiving this number of messages.

Use this MCP Server

{
  "mcpServers": {
    "ros2": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "mcp/ros2"
      ]
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Install from MCP:Hub

Tag summary

Content type

Image

Digest

sha256:ec6572387

Size

858.7 MB

Last updated

3 days ago

Requires Docker Desktop 4.37.1 or later.

This week's pulls

Pulls:

62

Last week