Get the FREE Ultimate OpenClaw Setup Guide →

ros2mcp

Expose arbitrary ROS 2 services and topics as MCP tools and list topics as resources.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ngres-ros2mcp node path/to/server.js

How to use

ros2mcp exposes arbitrary ROS 2 topics and services as MCP resources and tools. Once running, you can connect any MCP client to the server (the README demo points to http://localhost:8080) to browse translated ROS 2 topics and services, and interact with them through MCP-compatible tools. The server also preserves source comments from ROS 2 interfaces as parameter descriptions, helping you understand what each parameter or topic represents. In addition to translating topics and services, you can use the bundled demo client to experiment with creating requests and exploring the MCP-enabled ROS 2 graph. For the demo workflow, start Gazebo and RViz2, run the demo-tb4 node via Pixi, and then connect the MCP client to the server to view and manipulate the ROS 2 resources exposed by ros2mcp. If you want to experiment with the client-side, you can run the included demo-client after setting your OpenAI API key, as shown in the README.

How to install

Prerequisites:

  • Node.js (LTS version recommended)
  • ROS 2 installed and sourced in your shell if you intend to connect to real ROS 2 systems
  • Git

Install and run the MCP server:

  1. Clone the repository: git clone https://github.com/nico0302/ros2mcp.git
  2. Navigate into the project directory: cd ros2mcp
  3. Install dependencies (Node.js package manager required): npm install
  4. Run the MCP server (adjust the path to your server entry if needed): node path/to/server.js

If you prefer using a package manager invocation, you could also install and run via npx or a global install if the package provides it, depending on how the repository is published. Ensure your environment variables (like ROS 2 sourcing and any required keys for clients) are set before starting the server.

Additional notes

Tips and notes:

  • The server port defaults to 8080 unless configured otherwise; ensure your MCP client can reach http://localhost:8080.
  • The demo client requires OPENAI_API_KEY; export it in your shell before launching the demo-client: export OPENAI_API_KEY=your_openai_api_key
  • If you run Gazebo/RViz2 demos, make sure your ROS 2 environment is properly sourced and network access is allowed for the ROS 2 nodes.
  • Environment variables and config options may be needed to customize which ROS 2 topics/services are exposed; check for any config file or command-line flags in your deployment to limit or extend resources.
  • When translating ROS 2 interfaces, the server can include source comments as parameter descriptions to aid discoverability in MCP tools.

Related MCP Servers

Sponsor this space

Reach thousands of developers