pnc-diag-mcp: Zero-deserialization offline timing inspector & MCP server for .mcap / .db3 / .bag (no ROS 2 install needed)
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:
- Having to source a matching ROS 2 distro or load huge bags into GUI tools just to answer basic hygiene questions: did
/scandrop frames, did/odomjitter spike, are there monotonic timestamp regressions, or didheader.stampsilently fall back to zero? - 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.
- 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(oruvx 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 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 zeroheader.stampvalues and reports a neutralobserved_header_minus_log_msobservation (without making hidden clock-sync assumptions). - Declarative YAML signal mapping (
nav2&autowarebuilt in):
Maps dot paths and array indices (e.g.,pose.covariance[0]), handlesFLU/FRDandrad/degconversions, and returns standardizedPoseSample,TwistSample,ImuSample,PathSample,ControlCmdSample,LaserScanSample, andDiagnosticEventrecords via bounded previews (1..50samples). - Minimal stdio MCP server + Agent Skill:
Exposes 3 read-only tools (ping,inspect_bag_summary,sample_mapped_signals) plus aSKILL.mdworkflow so an AI agent inspects timing health first before touching payloads. - Reproducible synthetic MCAP generator (
fault_sim_kit):
Generates 10 lightweight synthetic Nav2.mcapscenarios (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
.mcapor.db3recordings (compression, custom QoS/message layouts, split bags) that trip uppnc-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