A Python implementation of the Model Context Protocol (MCP) for ROS 2. This server enables AI tooling to connect with ROS 2 nodes, topics, and services using the MCP standard over stdio. Designed to be the easiest ROS 2 MCP server to configure. - List available topics - List available services - Lists available actions with their types and request fields - Call services - Subscribe to topics to co
Add this skill
npx mdskills install wise-vision/mcp-server-ros-2Comprehensive ROS 2 MCP server with extensive topic, service, and action tools plus well-documented prompts
12# ROS2 MCP Server34[](https://discord.gg/9aSw6HbUaw)567[](https://hub.docker.com/mcp/server/ros2/overview)8[](https://github.com/wise-vision/mcp_server_ros_2/stargazers)9101112A **Python** implementation of the **Model Context Protocol (MCP)** for **ROS 2**. This server enables AI tooling to connect with **ROS 2** nodes, topics, and services using the **MCP** standard over **stdio**. Designed to be **the easiest** **ROS 2** MCP server to configure.1314# ✨ Tools15- List available topics16- List available services17- Lists available actions with their types and request fields18- Call services19- Subscribe to topics to collect messages20- Publish messages to topics21- Echo messages on topics22- Get fields from message types23- Sends an action goal and optionally waits for the result24- Requests the result of an action goal25- Subscribes to feedback messages from an action26- Subscribes to status updates of an action27- Cancels a specific goal or all active goals28- Get messages from [WiseVision Data Black Box](https://github.com/wise-vision/wisevision_data_black_box) ([InfluxDB](https://www.influxdata.com) alternative to [Rosbag2](https://github.com/ros2/rosbag2))293031# 🤖 Available Prompts32### 📘 Want to create a custom prompt? [Check the guide here](/docs/CREATE_PROMPT.md)3334## 📊 base.ros2-topic-echo-and-analyze3536Subscribe to a ROS2 topic, collect messages for a specified duration, and provide statistical analysis of the collected data.3738➡️ Can auto-detect topic if only one is available. Analyzes message rates, counts, and statistics on numeric fields.3940## 🔄 base.ros2-topic-relay4142Subscribe to one ROS2 topic and republish messages to another topic with optional transformations.4344➡️ Supports identity relay, rate limiting, and change-based filtering.4546## 🏥 base.ros2-node-health-check4748Check if expected ROS2 topics and services are available and functioning correctly with optional publication rate monitoring.4950➡️ Provides comprehensive health report with status indicators and recommendations.5152## 🔍 base.ros2-topic-diff-monitor5354Compare two ROS2 topics and report differences in their messages with detailed field-by-field analysis.5556➡️ Useful for comparing raw sensor data with filtered/processed versions or verifying topic synchronization.5758## ROS2 MCP has Prompts extension with additional prompts [See here](https://github.com/wise-vision/ros2_mcp_prompts)59606162### 💡 Don’t know what prompts are? [See the MCP spec here](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts#user-interaction-model).6364656667**Note:** To call a service with a custom (non-default) type, source the package that defines it before starting the server.6869## 🎯 Why Choose This MCP Server?7071**Save hours of development time** with native AI integration for your ROS 2 projects:7273## Why this ROS 2 MCP server ⭐7475- **⚡ 1-minute setup** - World's easiest ROS 2 MCP configuration76- **0️⃣ Zero-friction setup** - stdio transport, no brokers, no webserver.77- **🔌 Auto type discovery** - a built-in “list interfaces” tool dynamically enumerates available topics and services together with their message/service definitions (fields, types, schema) — so the client always knows exactly what data can be published or called.78- **✨ Nested field support**: Handle complex message structures with ease.79- **🤖 AI-powered debugging** - Let AI help you troubleshoot ROS 2 issues in real time80- **📊 Smart data analysis** - Query your robot's sensor data using natural language81- **🚀 Boost productivity** - Control robots, analyze logs, and debug issues through AI chat82- **💡 No ROS 2 expertise required** - AI translates your requests into proper ROS 2 commands83- **🐋 Dockerized**: Ready-to-use Docker image for quick deployment.84- **🔧 Auto QoS selection**: Automatically selects appropriate Quality of Service settings for topics and services, ensuring optimal communication performance without manual configuration.8586**Perfect for:** Robotics developers, researchers, students, and anyone working with ROS 2 who wants to leverage AI for faster development and debugging.8788If you find this useful, please ⭐ star the repo — it helps others discover it.8990🚀 **Enjoying this project?**91Feel free to contribute or reach out for support! Write issues, submit PRs, or join our [Discord community](https://discord.gg/9aSw6HbUaw) to connect with other ROS 2 and AI enthusiasts.9293# 🚀 Drone Mission Using Prompts949596# 🌍 Real-world examples:979899# ⚙️ Installation100101Follow the [installation guide](installation/README.md) for step-by-step instructions:102- [🧩 Install in Visual Studio Code Copilot](installation/README.md#configure-visual-studio-code-copilot)103- [🤖 Install in Claude Desktop](installation/README.md#configure-claude-desktop)104- [💻 Install in Warp](installation/README.md#configure-warp)105- [🐳 Build Docker Image locally](installation/README.md#build-docker-image-locally)106107## 💡 Want to try it in simulation?108[Check out the Gazebo Drone Demo section](docs/DEMO_DRONE.md)109110111112### 🔧 ROS 2 Tools113114#### 📋 **Topics**115| Tool | Description | Inputs | Outputs |116|------|-------------|--------|---------|117| **`ros2_topic_list`** | Returns list of available topics | – | `topic_name` (string): Topic name <br> `topic_type` (string): Message type |118| **`ros2_topic_subscribe`** | Subscribes to a ROS 2 topic and collects messages for a duration or message limit | `topic_name` (string) <br> `duration` (float) <br> `message_limit` (int) <br> *(defaults: first msg, 5s)* | `messages` <br> `count` <br> `duration` |119| **`ros2_get_messages`** | Retrieves past messages from a topic (data black box) | `topic_name` (string) <br> `message_type` (string) <br> `number_of_messages` (int) <br> `time_start` (str) <br> `time_end` (str) | `timestamps` <br> `messages` |120| **`ros2_get_message_fields`** | Gets field names and types for a message type | `message_type` (string) | Field names + types |121| **`ros2_topic_publish`** | Publishes message to a topic | `topic_name` (string) <br> `message_type` (string) <br> `data` (dict) | `status` |122123---124125#### 🛠 **Services**126| Tool | Description | Inputs | Outputs |127|------|-------------|--------|---------|128| **`ros2_service_list`** | Returns list of available services | – | `service_name` (string) <br> `service_type` (string) <br> `request_fields` (array) |129| **`ros2_service_call`** | Calls a ROS 2 service | `service_name` (string) <br> `service_type` (string) <br> `fields` (array) <br> `force_call` (bool, default: false) | `result` (string) <br> `error` (string, if any) |130131#### 🎯 **Actions**132| Tool | Description | Inputs | Outputs |133|------|-------------|--------|---------|134| **`ros2_list_actions`** | Returns list of available ROS 2 actions with their types and request fields | – | `actions[]` (array) <br> └ `name` (string) <br> └ `types[]` (array of string) <br> └ `request_fields` (array) |135| **`ros2_send_action_goal`** | Sends a goal to an action. Optionally waits for the result. | `action_name` (string) <br> `action_type` (string) <br> `goal_fields` (object) <br> `wait_for_result` (bool, default: false) <br> `timeout_sec` (number, default: 60.0) | `accepted` (bool) <br> `goal_id` (string\|null) <br> `send_goal_stamp` (object\|null) <br> `waited` (bool) <br> `result_timeout_sec` (number\|null) <br> `status_code` (int\|null) <br> `status` (string\|null) <br> `result` (object\|null) \| `error` (string) |136| **`ros2_cancel_action_goal`** | Cancels a specific goal or all goals for an action | `action_name` (string) <br> `goal_id_hex` (string, required if `cancel_all`=false) <br> `cancel_all` (bool, default: false) <br> `stamp_sec` (int, default: 0) <br> `stamp_nanosec` (int, default: 0) <br> `wait_timeout_sec` (number, default: 3.0) | `service` (string) <br> `return_code` (int) <br> `return_code_text` (string) <br> `goals_canceling[]` (array of {`goal_id`, `stamp`}) \| `error` (string) |137| **`ros2_action_request_result`** | Waits for the RESULT of a given goal via GetResult | `action_name` (string) <br> `action_type` (string) <br> `goal_id_hex` (string, 32-char UUID) <br> `timeout_sec` (number\|null, default: 60.0) <br> `wait_for_service_sec` (number, default: 3.0) | `service` (string) <br> `goal_id` (string) <br> `waited` (bool) <br> `result_timeout_sec` (number\|null) <br> `status_code` (int\|null) <br> `status` (string\|null) <br> `result` (object\|null) \| `error` (string) |138| **`ros2_action_subscribe_feedback`** | Subscribes to feedback messages for an action. Can filter by goal_id. Collects messages for duration or max count. | `action_name` (string) <br> `action_type` (string) <br> `goal_id_hex` (string\|null) <br> `duration_sec` (number, default: 5.0) <br> `max_messages` (int, default: 100) | `topic` (string) <br> `action_type` (string) <br> `goal_id_filter` (string\|null) <br> `duration_sec` (number) <br> `messages[]` (array of {`goal_id`, `feedback`, `recv_stamp`}) \| `error` (string) |139| **`ros2_action_subscribe_status`** | Subscribes to an action's status topic and returns collected status frames | `action_name` (string) <br> `duration_sec` (number, default: 5.0) <br> `max_messages` (int, default: 100) | `topic` (string) <br> `duration_sec` (number) <br> `frames[]` (array of {`stamp`, `statuses[]`}) \| `error` (string) |140141142# 🐞 Debugging143144Since MCP servers run over stdio, debugging can be challenging. For the best debugging145experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).146147You can launch the MCP Inspector via [ `npm` ](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:148149```bash150npx @modelcontextprotocol/inspector uv --directory /path/to/ros2_mcp run mcp_ros_2_server151```152153Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.154155## 📚 Origins and evolution156157We 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:158- Handle all ROS 2 message types (including nested fields) so agents can write and test any code159- Integrate topic pub/sub and service calls to validate behavior end‑to‑end160- Work seamlessly with GitHub Copilot in VS Code and other MCP clients161- Use a simple stdio transport to avoid network complexity162163After dogfooding it, we open‑sourced the project 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, please star the repo and share your use case!164
Full transparency — inspect the skill content before installing.