pnc-diag-mcp (Open-Source Thin Edition)
A read-only, open-source foundation for inspecting offline Planning and Control (PNC) and LiDAR-SLAM recordings. It provides a multi-format bag reader, a timing health check that does not deserialize message payloads, and an Agent Skill interface. It supports .mcap, .db3 / .sqlite3, and ROS 1 .bag files without a local ROS 2 installation.
Features and open-source scope
This edition provides standardized recording access, timing checks, and reproducible synthetic examples for Agent integration.
Included and working
- Offline multi-format discovery and timing scans without payload deserialization (
src/pnc_diag/readers/,src/pnc_diag/inspector.py)- Detects
.mcap,.db3/.sqlite3, ROS 1.bag, and ROS 2 bag directories; validates relative paths inmetadata.yaml. - Audits each topic in its original storage order: message count, duration, mean rate, median and P95 period, P95 jitter, gaps (
heuristic_large_gap), timestamp regressions (monotonic_violations), and zero timestamps (zero_timestamps). - Uses bounded early-message sampling to check for
header.stamp, count zero header stamps, and report the neutralobserved_header_minus_log_msobservation. It does not assume cross-topic clock synchronization.
- Detects
- Standard signal models and declarative YAML mapping (
src/pnc_diag/models/,configs/)- Includes standard mappings for Nav2 (configs/topic_map.nav2.yaml) and Autoware Universe (configs/topic_map.autoware.yaml).
- Extracts dot paths and array elements (for example,
pose.covariance[0]), convertsFLU/FRDframes andrad/degunits, and returnsPoseSample,TwistSample,ImuSample,PathSample,ControlCmdSample,LaserScanSample, andDiagnosticEventvalues.
- Small CLI and stdio MCP server (
src/pnc_diag/cli.py,src/pnc_diag/mcp_server.py)- CLI commands:
pnc-diag inspectandpnc-diag preview. - The
pnc-diag-mcpstdio server exposes three tools:ping,inspect_bag_summary, andsample_mapped_signals. - Includes the orchestration SKILL.md and fault pattern reference.
- CLI commands:
- Reproducible synthetic examples (
fault_sim_kit/)- Generates one baseline recording and nine synthetic fault, missing-data, or zero-timestamp examples under
data/golden/for integration and regression exercises.
- Generates one baseline recording and nine synthetic fault, missing-data, or zero-timestamp examples under
Open-Source Thin vs. PNC-Diag MCP Pro
| Capability | Open-Source Thin (Apache-2.0, Free) | PNC-Diag MCP Pro ($79 one-time) |
|---|---|---|
Multi-format offline reader (.mcap, .db3/.sqlite3, .bag) |
✅ | ✅ (+ schema v1–v4+ SQLite3 recovery without metadata.yaml) |
| Zero-deserialization timing scan & header-time audit | ✅ (inspect_bag_summary) |
✅ (inspect_bag_schema + calibrated clock checks) |
Bounded signal mapping (nav2 / autoware / custom YAML) |
✅ (sample_mapped_signals) |
✅ |
| Full-bag Top-K streaming anomaly anchoring | — | ✅ (detect_anomaly_windows) |
| Localization jump vs. wheel-odometry slip arbitration (IMU) | — | ✅ (analyze_localization_health) |
| Planning trajectory jumps, curvature & solver timeout checks | — | ✅ (analyze_planning_health) |
| Control CTE/HE, cross-correlation actuation lag & FFT oscillation | — | ✅ (analyze_control_health) |
| Cross-module First-Domino causal adjudication + 5-panel PNG plot | — | ✅ (correlate_root_cause_and_plot) |
CI regression KPI gates (--assert-healthy, --assert-kpi) |
— | ✅ (pnc-diag-pro diagnose) |
| Offline field operation (no ROS 2 runtime, no cloud upload) | ✅ | ✅ (up to 3 machines, 7-day offline field grace) |
Seamless upgrade: pnc-diag-mcp automatically discovers pnc-diag-pro when installed in the same Python environment—no MCP client reconfiguration required:
# 1. Install the compiled Pro wheel (Linux x86_64, Python 3.10–3.13) from Gumroad
uv pip install ./pnc_diag_pro-0.1.0-cp313-cp313-linux_x86_64.whl
# 2. Activate once online (writes a 7-day offline cache for air-gapped field testing)
pnc-diag-pro activate <YOUR-GUMROAD-LICENSE-KEY>
👉 Get PNC-Diag MCP Pro: https://gumroadalbert.gumroad.com/l/pnc-diag-pro
Requirements and installation
- Python:
>=3.10(verified in clean Python3.10.12and3.13.17environments) - Package manager:
uvis recommended;uv.lockis included. - ROS 2 runtime: Not required.
Notes
- The default Nav2 and Autoware topic maps are bundled in the wheel under
pnc_diag._configs. The default Nav2 map loads without--map-configwhether you useuv sync,pip install -e ., or install the wheel from another directory. Use--map-config autowarefor the bundled Autoware map, or pass a path to a custom YAML map.- In a source checkout,
python -m fault_sim_kit.generatorwrites to<repo>/data/golden/by default. After a non-editable install, it writes to./data/golden/in the current working directory. Use--out <directory>to choose another location.- If your shell has sourced ROS 2 (for example, Humble), prefix commands with
env -u PYTHONPATHto keep system Python paths out of the virtual environment.
# Option 1: Install from PyPI (recommended)
env -u PYTHONPATH pip install pnc-diag-mcp
pnc-diag --version
# Or run the stdio MCP server directly with uvx (no repo clone required)
env -u PYTHONPATH uvx pnc-diag-mcp
# Option 2: Run from a local source checkout
env -u PYTHONPATH uv sync
env -u PYTHONPATH uv run pnc-diag --version
Synthetic examples and tests
The distribution does not contain the approximately 47 MB of generated .mcap files. Run the tests or generate the examples locally:
# Lint and run all unit tests; pre-existing data/golden/ files are not required.
env -u PYTHONPATH uv run ruff check .
env -u PYTHONPATH uv run pytest
# Generate all 10 synthetic MCAP examples under data/golden/.
env -u PYTHONPATH uv run python -m fault_sim_kit.generator
Try it and share feedback
Start with the generated synthetic examples, then try pnc-diag inspect <bag_path> or pnc-diag preview <bag_path> on a recording you are authorized to analyze. This edition provides inspection and signal sampling, not a definitive root-cause diagnosis.
- Reproducible bugs: Open a Bug report. Include your Python version, operating system, install method, recording format, command, expected and actual behavior, and sanitized output.
- Usage questions, workflow feedback, and feature ideas: Start a Discussion.
Do not upload raw customer recordings, proprietary bags, credentials, or identifying logs to public Issues or Discussions. Share a synthetic or anonymized minimal reproduction when possible.
CLI usage
This edition provides the inspect and preview commands:
# Inspect timing, topic-role coverage, and neutral header-time observations.
env -u PYTHONPATH uv run pnc-diag inspect data/golden/case_01_tf_jump
# Inspect missing-sensor and zero-timestamp counterexamples.
env -u PYTHONPATH uv run pnc-diag inspect data/golden/case_08_missing_imu_and_scan
env -u PYTHONPATH uv run pnc-diag inspect data/golden/case_09_invalid_zero_stamps --json
# Preview bounded samples of mapped standard signals.
env -u PYTHONPATH uv run pnc-diag preview data/golden/nav_baseline --role odom_pose --limit 3
env -u PYTHONPATH uv run pnc-diag preview data/golden/case_01_tf_jump --topic /amcl_pose --t-start 44.5 --t-end 46.0 --json
# Inspect a recording with the bundled Autoware preset or a custom mapping file.
env -u PYTHONPATH uv run pnc-diag inspect /path/to/autoware_bag --map-config autoware
env -u PYTHONPATH uv run pnc-diag inspect /path/to/autoware_bag --map-config configs/topic_map.autoware.yaml
MCP server and Agent Skill
pnc-diag-mcp stdio tools
| Tool | Arguments | Returns |
|---|---|---|
ping |
None | Service status, version, and edition (open-source-thin) |
inspect_bag_summary |
bag_path, map_config |
Storage format, duration, available and missing roles, clock_comparability, warnings, and per-topic timing statistics |
sample_mapped_signals |
bag_path, topic, role, map_config, limit, t_start_s, t_end_s |
Bounded standardized signal samples (limit: 1..50) |
Example MCP client configuration
Using uvx (from PyPI):
{
"mcpServers": {
"pnc-diag": {
"command": "env",
"args": [
"-u",
"PYTHONPATH",
"uvx",
"pnc-diag-mcp"
]
}
}
}
Or from a local source checkout:
{
"mcpServers": {
"pnc-diag": {
"command": "env",
"args": [
"-u",
"PYTHONPATH",
"uv",
"--directory",
"<PATH_TO_REPO>",
"run",
"pnc-diag-mcp"
]
}
}
}
The Agent Skill is in .agents/skills/pnc-slam-diag/SKILL.md, with a fault pattern reference.
Data and diagnostic limitations
- Inspection foundation only: This edition does not calculate quantitative localization, planning, or control anomaly metrics, or make a definitive multi-sensor root-cause determination. Review the evidence manually or use specialized analyzers for diagnosis.
- No clock synchronization inference:
observed_header_minus_log_msrecords the difference between a message header timestamp and its recorded log timestamp. By itself, it cannot distinguish sensor clock drift from queueing or transport delay. This edition reportsclock_comparability="unverified"by default. - Synthetic examples are exercises, not a blind benchmark:
fault_sim_kitproduces simplified closed-loop kinematic data, not representative sensor noise, vehicle dynamics, or real-vehicle acceptance data. The repository does not commitgolden_truth.jsonor generated bag files, but it does publish the definitions of all 10 scenarios and the code that generates their ground truth. Use a separate, unpublished dataset for blind tests or benchmark evaluations. - Read-only offline operation: The tools do not send vehicle commands, change parameters, or operate ROS nodes.
License and third-party notices
- License: This repository is released under the Apache License 2.0; see NOTICE. Subject to the license terms, others may use, modify, and redistribute the published code commercially. The private physical diagnostic core, calibrated rules, and enterprise gates are outside this repository.
- Dependencies and provenance: See THIRD_PARTY_NOTICES.md for dependency licenses and acknowledgments of upstream code and design references. The documented runtime and development dependencies use permissive MIT, BSD, or Apache-2.0 licenses; no GPL code is included in this repository.
Metadata
Release files for pnc-diag-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pnc_diag_mcp-0.1.0.tar.gz | 190.6 kB | Without provenance | Details for pnc_diag_mcp-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pnc_diag_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pnc_diag_mcp-0.1.0-py3-none-any.whl |
Total release size: 236.2 kB
Release files / pnc_diag_mcp-0.1.0.tar.gz
| Download URL | pnc_diag_mcp-0.1.0.tar.gz |
|---|---|
| Size | 190.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18a1bce671847592b11c014226bfe86f579c18057e1ea86f4ff6581d0c3ea9bf
|
|
BLAKE2b-256 checksum How to use checksums |
2a08b830cdaba919f328eb5692ee059e49123f1745685765007b4b1102c1181c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / pnc_diag_mcp-0.1.0-py3-none-any.whl
| Download URL | pnc_diag_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 45.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8022d4198aab0ca06092c25e716d5614307e75e47af4c324633a9f256ec4f5b0
|
|
BLAKE2b-256 checksum How to use checksums |
b4ff07d8b1317c47b726ba2aae196b3a4ecde5cfb9e573acba06917d4c153d53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for pnc-diag-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.