Cover image
Try Now
2025-04-14

3 years

Works with Finder

8

Github Watches

0

Github Forks

8

Github Stars

WiseVision ROS2 MCP Server

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

Demo

Features

  • List available topics
  • List available services
  • Call service
  • Get messages from WiseVision Data Black Box (influxDB alternative to Rosbag2)
  • Subscribe topic to get messages
  • Publish message on topic
  • Echo message on topic
  • Get fields from message type

Note: To call service with custom service source it before start server.

API

Tools

  • ros2_topic_list

    • Retrun list of available topics
    • Output:
      • topic_name (string): Topic name
      • topic_type (string): Message topic type
  • ros2_service_list

    • Retruns list available services
    • Output:
      • service_name (string): Service name
      • service_type (string): Service type
      • request_fields (string array): Fields in service
  • ros2_service_call

    • Call ros2 service
    • Inputs:
      • service_name (string): Service name
      • service_type (string): Service type
      • fields (string array): Fields in service request filled with user data
      • force_call (bool): Force service call without every field in service field up, Default set to false
    • Output:
      • result (string): Return result of the service call
      • error (string): Return error in case of error
    • Features:
      • Check if service exists
      • Check if every field in service is provide
  • ros2_topic_subscribe

    • Subscribes to a ROS 2 topic and collects messages either for a duration or a message limit.
    • Inputs:
      • topic_name (string): Topic name
      • msg_type (string): Message type
      • duration (float): How long subscribe topic
      • message_limit (int): How many messages collect
      • Default to collect first message, waiting 5 seconds
    • Output:
      • messages: Serialized messages from topic
      • count: Number of collected messages
      • duration: How long messages has been collected
  • ros2_get_messages

    • Inputs:
      • topic_name (string): Topic name
      • message_type (string): Message type
      • number_of_msg(int): How many messages get from data black box
      • time_start (str): Start time for data retrieval. Only messages with timestamps after this will be returned
      • time_end (str): End time for data retrieval. Only messages with timestamps before this will be returned
    • Output:
      • timestamps: Time values used to indicate when each message was created, recorded, or received. Typically represented as ISO 8601 strings or UNIX epoch times. Used for filtering, ordering, and synchronizing data.
      • messages: Individual units of published data in ROS 2 topics. Each message contains a structured payload defined by its message type (e.g., std_msgs/msg/String).
  • ros2_get_message_fields

    • Inputs:
      • message_type (string): Message type
    • Output:
      • Returns the field names and types for a given ROS 2 message request type
  • ros2_topic_publish

    • Inputs:
      • topic_name (string): Topic name
      • message_type (string): Message type
      • data (dict): Dictionary with message fields
    • Output:
      • status: Status of publication
  • ros2_topic_echo_wait

    • Inputs:
      • topic_name (string): Topic name
      • message_type (string): Message type
      • timeout (float): Duration to wait for a message before giving up.
    • Output:
      • message: The deserialized ROS 2 message, converted to a Python dictionary (via message_to_ordereddict)
      • received: true, indicating the message was successfully received

Usage

MCP Server Configuration

[!NOTE] The server is running inside a Docker container as the root user. To communicate with other ROS components, they must also be run as root.

[!NOTE] Due to this issue, this MCP server doesn't work with Copilot in Visual Studio Code.

Docker run

Set MCP setting to mcp.json.

"mcp_server_ros_2": {
    "command": "docker",
    "args": [
        "run",
        "-i",
        "--rm",
        "wisevision/mcp_server_ros_2"
    ],
    }

Build docker image locally

git clone https://github.com/wise-vision/mcp_server_ros_2.git
cd mcp_server_ros_2
docker build -t wisevision/mcp_server_ros_2 .

Add this to AI Agent prompt:

You are an AI assistant that uses external tools via an MCP server.
Before calling any tool, always check your memory to see if the list of available tools is known.
	•	If you don’t have the current tool list in memory, your first action should be to call the list-tools tool.
	•	Never guess tool names or parameters.
	•	If a user requests something that may require a tool and you don’t have the right tool info, ask them or call list-tools first.
Once the tool list is loaded, you may call tools directly using their documented names and schemas.

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • modelscope
  • 开始以更轻松的方式开始构建具有LLM授权的多代理应用程序。

  • evilsocket
  • 简单的代理开发套件。

  • dmayboroda
  • 带有可配置容器的本地对话抹布

    Reviews

    2.8 (5)
    Avatar
    user_A3Onx9WE
    2025-04-25

    I've been using mcp_server_ros_2 by wise-vision, and it's truly been a game changer for my projects. The server is reliable, easy to integrate, and has vastly improved the efficiency of my robotic systems. I've found it to be user-friendly and robust, making it an essential part of my development toolkit. Highly recommend!

    Avatar
    user_qWuBEKZf
    2025-04-25

    As a loyal user of mcp_server_ros_2, I am incredibly impressed with its performance and reliability. Developed by wise-vision, this product seamlessly integrates into my ROS 2 projects, enhancing efficiency and productivity. Its robust server capabilities have significantly improved my workflow, making it an indispensable tool in my tech arsenal. Highly recommended!

    Avatar
    user_hnPI1v5K
    2025-04-25

    As a dedicated user of mcp_server_ros_2, I find it extremely reliable and efficient for all my robotic operations. Developed by Wise-Vision, this server seamlessly integrates with ROS 2, enhancing my project deployments. The support and constant updates make it a go-to solution for anyone in the robotics field. Highly recommend!

    Avatar
    user_jPaJFByU
    2025-04-25

    I have been using mcp_server_ros_2 from wise-vision, and I am truly impressed with its performance and reliability. The seamless integration and easy-to-navigate interface make it a standout in its field. It's perfect for anyone looking to enhance their server capabilities efficiently. Definitely recommend!

    Avatar
    user_hVWuwuME
    2025-04-25

    As a devoted user of the mcp_server_ros_2 by wise-vision, I am thoroughly impressed with its performance and reliability. This server integration has significantly streamlined my robotics projects, delivering robust and seamless communication between different ROS nodes. It is a must-have tool for anyone serious about optimizing their ROS setup. Highly recommended!