About lpigeon/ros-mcp-server
lpigeon/ros-mcp-server is an MCP server published by lpigeon in the Science category: issued natural language commands into ROS or ROS2 control commands. Conduid read 31 tools from its source: call_service, cancel_action_goal, connect_to_robot, delete_parameter, detect_ros_version, get_action_details and 25 more. No package is published for it, so it installs from a source checkout.
The repository has 1.5K stars and 221 forks, and its last commit was on 30 Nov 2026. The latest release is v3.1.2 (23 Sep 2026): Fixed a versioning bug. It follows v3.1.1 (22 Sep 2026), and the 5 most recent releases go back to v3.0.0 (29 Jan 2026). It passes all 1 static checks Conduid ran on the repository. Its topics include ros, ros-mcp-server, ros2 and ros2-mcp-server.
Install
git clone https://github.com/lpigeon/ros-mcp-serverTools (31)
call_serviceCall a ROS service with specified request data.
Example:
call_service('/rosapi/topics', 'rosapi/Topics', {})
call_service('/slow_service', 'my_package/SlowService', {}, timeout=10.0) # Specify timeout only for slow services
IMPORTANT: Field names in the request dict should match the field names shown by get_service_details(), which are already formatted for rosbridge (without leading underscores). For example, use {'topic': '/image'} not {'_topic': '/image'}.| Parameter | Type | Description |
|---|---|---|
| request * | object | Service request data as a dictionary |
| service_name * | string | The service name (e.g., '/rosapi/topics') |
| service_type * | string | The service type (e.g., 'rosapi/Topics') |
| timeout | number | Timeout in seconds. If None, uses ws_manager.default_timeout. |
cancel_action_goalCancel a specific action goal. Works only with ROS 2.
Example:
cancel_action_goal('/turtle1/rotate_absolute', 'goal_1758653551839_21acd486')| Parameter | Type | Description |
|---|---|---|
| action_name * | string | The name of the action (e.g., '/turtle1/rotate_absolute') |
| goal_id * | string | The goal ID to cancel |
connect_to_robotConnect to the robot by setting the IP/port. This tool also tests connectivity to confirm that the robot is reachable and the port is open.| Parameter | Type | Description |
|---|---|---|
| ip | string | The IP address of the rosbridge server. |
| ping_timeout | number | Timeout for ping in seconds. Default = 2.0. |
| port | any | The port number of the rosbridge server. |
| port_timeout | number | Timeout for port check in seconds. Default = 2.0. |
delete_parameterDelete a ROS parameter. Works only with ROS 2.
Example:
delete_parameter('/turtlesim:background_b')| Parameter | Type | Description |
|---|---|---|
| name * | string | The parameter name (e.g., '/turtlesim:background_b') |
detect_ros_versionDetect the ROS version and distribution via rosbridge.get_action_detailsGet complete action details including goal, result, and feedback structures. Requires the action type; if you don't know it, call without action_type to get the list of available types back in the error.
Example:
get_action_details('/turtle1/rotate_absolute', 'turtlesim/action/RotateAbsolute')| Parameter | Type | Description |
|---|---|---|
| action * | string | The action name (e.g., '/turtle1/rotate_absolute') |
| action_type | string | The action type (e.g., 'turtlesim/action/RotateAbsolute'). Required. Call without action_type to get the available types back in the error (they are also listed by the interfaces service, not by get_actions(), which returns action *names*). |
get_action_statusGet action status for a specific action name. Works only with ROS 2.
Example:
get_action_status('/turtle1/rotate_absolute')| Parameter | Type | Description |
|---|---|---|
| action_name * | string | The action name (e.g., '/turtle1/rotate_absolute') |
get_actionsGet list of all available ROS actions.
Example:
get_actions()get_message_detailsGet the complete structure/definition of a message type.
Example:
get_message_details('geometry_msgs/Twist')| Parameter | Type | Description |
|---|---|---|
| message_type * | string | The message type (e.g., 'geometry_msgs/Twist') |
get_node_detailsGet detailed information about a specific node including its publishers, subscribers, and services.
Example:
get_node_details('/turtlesim')| Parameter | Type | Description |
|---|---|---|
| node * | string | The node name (e.g., '/turtlesim') |
get_nodesGet list of all currently running ROS nodes.
Example:
get_nodes()get_parameterGet a single ROS parameter value by name. Works only with ROS 2.
Example:
get_parameter('/turtlesim:background_b')| Parameter | Type | Description |
|---|---|---|
| name * | string | The parameter name (e.g., '/turtlesim:background_b') |
get_parameter_detailsGet comprehensive details about a specific ROS parameter including value, type, and metadata. Works only with ROS 2.
Example:
get_parameter_details('/turtlesim:background_r')| Parameter | Type | Description |
|---|---|---|
| name * | string | The parameter name (e.g., '/turtlesim:background_r') |
get_parametersGet list of all ROS parameter names for a specific node. Works only with ROS 2.
Example:
get_parameters('cam2image')
get_parameters('/cam2image')| Parameter | Type | Description |
|---|---|---|
| node_name * | string | The node name (e.g., '/turtlesim') |
get_service_detailsGet complete service details including request/response structures and provider nodes.
Example:
get_service_details('/rosapi/topics')| Parameter | Type | Description |
|---|---|---|
| service * | string | The service name (e.g., '/rosapi/topics') |
get_service_typeGet the service type for a specific service.
Example:
get_service_type('/rosapi/topics')| Parameter | Type | Description |
|---|---|---|
| service * | string | The service name (e.g., '/rosapi/topics') |
get_servicesGet list of all available ROS services.
Example:
get_services()get_topic_detailsGet detailed information about a specific topic including its type, publishers, and subscribers.
Example:
get_topic_details('/cmd_vel')| Parameter | Type | Description |
|---|---|---|
| topic * | string | The topic name (e.g., '/cmd_vel') |
get_topic_typeGet the message type for a specific topic.
Example:
get_topic_type('/cmd_vel')| Parameter | Type | Description |
|---|---|---|
| topic * | string | The topic name (e.g., '/cmd_vel') |
get_topicsGet list of all available ROS topics.
Example:
get_topics()get_verified_robot_specLoad specifications and usage context for a verified robot model. ONLY use if the robot model is in the verified list (use get_verified_robots_list first to check). Most robots won't have a spec - that's OK, connect directly using connect_to_robot instead.| Parameter | Type | Description |
|---|---|---|
| name * | string | The exact robot model name from the verified list. |
get_verified_robots_listList pre-verified robot models that have specification files with usage guidance available. Use this to check if a robot model has additional context available before calling get_verified_robot_spec. If your robot is not in this list, you can still connect to it directly using connect_to_robot.has_parameterCheck if a ROS parameter exists. Works only with ROS 2.
Example:
has_parameter('/turtlesim:background_b')| Parameter | Type | Description |
|---|---|---|
| name * | string | The parameter name (e.g., '/turtlesim:background_b') |
ping_robotsPing one or more robot IP addresses and check if specific ports are open.
A successful ping to the IP but not the port can indicate that ROSbridge is not running.
Example:
ping_robots(targets=[{'ip': '192.168.1.100', 'port': 9090}, {'ip': '192.168.1.101', 'port': 9090}])| Parameter | Type | Description |
|---|---|---|
| port_timeout | number | Timeout for port check in seconds. Default = 2.0. |
| targets | array | List of target dictionaries, each containing: - ip (str): The IP address to ping (e.g., '192.168.1.100') - port (int): The port number to check (e.g., 9090) |
publish_for_durationsPublish a sequence of messages to a ROS topic, each held for a given duration.
With rate_hz=0 (default): publishes each message once, then waits for the duration.
With rate_hz>0: publishes each message repeatedly at the given rate for the duration (useful for controllers like diff_drive that need continuous commands).
Example (single publish with delay):
publish_for_durations(topic='/cmd_vel', msg_type='geometry_msgs/msg/Twist', messages=[{'linear': {'x': 1.0}}, {'linear': {'x': 0.0}}], durations=[1, 2])
Example (continuous streaming at 10 Hz for 2 seconds):
publish_for_durations(topic='/cmd_vel', msg_type='geometry_msgs/msg/Twist', messages=[{'angular': {'z': 0.5}}], durations=[2.0], rate_hz=10)| Parameter | Type | Description |
|---|---|---|
| durations | array | A list of durations (seconds) to hold each message |
| messages | array | A list of message dictionaries (ROS-compatible payloads) |
| msg_type | string | ROS message type (e.g., "geometry_msgs/msg/Twist") |
| rate_hz | number | Publishing rate in Hz. 0 = publish once then wait (default). >0 = publish repeatedly at this rate for the duration. |
| topic | string | ROS topic name (e.g., "/cmd_vel") |
publish_oncePublish a single message to a ROS topic.
Example:
publish_once(topic='/cmd_vel', msg_type='geometry_msgs/msg/TwistStamped', msg={'linear': {'x': 1.0}})| Parameter | Type | Description |
|---|---|---|
| msg | object | Message payload as a dictionary |
| msg_type | string | ROS message type (e.g., "geometry_msgs/msg/Twist") |
| topic | string | ROS topic name (e.g., "/cmd_vel") |
send_action_goalSend a goal to a ROS action server. Works only with ROS 2.
Example:
send_action_goal('/turtle1/rotate_absolute', 'turtlesim/action/RotateAbsolute', {'theta': 1.57})| Parameter | Type | Description |
|---|---|---|
| action_name * | string | The name of the action to call (e.g., '/turtle1/rotate_absolute') |
| action_type * | string | The type of the action (e.g., 'turtlesim/action/RotateAbsolute') |
| goal * | object | The goal message to send |
| timeout | number | Timeout for action completion in seconds. If None, uses ws_manager.default_timeout. |
set_parameterSet a single ROS parameter value. Works only with ROS 2.
Example:
set_parameter('/turtlesim:background_b', '255')| Parameter | Type | Description |
|---|---|---|
| name * | string | The parameter name (e.g., '/turtlesim:background_b') |
| value * | string | The parameter value to set |
subscribe_for_durationSubscribe to a topic for a duration and collect messages.
Example:
subscribe_for_duration(topic='/cmd_vel', msg_type='geometry_msgs/msg/TwistStamped', duration=5, max_messages=10)
subscribe_for_duration(topic='/high_rate_topic', msg_type='sensor_msgs/Image', duration=10, queue_length=5, throttle_rate_ms=100) # Control message buffering and rate
subscribe_for_duration(topic='/camera/image_raw', msg_type='sensor_msgs/Image', duration=5, expects_image='true') # Hint that this is an image for faster processing
subscribe_for_duration(topic='/point_cloud', msg_type='sensor_msgs/PointCloud2', duration=5, expects_image='false') # Skip image detection for non-image data| Parameter | Type | Description |
|---|---|---|
| duration | number | How long (seconds) to listen for messages |
| max_messages | integer | Maximum number of messages to collect before stopping |
| msg_type | string | ROS message type (e.g. "geometry_msgs/Twist") |
| queue_length | integer | How many messages to buffer before dropping old ones. Must be ≥ 1. Default is 1. |
| topic | string | ROS topic name (e.g. "/cmd_vel", "/joint_states") |
subscribe_onceSubscribe to a ROS topic and return the first message received.
Example:
subscribe_once(topic='/cmd_vel', msg_type='geometry_msgs/msg/TwistStamped')
subscribe_once(topic='/slow_topic', msg_type='my_package/SlowMsg', timeout=10.0) # Use longer timeout for slow topics
subscribe_once(topic='/high_rate_topic', msg_type='sensor_msgs/Image', timeout=5.0, queue_length=5, throttle_rate_ms=100) # Control message buffering and rate
subscribe_once(topic='/camera/image_raw', msg_type='sensor_msgs/Image', expects_image='true') # Hint that this is an image for faster processing
subscribe_once(topic='/point_cloud', msg_type='sensor_msgs/PointCloud2', expects_image='false') # Skip image detection for non-image data| Parameter | Type | Description |
|---|---|---|
| expects_image | string | Hint about whether to expect image data. - "true": prioritize image parsing (use for sensor_msgs/Image topics) - "false": skip image detection for faster processing (use for non-image topics) - "auto": auto-detect based on message fields (default) |
| msg_type | string | The ROS message type (e.g., "geometry_msgs/Twist"). |
| timeout | number | Timeout in seconds. If None, uses ws_manager.default_timeout. |
| topic | string | The ROS topic name (e.g., "/cmd_vel", "/joint_states"). |
view_saved_imageView a previously saved image from disk.
Images are automatically saved when subscribing to image topics.
Use this tool to re-view a saved image without re-subscribing.| Parameter | Type | Description |
|---|---|---|
| image_path | string |
Security checks
- ✓README presentThe repository's README runs to about 475 words.
5 checks have not been run yet.
Releases
README
The repository's README runs to about 475 words. The original in the repository is authoritative.
Read full README