Skip to content

pnc-diag-mcp: Zero-deserialization offline timing inspector & MCP server for .mcap / .db3 / .bag (no ROS 2 install needed)

ROS Discourse — Community updates1VictorLiu0725

VictorLiu0725 has released pnc-diag-mcp, a lightweight read-only inspection tool for analyzing ROS bag and MCAP files. The tool performs zero-deserialization timing audits to detect frame drops, timestamp regressions, and jitter spikes in topics like /scan and /odom without decoding message payloads or requiring a local ROS 2 installation. It includes built-in YAML signal mapping for Nav2 and Autoware, exposes read-only tools for AI agents via an MCP server, and provides a synthetic MCAP generator to create test scenarios for pipeline validation. The project is licensed under Apache-2.0 and available on GitHub and PyPI.

Hi everyone,

When triaging autonomous navigation (Nav2 / Autoware) and LiDAR-SLAM failures from multi-GB recordings, I kept running into two repetitive bottlenecks:

  1. Having to source a matching ROS 2 distro or load huge bags into GUI tools just to answer basic hygiene questions: did /scan drop frames, did /odom jitter spike, are there monotonic timestamp regressions, or did header.stamp silently fall back to zero?
  2. Trying to use coding agents (Claude Code / Cursor / Codex) during bag triage usually fails immediately — either the agent writes brittle one-off parsing scripts from scratch or dumps thousands of raw deserialized messages and overflows its context window.

To solve this, I open-sourced pnc-diag-mcp (Apache-2.0) — a lightweight, read-only offline bag inspection CLI and stdio MCP server that runs in plain Python (>=3.10) without a local ROS 2 installation.

What it does

  1. Zero-deserialization timing & hygiene scan (.mcap, .db3/.sqlite3, ROS 1 .bag):
    Audits every topic in raw storage order without decoding message payloads — reporting message count, duration, mean Hz, median & P95 period, P95 jitter, large gaps (heuristic_large_gap), timestamp regressions (monotonic_violations), and zero timestamps. It also runs bounded early-message sampling to check for zero header.stamp values and reports a neutral observed_header_minus_log_ms observation (without making hidden clock-sync assumptions).
  2. Declarative YAML signal mapping (nav2 & autoware built in):
    Maps dot paths and array indices (e.g., pose.covariance[0]), handles FLU/FRD and rad/deg conversions, and returns standardized PoseSample, TwistSample, ImuSample, PathSample, ControlCmdSample, LaserScanSample, and DiagnosticEvent records via bounded previews (1..50 samples).
  3. Minimal stdio MCP server + Agent Skill:
    Exposes 3 read-only tools (ping, inspect_bag_summary, sample_mapped_signals) plus a SKILL.md workflow so an AI agent inspects timing health first before touching payloads.
  4. Reproducible synthetic MCAP generator (fault_sim_kit):
    Generates 10 lightweight synthetic Nav2 .mcap scenarios (baseline + TF jump, wheel slip, scan/time desync, missing sensors, zero header stamps, etc.) so you can test the pipeline locally without sharing private robot logs.

Quick try (30 seconds, no ROS 2 needed)

pip install pnc-diag-mcp

# Generate 10 synthetic MCAP test recordings under ./data/golden/
python -m fault_sim_kit.generator

# Run zero-deserialization timing & role coverage inspection
pnc-diag inspect data/golden/case_03_time_desync
pnc-diag inspect data/golden/case_09_invalid_zero_stamps --json

# Preview bounded mapped signals
pnc-diag preview data/golden/case_01_tf_jump --topic /amcl_pose --t-start 44.5 --t-end 46.0

Or wire it into any MCP client via uvx:

{
  "mcpServers": {
    "pnc-diag": {
      "command": "env",
      "args": ["-u", "PYTHONPATH", "uvx", "pnc-diag-mcp"]
    }
  }
}

Feedback welcome

I would love feedback from folks working with real Nav2, Autoware, or custom ROS 2 stacks:

  • Are there edge cases in your .mcap or .db3 recordings (compression, custom QoS/message layouts, split bags) that trip up pnc-diag inspect?
  • What other default YAML topic maps (e.g. MoveIt, PX4/MicroXRCE, Apollo) would be most useful to bundle?

Bug reports and PRs are very welcome on GitHub: GitHub - VictorLiu0725/pnc-diag-mcp: Read-only ROS bag and MCAP inspection for PNC and LiDAR-SLAM, with timing audits, signal mapping, and an MCP Agent Skill. · GitHub

Source notes

  1. pnc-diag-mcp: Zero-deserialization offline timing inspector & MCP server for .mcap / .db3 / .bag (no ROS 2 install needed)↩
Source evidence

Reported by the source; not independently verified.

synthetic MCAP scenarios
10[2]
samples per bounded preview
50[3]
Python version requirement
≥3.1[5]
  1. , sample_mapped_signals ) plus a SKILL.md workflow so an AI agent inspects timing health first before touching payloads. Reproducible synthetic MCAP generator ( fault_sim_kit ): Generates 10 lightweight synthetic Nav2 .mcap scenarios (baseline + TF jump, wheel slip, scan/time desync, missing sensors, zero header stamps, etc.) so you can test the pipeline locally without sharing private robot logs. Quick try (30 seco
    Exact source↩
  2. mapping ( nav2 & autoware built in): Maps dot paths and array indices (e.g., pose.covariance[0] ), handles FLU / FRD and rad / deg conversions, and returns standardized PoseSample , TwistSample , ImuSample , PathSample , ControlCmdSample , LaserScanSample , and DiagnosticEvent records via bounded previews ( 1..50 samples). Minimal stdio MCP server + Agent Skill: Exposes 3 read-only tools ( ping , inspect_bag_summary
    Exact source↩
  3. nds, no ROS 2 needed) pip install pnc-diag-mcp # Generate 10 synthetic MCAP test recordings under ./data/golden/ python -m fault_sim_kit.generator # Run zero-deserialization timing & role coverage inspection pnc-diag inspect data/golden/case_03_time_desync pnc-diag inspect data/golden/case_09_invalid_zero_stamps --json # Preview bounded mapped signals pnc-diag preview data/golden/case_01_tf_jump --topic /amcl_pose --
    Exact source
  4. ing to use coding agents (Claude Code / Cursor / Codex) during bag triage usually fails immediately — either the agent writes brittle one-off parsing scripts from scratch or dumps thousands of raw deserialized messages and overflows its context window. To solve this, I open-sourced pnc-diag-mcp (Apache-2.0) — a lightweight, read-only offline bag inspection CLI and stdio MCP server that runs in plain Python ( >=3.10 )
    Exact source↩
  5. without a local ROS 2 installation . GitHub: GitHub - VictorLiu0725/pnc-diag-mcp: Read-only ROS bag and MCAP inspection for PNC and LiDAR-SLAM, with timing audits, signal mapping, and an MCP Agent Skill. · GitHub PyPI: pip install pnc-diag-mcp (or uvx pnc-diag-mcp ) What it does Zero-deserialization timing & hygiene scan ( .mcap , .db3 / .sqlite3 , ROS 1 .bag ): Audits every topic in raw storage order without decodi
    Exact source

Automatically extracted; no manual editorial approval recorded.

Article details
Signal

The author presents a new open-source Python CLI and MCP server tool designed for offline inspection of ROS bag and MCAP files without requiring a local ROS 2 installation, focusing on timing audits and signal mapping for autonomous navigation stacks.

Timezone · UTC

Article dates follow your selected timezone. Briefing editions use Hong Kong time (UTC+8).