rootcause-mcp
Enables AI agents to perform structured root cause analysis from clinical incidents and construct learner-ready lesson plans for medical education.
README
RootCause MCP - Clinical Causality & Teaching Design MCP Server
π₯ AI-guided causal analysis, feedback-loop modeling, and teaching-case construction for healthcare quality improvement
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
- Full Specification - v2.5.0 (3700+ lines)
- Architecture - DDD layers
- Roadmap - Cartridge expansion plan
- Literature Review - HFACS-MES research
π§ 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
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.