https://github.com/nico0302/ros2mcp
Expose arbitrary ROS 2 services and topics as MCP tools and list topics as resources.
https://github.com/nico0302/ros2mcp
llm mcp mcp-server pixi ros ros2
Last synced: about 2 months ago
JSON representation
Expose arbitrary ROS 2 services and topics as MCP tools and list topics as resources.
- Host: GitHub
- URL: https://github.com/nico0302/ros2mcp
- Owner: Nico0302
- License: apache-2.0
- Created: 2025-07-05T12:35:10.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-07-27T10:12:45.000Z (2 months ago)
- Last Synced: 2025-07-27T12:11:28.283Z (2 months ago)
- Topics: llm, mcp, mcp-server, pixi, ros, ros2
- Language: Python
- Homepage:
- Size: 1.77 MB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

Expose arbitrary [ROS 2](https://www.ros.org/) services and topics as [MCP](https://modelcontextprotocol.io/) tools and list topics as resources.

The `mcp_server` node can translate any ROS topic and service into a MCP resource or tool (including source comments as parameter descriptions).
[](https://www.youtube.com/watch?v=yN2vLpf2-HE)
# Demo Setup
The demo can be run on Linux, macOS, and Windows using [Pixi](https://pixi.sh/dev/installation/).
1. Clone the repository.
```bash
git clone https://github.com/nico0302/ros2mcp.git
```2. Start Gazebo and Rviz2 and the demo node:
```bash
pixi run demo-tb4
```
This might take a while on the first run as it downloads the necessary assets.3. After Gazebo and Rviz2 are running, select the `2D Pose Estimate` tool in Rviz2 to set the robot's initial position by clicking in the center of the map and dragging to right:
4. Connect a MCP client to the demo server on `http://localhost:8080`
This project includes a simple MCP client that can be run with:
```bash
# make sure to set your OPENAI_API_KEY environment variable
export OPENAI_API_KEY=your_openai_api_key
pixi run demo-client
```