Skip to main content
Glama

dicomguard

Zero-dependency binary DICOM Part 10 inspector, NEMA PS3.15 de-identifier, burned-in pixel PHI risk detector & MCP server — 100% offline.

CI Live Playground Zero Dependencies Node >= 20 License: MIT

npx dicomguard scan ./dicom-studies --fail-on high

Try the 100% Offline Browser Playground — drag and drop real .dcm studies or sample CT / high-risk Ultrasound fixtures directly in your browser tab with zero uploads, inspect (gggg,eeee) elements, verify PixelData SHA-256 unchanged, and download .safe.dcm + signed uid-vault.json.


Why dicomguard?

Radiology AI teams and medical-imaging engineers preparing .dcm datasets hit four recurring failure modes:

  1. Corrupted Binary Headers & Group 0002 Lengths — Hand-rolled scripts that replace patient strings in binary DICOM break odd-length VR padding or leave (0002,0000) FileMetaInformationGroupLength stale so PACS/VNA viewers reject the file. dicomguard re-serializes Part 10 cleanly with valid even padding and recomputed (0002,0000) + synchronized (0002,0003) / (0008,0018) UIDs.

  2. Broken Multi-Slice Study/Series Referential Integrity — Randomizing StudyInstanceUID / SeriesInstanceUID per slice breaks 3D CT/MRI reconstruction. dicomguard uses deterministic HMAC-SHA256 2.25.<uint128> OID derivation across slices and exports an HMAC-signed UidVault.

  3. Hidden Odd-Group Private Tags — Vendor private blocks ((0009,xxxx), (0019,xxxx)) often store plaintext clinician notes or station IDs. dicomguard strips odd-group private tags by default (--keep-private opt-out).

  4. Silent Burned-In Pixel PHI — Ultrasound (US), Secondary Capture (SC), and screen-save series often rasterize patient banners into pixel buffers. dicomguard flags high-risk modalities, ImageType (SECONDARY/SCREEN), (0028,0301) BurnedInAnnotation, (0018,6011), and (60xx,3000) OverlayData.


Related MCP server: verdex

Quick Start

# Generate synthetic CT or high-risk Ultrasound DICOM Part 10 fixtures
npx dicomguard sample --preset ct-chest -o sample-ct.dcm
npx dicomguard sample --preset ultrasound-burned -o sample-us.dcm

# Inspect binary headers, private tags, burned-in risk, and PixelData SHA-256
npx dicomguard inspect sample-ct.dcm

# Audit a directory (outputs: text, --json, --sarif, --markdown, --junit, --badge)
npx dicomguard scan ./studies --sarif -o dicomguard.sarif

# De-identify per NEMA PS3.15 (preserves 7FE0,0010 PixelData byte-for-byte)
npx dicomguard clean sample-ct.dcm --secret "$UID_KEY" --vault-out uid-vault.json -o sample-ct.safe.dcm

# Shift clinical/birth dates deterministically while preserving intervals
npx dicomguard clean sample-ct.dcm --profile retain-dates-shifted --secret "$UID_KEY" -o sample-ct.shifted.dcm

# Install git pre-commit hook blocking staged .dcm files with unredacted PHI
npx dicomguard guard install

MCP Server (Claude Desktop, Cursor, VS Code, Codex, Gemini CLI)

Expose all 5 offline DICOM tools (dicomguard_inspect, dicomguard_scan, dicomguard_deidentify_base64, dicomguard_burned_in_risk, dicomguard_list_tags) via stdio JSON-RPC 2.0:

{
  "mcpServers": {
    "dicomguard": {
      "command": "npx",
      "args": ["-y", "dicomguard", "mcp"]
    }
  }
}

Or manage/install alongside your existing stack via mcphub and mcpman.


GitHub Action (@v1)

- name: DICOM Confidentiality Gate
  uses: tranhoangtu-it/dicomguard@v1
  with:
    target: "./dicom-fixtures"
    profile: "basic"
    fail-on: "high"
    sarif-file: "dicomguard.sarif"

TypeScript / JavaScript SDK (Node & Browser)

import {
  buildSampleDicomBytes,
  deidentifyDicom,
  inspectDicom,
  scanDicom,
  verifyUidVault,
} from "dicomguard";

const raw = buildSampleDicomBytes("ct-chest");
const before = scanDicom(raw, { file: "ct.dcm" });
const result = deidentifyDicom(raw, { profile: "basic", secret: "pacs-key" });

console.log(result.pixelDataIntact); // true (SHA-256 identical)
console.log(scanDicom(result.bytes).score); // 100
console.log(verifyUidVault(result.vault, "pacs-key")); // true

  • phiguard — Zero-dependency offline PHI de-identification, HIPAA / VN QĐ 4750 / JP APPI guardrails & MCP server for HL7 FHIR, HL7v2, and clinical notes (Live Playground).

  • clawleak — Find, losslessly redact, and block plaintext API keys leaked into AI coding agents (0 deps, 100% offline).

  • mcphub — Curated hub & CLI for verified MCP servers.

  • mcpman — Universal package manager & security auditor for MCP servers.


License

MIT © 2026 Tran Hoang Tu

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Exposes read-only local analysis tools for source auditing, web traffic review, binary reverse engineering, exploit scaffolding, OSINT, and reporting via JSON-RPC over stdio, enabling LLMs to orchestrate evidence-based security workflows without executing targets or sending network requests.
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Serves five offline diagnostic tools over stdio that let an agent scan a repository for AI context noise, trace why a CLI command is missing, measure whether a build cache actually pays off, and rank flaky or always-failing tests from JUnit runs. Each tool returns the same JSON as the CLI, and an optional sandbox root keeps all path access confined to one repo.
      450 npm
      Apache 2.0
    • F
      license
      B
      quality
      B
      maintenance
      Exposes five typed, provenance-gated physics tools over JSON-RPC 2.0 stdio so frontier agents can compute 3D deformable biophysical dose accumulation, DIR-uncertainty envelopes, and inverse remaining-dose ceilings for multi-course re-irradiation. Every output is audited by a critic-verifier gate with a hard abstention check, returning safety-flagged dossiers and provenance ledgers instead of unsupported clinical numbers.
      7
      1
      -