Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clinical Root Cause Analysis MCP Server - AI-guided structured RCA with Fishbone (6M), 5-Why, and HFACS-MES integration for healthcare quality improvement

License

Notifications You must be signed in to change notification settings

u9401066/rootcause-mcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

RootCause MCP - Clinical Root Cause Analysis MCP Server

πŸ₯ AI-guided structured Root Cause Analysis for healthcare quality improvement

Python 3.12+ MCP License GitHub Tools

English | δΈ­ζ–‡η‰ˆ

🎯 Vision

Enable AI Agents to guide clinical staff through structured, traceable, and learnable Root Cause Analysis.

RootCause MCP supports three categories of analysis models through Domain Cartridges:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      RootCause MCP                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”             β”‚
β”‚  β”‚ PROSPECTIVE β”‚  β”‚RETROSPECTIVEβ”‚  β”‚   SYSTEMIC  β”‚             β”‚
β”‚  β”‚  Proactive  β”‚  β”‚Investigationβ”‚  β”‚  Complexity β”‚             β”‚
β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€             β”‚
β”‚  β”‚ β€’ HFMEA     β”‚  β”‚ β€’ HFACS  βœ… β”‚  β”‚ β€’ STAMP/STPAβ”‚             β”‚
β”‚  β”‚ β€’ HVA       β”‚  β”‚ β€’ 5-Whys βœ… β”‚  β”‚ β€’ FRAM      β”‚             β”‚
β”‚  β”‚ β€’ Bowtie    β”‚  β”‚ β€’ Fishboneβœ…β”‚  β”‚ β€’ AcciMap   β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚                          β–Ό                                      β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                          β”‚
β”‚              β”‚   Unified Graph API   β”‚                          β”‚
β”‚              β”‚    (19 MCP Tools)     β”‚                          β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

✨ Core Features

Retrospective Cartridge (Implemented βœ…)

Feature Description Status
🐟 Fishbone (6M) Healthcare-specialized Ishikawa diagram βœ… 4 tools
πŸ” 5-Why Analysis Deep cause exploration with Proximate/Ultimate classification βœ… 4 tools
πŸ“Š HFACS-MES Human Factors Analysis auto-suggestion (5-level, 25 categories) βœ… 6 tools
βœ… Causation Verify Bradford Hill criteria-based verification βœ… 1 tool
πŸ”— 6M-HFACS Mapping Cross-reference between taxonomies βœ… 1 tool
πŸ’Ύ Session Management Persistent analysis sessions βœ… 4 tools

Prospective Cartridge (Planned πŸ“‹)

  • HFMEA - Healthcare Failure Mode and Effect Analysis
  • HVA - Hazard Vulnerability Analysis
  • Bowtie - Threat and consequence analysis

Systemic Cartridge (Planned πŸ“‹)

  • STAMP/STPA - Control loop analysis
  • FRAM - Functional Resonance Analysis Method

πŸ”§ Available Tools

HFACS Tools (6)

Tool Description
rc_suggest_hfacs Auto-suggest HFACS codes from cause description
rc_confirm_classification Confirm or override HFACS classification
rc_get_hfacs_framework Get full HFACS-MES framework structure
rc_list_learned_rules List learned classification rules
rc_reload_rules Hot-reload YAML rules
rc_get_6m_hfacs_mapping Get 6M-HFACS cross-reference table

Session Tools (4)

Tool Description
rc_start_session Create new RCA session
rc_get_session Get session details
rc_list_sessions List all sessions
rc_archive_session Archive completed session

Fishbone Tools (4)

Tool Description
rc_init_fishbone Initialize fishbone diagram
rc_add_cause Add cause to 6M category
rc_get_fishbone Get fishbone structure
rc_export_fishbone Export as Mermaid/Markdown/JSON

Why Tree Tools (4)

Tool Description
rc_ask_why Progressive 5-Why questioning
rc_get_why_tree Get Why tree structure
rc_mark_root_cause Mark node as root cause
rc_export_why_tree Export as Mermaid/Markdown/JSON

Verification Tools (1)

Tool Description
rc_verify_causation Verify causation with 4-criteria test

πŸš€ Quick Start

# Install with uv (recommended)
uv pip install -e .

# Or development mode
uv pip install -e ".[dev]"

# Run MCP Server
python -m rootcause_mcp.interface.server

VS Code Integration

Add to your .vscode/mcp.json:

{
  "servers": {
    "rootcause-mcp": {
      "type": "stdio",
      "command": "uv",
      "args": ["run", "python", "-m", "rootcause_mcp.interface.server"],
      "cwd": "${workspaceFolder}"
    }
  }
}

πŸ“ Project Structure

rootcause-mcp/
β”œβ”€β”€ src/rootcause_mcp/
β”‚   β”œβ”€β”€ domain/           # Domain Layer (DDD)
β”‚   β”‚   β”œβ”€β”€ entities/     # Session, Cause, Fishbone, WhyNode
β”‚   β”‚   β”œβ”€β”€ value_objects/# HFACSCode, Scores, Identifiers
β”‚   β”‚   β”œβ”€β”€ repositories/ # Repository interfaces
β”‚   β”‚   └── services/     # HFACSSuggester, CausationValidator
β”‚   β”œβ”€β”€ application/      # Application Layer
β”‚   β”‚   β”œβ”€β”€ session_progress_tracker.py
β”‚   β”‚   └── guided_response_builder.py
β”‚   β”œβ”€β”€ infrastructure/   # Infrastructure Layer
β”‚   β”‚   └── persistence/  # SQLite + SQLModel
β”‚   └── interface/        # Interface Layer
β”‚       β”œβ”€β”€ tools/        # MCP Tool definitions
β”‚       β”œβ”€β”€ handlers/     # Tool handlers
β”‚       └── server.py     # MCP Server entry
β”œβ”€β”€ config/hfacs/         # YAML configurations
β”‚   β”œβ”€β”€ hfacs_mes.yaml    # HFACS-MES framework
β”‚   β”œβ”€β”€ fishbone_6m.yaml  # Healthcare 6M categories
β”‚   └── keyword_rules.yaml# Classification rules
β”œβ”€β”€ tests/                # Test suites
β”œβ”€β”€ docs/                 # Documentation
β”‚   └── spec_v2.md        # Full specification v2.5.0
└── memory-bank/          # Project memory (for AI)

πŸ”— Related MCPs

MCP Purpose Integration
asset-aware-mcp Data decomposition & table refactoring Pre-processing
HHRAG MCP Knowledge graph retrieval Context enrichment
CGU MCP Creative divergent thinking Cause brainstorming

πŸ“š Documentation

πŸ”§ Development

# Run tests
pytest tests/ -v

# Code linting
ruff check src tests
mypy src --strict

# Security scan
bandit -r src

# Dead code detection
vulture src

🀝 Contributing

Contributions welcome! Please see CONTRIBUTING.md.

πŸ“„ License

Apache 2.0 License - See LICENSE


Made with ❀️ for Healthcare Quality Improvement

About

Clinical Root Cause Analysis MCP Server - AI-guided structured RCA with Fishbone (6M), 5-Why, and HFACS-MES integration for healthcare quality improvement

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages