
Mcp Server Ros 2
io.github.wise-vision由 GitHub 帳號 wise-vision 發布v1.0.0更新於 Oct 24, 2026
View ROS 2 nodes and topics, and call services and actions via MCP
概覽
讓助理透過列出主題、服務與動作,並發布、訂閱或呼叫它們,來檢視與控制 ROS 2 機器人。
- 可以做什麼
- 透過 stdio 將 AI 助理連接到執行中的 ROS 2 系統。它可以列出主題、服務與動作及其訊息類型與欄位,訂閱主題收集訊息,發布訊息,呼叫服務,以及送出、監控或取消動作目標。它也能把佔用網格地圖與點雲算繪成 PNG 影像,並可從 WiseVision Data Black Box 讀取歷史主題資料。
- 適用情境
- 適合使用 ROS 2 Humble 或 Jazzy 的機器人開發者、研究人員與學生,希望讓助理檢視即時機器人資料、除錯主題與服務,或驅動動作而不必撰寫樣板程式碼。當助理只應觀察而不應操作時,可使用唯讀模式。
- 執行需求
- 以 Docker 容器或 Python 行程在本機執行,因此需要 Docker 或搭配 uv 的 Python 執行環境。它必須能存取 ROS 2 圖,自訂服務類型需在啟動前 source。選用環境變數用於設定提示詞與 DDS 探索暖機。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Server Ros 2,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ROS2 MCP
[Tests] [Release] [License: MPL-2.0] [ROS 2 Humble] [ROS 2 Jazzy] [Python 3.10+] [Docker pulls] [Discord] [Docs]
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.
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:
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):
Remove -e ROS2_MCP_READONLY=1 (or the --read-only flag) only when you want the agent to be able to move things; see Security. Client-specific setup (VS Code Copilot, Claude Desktop, Warp, Codex CLI, custom messages): installation guide. Docs: wisevision.tech/docs.
mcp/ros2in Docker's official MCP catalog (13,750 pulls at the time of writing) is built by Docker and lags our releases: it was last updated on 2026-02-04 and predates read-only mode.wisevision/ros2_mcpis built and pushed by this repository's CI and is the one the commands above use.
🧰 Tools
24 tools. ⚠ marks tools that can change robot state; read-only mode removes them. The complete, generated reference with input schemas is docs/generated/tools.md (a CI check keeps it in sync with the code).
Also included: four built-in prompts, automatic QoS selection for topics, nested message fields, and custom message types (source your package before starting; see the installation guide).
🧭 Supported ROS 2 distributions
ROS 1 is not supported (the server uses rclpy). Python 3.10 or newer.
🆚 How it compares
Other open-source ROS MCP servers exist. They make different trade-offs; pick by what you need. Facts below were read from each project's README, pyproject.toml and GitHub page on 2026-10-14.
When to pick another one: you need ROS 1, node or parameter tools, or you want the MCP server off the robot with only rosbridge exposed there: use robotmcp/ros-mcp-server. We do not claim to be better on every axis. What we offer: native rclpy access (no bridge process between the agent and DDS), a read-only mode that fails closed (a tool is registered in that mode only if it was explicitly reviewed as read-only, and a test fails when a new tool is unclassified), images, maps and point clouds returned as PNGs, the complete action lifecycle (goal, result, feedback, status, cancel), and commercial support if you need it. Something here is wrong or out of date? Open an issue and we will fix it.
🗺️ Roadmap (proposed, not committed)
What users ask for that is not in ROS2 MCP today. No dates; open an issue or a Discussion to vote or to pay for one.
- Parameter tools: get / set / list node parameters.
- TF tools: transform lookup and frame tree.
- Authentication for Streamable HTTP (bearer token or a documented reverse-proxy recipe). The transport itself is in #55; until auth exists, keep it on loopback or a private network.
- Node tools (list nodes, node info), Nav2-specific helpers, a PyPI package, ROS 1 (not planned).
🤖 For AI agents
If you are an agent (or building one) using this server:
- Discover before you act. Call
ros2_topic_list,ros2_service_list,ros2_list_actionsandros2_interface_list, thenros2_get_message_fieldsfor the exact message type, before any publish, service call or action goal. Do not guess field names. - Prefer read-only. If
ros2_topic_publish,ros2_service_call,ros2_send_action_goalare absent fromlist_tools, the operator started the server in read-only mode; do not try to work around it. - Mutating tools move real machines. Confirm intent with the human before calling a ⚠ tool, start with small values and a short duration, and keep
ros2_cancel_action_goalin mind. - Right after container start the graph may be incomplete (DDS discovery). If a topic you expect is missing, retry once before concluding it does not exist; see DDS discovery warm-up.
- Machine-readable references:
docs/generated/tools.json(every tool and its input schema),server.json(MCP registry manifest),AGENTS.md(repo layout, how to build, test and add a tool), wisevision.tech/llms.txt.
🏢 Commercial support & integration
ROS2 MCP is free software under the MPL-2.0: you can use it in a commercial product without asking us. Nothing in this section changes that.
If you are putting it on a real robot or fleet and want more than the public issue tracker, WiseVision (the maintainers) can help with:
- Integration support: getting the server running against your stack, your message types and your QoS constraints.
- Custom tools and prompts: handlers for your own interfaces, beyond the built-in topic, service and action set.
- Priority fixes: a defect that blocks your deployment, handled on a schedule instead of a backlog.
How to reach us: use the form at wisevision.tech/contact (choose ROS2 MCP on a real fleet) or write to [email protected]. Tell us the problem first: what robot, what stack, what is blocking you. We scope and quote per project; there is no price list, so please contact us. Questions that other users could learn from belong in Discussions or issues.
Want to see it on real data first? The forklift rosbag demo replays a warehouse forklift recording and walks through three MCP calls in about ten minutes.
⚙️ Installation
Follow the installation guide for step-by-step instructions:
- 🧩 Install in Visual Studio Code Copilot
- 🤖 Install in Claude Desktop
- 💻 Install in Warp
- 🐳 Build Docker Image locally
🔒 Security: read-only mode
An agent connected to a real robot can move it. Start the server in read-only mode to let the agent observe but not act:
In read-only mode the tools that change robot state are not registered at all: they do not appear in list_tools, and calling one returns an Unknown tool error. The hidden tools are:
ros2_topic_publish, ros2_publish_multiple_topics, ros2_service_call, ros2_send_action_goal, ros2_cancel_action_goal.
Read-only mode fails closed: only tools that were explicitly reviewed as read-only (listed in server/tool_safety.py) are registered, and a test fails if a new tool is added without being classified.
ros2_service_call is hidden because the server cannot know whether an arbitrary service has side effects.
🌐 Streamable HTTP (remote / multi-client)
stdio is the default and needs no network. To serve several clients, or a client on another machine, use Streamable HTTP, the transport the current MCP specification defines (the older sse transport is deprecated by the spec and kept only for existing clients).
Docker (publish the port on loopback only):
ROS2_MCP_HOST=0.0.0.0 is needed inside the container (a loopback bind is unreachable through -p); the 127.0.0.1: in -p keeps it off your network. If the first tool call lists no topics, DDS discovery is not crossing the container boundary; on Linux --network host (then drop -p and ROS2_MCP_HOST) is the usual fix, but that depends on your DDS and network setup.
⚠️ There is no authentication. Anyone who can reach the port can use every tool, including publishing to topics. Keep it on loopback or a private network, put an authenticating reverse proxy in front of anything wider, and consider read-only mode. The server prints a warning when it binds to a non-loopback address.
🧭 DDS discovery warm-up (Docker)
If the first tool call returns an incomplete list of topics/services right after container start, DDS discovery may still be in progress. The server performs a one-time warm-up on the first tool call in container environments; tune it via:
MCP_ROS_DISCOVERY_STABLE_SEC(default:1.0)MCP_ROS_DISCOVERY_TIMEOUT_SEC(default:5.0)MCP_ROS_DISCOVERY_WARMUP=falseto disable
🤖 Prompts
📘 Want to create a custom prompt? Check the guide here
📊 base.ros2-topic-echo-and-analyze
Subscribe to a ROS2 topic, collect messages for a specified duration, and provide statistical analysis of the collected data.
➡️ Can auto-detect topic if only one is available. Analyzes message rates, counts, and statistics on numeric fields.
🔄 base.ros2-topic-relay
Subscribe to one ROS2 topic and republish messages to another topic with optional transformations.
➡️ Supports identity relay, rate limiting, and change-based filtering.
🏥 base.ros2-node-health-check
Check if expected ROS2 topics and services are available and functioning correctly with optional publication rate monitoring.
➡️ Provides comprehensive health report with status indicators and recommendations.
🔍 base.ros2-topic-diff-monitor
Compare two ROS2 topics and report differences in their messages with detailed field-by-field analysis.
➡️ Useful for comparing raw sensor data with filtered/processed versions or verifying topic synchronization.
ROS2 MCP also has a prompts extension with additional prompts: see here
💡 Don’t know what prompts are? See the MCP spec here.
Note: To call a service with a custom (non-default) type, source the package that defines it before starting the server.
🎬 Demos
🚀 Drone mission using prompts
🌍 Real-world example
Want to try it in simulation? See the Gazebo drone demo.
🐞 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:
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
🤝 Contributing
Contributions are welcome. Check the open issues, open a pull request, or drop by our Discord to discuss ideas first. See AGENTS.md for dev setup and tests. By participating you agree to our Code of Conduct.
📚 Origins
We built this server to make AI‑assisted ROS 2 development fast and reliable. Internally, we needed a simple way for agents to discover message types, publish/subscribe to topics, and call services—without boilerplate or flaky networking. That led to a few core design goals:
- Handle all ROS 2 message types (including nested fields) so agents can write and test any code
- Integrate topic pub/sub and service calls to validate behavior end‑to‑end
- Work seamlessly with GitHub Copilot in VS Code and other MCP clients
- Use a simple stdio transport to avoid network complexity
After dogfooding it, we open‑sourced the project (MPL-2.0) to help the broader ROS 2 community build faster with AI. It’s now useful not only for development, but also for controlling robots, running QoS experiments, and analyzing live data and robot/swarm state. The project is actively maintained—features and improvements ship regularly based on user feedback. If this project helps you, share your use case in Discussions!
來源:README.md,提交 4f287b0
工具
0版本歷史
1- v1.0.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分