An MCP server that implements the "Five Whys" root cause finding technique
https://github.com/jhstatewide/mcp-five-whys.git
A stateful MCP server that guides AI models through the 5-Whys root cause analysis technique.
yarn install
To start a new 5-Whys analysis:
{
"name": "five_whys",
"arguments": {
"problem": "Customer complaints are increasing",
"needsMoreWhys": true
}
}
The server will return a session ID and the first "why" question:
{
"content": [{"type": "text", "text": "Why does the problem \"Customer complaints are increasing\" occur?"}],
"state": {
"sessionId": "session_1703123456789_abc123def",
"needsMoreWhys": true
}
}
To continue with the next "why" question, use the session ID:
{
"name": "five_whys",
"arguments": {
"sessionId": "session_1703123456789_abc123def",
"currentReason": "Our response time is too slow",
"needsMoreWhys": true
}
}
When you want to finish the analysis, set needsMoreWhys to false:
{
"name": "five_whys",
"arguments": {
"sessionId": "session_1703123456789_abc123def",
"currentReason": "We don't have enough staff",
"needsMoreWhys": false
}
}
The server will return a complete summary with the root cause.
session_${timestamp}_${randomString}){
sessionId?: string; // Optional: Session ID to continue existing session
problem?: string; // Required for new sessions: The problem to analyze
currentReason?: string; // Optional: Answer to the current "why" question
needsMoreWhys?: boolean; // Optional: Whether to continue asking "why" (defaults to true if not provided)
}
The server returns:
content: The next question or final summarystate: Contains the session ID for the next call# Install dependencies
yarn install
# Run in development mode (requires tsx)
yarn dev
# Build for production
yarn build
# Run built version
yarn start
needsMoreWhys: false โ Get summary