WiseVision/mcp_server_ros_2

WiseVision/mcp_server_ros_2

Public implementation of MCP for ROS 2 enabling to interact with system visible various robots, capable of: List available topics List available services Call service Subscribe topic to get messages Publish message on topic and more

Category
访问服务器

README

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.

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /path/to/mcp_server_ros2 run mcp_server_ros_2

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选