mcp-ros2-logs — let AI agents debug your ROS2 logs across nodes

mcp-ros2-logs is an open-source MCP server that merges ROS2 log files from multiple nodes into a unified timeline and exposes query tools for AI agents like Claude, GitHub Copilot, and Cursor.

The problem: ROS2 writes each node’s logs to a separate file. Debugging a cascading failure across sensor_driver -> collision_checker -> motion_planner means manually correlating timestamps across 3+ files.

What this does: Install it with pipx install mcp-ros2-logs, register it with your AI assistant, and ask natural language questions like:

  • “show me all errors with 5 messages of context around each”
  • “compare good_run vs bad_run — what changed?”
  • “detect anomalies in this run”
  • “correlate errors with bag topics — what was happening on /scan when the planner crashed?”

Features:

  • 12 MCP tools: query logs, node summaries, timelines, run comparison, anomaly detection, bag file parsing, log-to-bag topic correlation, live tailing
  • Parses ROS2 bag files (.db3/.mcap) without ROS2 installed — extracts topic metadata for correlation with log errors
  • Statistical anomaly detection: rate spikes, new error patterns, severity escalations, silence gaps, error bursts
  • Supports custom RCUTILS_CONSOLE_OUTPUT_FORMAT
  • Works with Claude Code, VS Code Copilot, Cursor, and any MCP-compatible client
  • No ROS2 installation required — it just reads files from disk

Example workflow: Point the agent at a run where a lidar USB connection dropped. It loads the logs, correlates the errors with bag topic data, and reconstructs the full causal chain: USB timeout → /scan messages stopped → collision_checker failed → motion_planner aborted. The whole analysis takes about 10 seconds.

GitHub: GitHub - spanchal001/mcp-ros2-logs: Give AI agents the ability to debug ROS2 logs across nodes — MCP server, no ROS2 install required · GitHub
PyPI: pipx install mcp-ros2-logs

Would love feedback from anyone doing multi-node debugging or working with bag files.

1 Like