rootcause-mcp

rootcause-mcp

Enables AI agents to perform structured root cause analysis from clinical incidents and construct learner-ready lesson plans for medical education.

Category
Visit Server

README

RootCause MCP - Clinical Causality & Teaching Design MCP Server

πŸ₯ AI-guided causal analysis, feedback-loop modeling, and teaching-case construction for healthcare quality improvement

Python 3.12+ MCP License GitHub Tools

English | δΈ­ζ–‡η‰ˆ

🎯 Vision

Enable AI Agents to move in both directions of causality:

  • from clinical incidents β†’ structured, traceable root cause analysis
  • from root causes β†’ learner-ready lesson plans for medical education

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   β”‚                          β”‚
β”‚              β”‚    (21 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
πŸ” Bidirectional Causality Cross-links, escalation loops, and feedback cycle modeling βœ… 1 tool
πŸŽ“ Teaching Case Builder Convert RCA chains into medical student lesson plans βœ… 1 tool
πŸ“Š 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 (6)

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
rc_add_causal_link Add feedback loops and bidirectional causal links
rc_build_teaching_case Build a teaching-ready lesson plan from an RCA chain

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

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured