WV

wise-vision/ros2_mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

99 stars 18 forks 质量 73 趋势 20MPL-2.0

wise-vision/ros2_mcp 是一个从 https://github.com/wise-vision/ros2_mcp. 导入的 MCP 服务器候选

概览

wise-vision/ros2_mcp 是一个从 https://github.com/wise-vision/ros2_mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

ROS2 MCP 是一个开源(MPL-2.0)** 模型上下文协议**服务器,允许 AI 代理(Claude、光标、Codex 及任何其他 MCP 客户端)在实时机器人上列出、订阅、发布和调用 ROS 2 的主题、服务和操作。它通过 rclpy 直接与 ROS 2 通信:无 rosbridge,机器人无更改。传输:stdio(默认),可流式 HTTP 和 SSE(MCP 规范已弃用)。

每个工具都是免费且开源的。如果你想帮忙把它装到真实机器上,也有商业支持。

⚡ 快速启动(30秒,Docker)

你需要 Docker 和一个 MCP 客户端。ROS 2 本身不必安装:镜像里就包含了它。

其他MCP客户端:运行docker run -i --rm -e ROS2_MCP_READONLY=1 wisevision/ros2_mcp:jazzy作为其stdio命令。然后问:“列表ROS 2主题”和“阅读来自/chatter的三条消息”。

手边没有机器人?先开一个演示版发行商:

更喜欢用uv?在安装并源代码为ROS 2的机器上(服务器需要rclpy;使用与你发行版匹配的Python,例如Jazzy上的3.12):

只有当你希望代理能够移动物体时,才移除-e ROS2_MCP_READONLY=1(或--read-only标志);参见安全性。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

ROS2 MCP

ROS2 MCP is an open-source (MPL-2.0) Model Context Protocol server that lets AI agents (Claude, Cursor, Codex and any other MCP client) list, subscribe to, publish on and call ROS 2 topics, services and actions on a live robot. It talks to ROS 2 directly through rclpy: no rosbridge, no changes to your robots. Transports: stdio (default), Streamable HTTP and SSE (deprecated by the MCP spec).

Every tool is free and open source. Commercial support is available if you want help putting it on a real machine.

⚡ Quickstart (30 seconds, Docker)

You need Docker and an MCP client. ROS 2 itself does not have to be installed: the image contains it.

# Claude Code (use :humble for a ROS 2 Humble system). Read-only: the agent can look, not act.
claude mcp add ros2 -- docker run -i --rm -e ROS2_MCP_READONLY=1 wisevision/ros2_mcp:jazzy

Any other MCP client: run docker run -i --rm -e ROS2_MCP_READONLY=1 wisevision/ros2_mcp:jazzy as its stdio command. Then ask: “List the ROS 2 topics” and “Read three messages from /chatter”.

No robot at hand? Start a demo publisher first:

docker run -d --name demo-robot ros:jazzy-ros-base bash -c \
  'source /opt/ros/jazzy/setup.bash && ros2 topic pub -r 2 /chatter std_msgs/msg/String "{data: hello from the robot}"'

Prefer uv? On a machine with ROS 2 installed and sourced (the server needs rclpy; use the Python that matches your distro, e.g. 3.12 on Jazzy):

source /opt/ros/jazzy/setup.bash
uvx --python /usr/bin/python3 --from git+https://github.com/wise-vision/ros2_mcp mcp_ros_2_server
在 GitHub 查看完整 README

安装

docker run -d --name demo-robot ros:jazzy-ros-base bash -c \
新手?先看 mcpskill.org 教程 →