npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@jharding_npm/five-whys-mcp-server

v1.0.6

Published

A stateful MCP server for 5-Whys root cause analysis

Readme

Five Whys MCP Server

A stateful MCP server that guides AI models through the 5-Whys root cause analysis technique.

Features

  • Stateful Sessions: Maintains conversation state using session IDs
  • Automatic Cleanup: Automatically removes old sessions (30-minute timeout, max 100 sessions)
  • Simple API: Just provide a session ID to continue where you left off
  • No History Management: The server handles all history internally

Installation

yarn install

Usage

Starting a New Session

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
  }
}

Continuing a Session

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
  }
}

Completing the Analysis

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 Management

  • Session IDs: Automatically generated when starting a new session (format: session_${timestamp}_${randomString})
  • Timeout: Sessions expire after 30 minutes of inactivity
  • Capacity: Maximum 100 concurrent sessions
  • Cleanup: Old sessions are automatically removed when capacity is reached

API Schema

Input Schema

{
  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)
}

Output

The server returns:

  • content: The next question or final summary
  • state: Contains the session ID for the next call

Development

# Install dependencies
yarn install

# Run in development mode (requires tsx)
yarn dev

# Build for production
yarn build

# Run built version
yarn start

Example Workflow

  1. Start: Provide a problem → Get session ID and first question
  2. Continue: Provide session ID + answer → Get next question
  3. Repeat: Continue until you have 5 answers or want to stop
  4. Finish: Provide session ID + final answer + needsMoreWhys: false → Get summary

The server handles all the complexity of maintaining the conversation state and history.