Sandbox
@nikkoxgonzales/crash-mcp

MCP server for structured reasoning steps

CRASH is an MCP server that helps an agent break complex work into explicit steps instead of one long chain of thought. It adds confidence scores, revision support, branching, dependency checks, and session handling so the reasoning stays organized and reviewable.

72 stars6 forksTypeScriptUpdated 9mo ago
Who it's for

Builders who want their MCP agent to work through complex tasks with visible steps and cleaner decision trails.

What it delivers

You can guide an agent through hard problems with trackable reasoning instead of re-explaining context each time.

What it does

Structured reasoning steps

Tracks step number, purpose, context, thought, outcome, next action, and rationale for each reasoning turn.

Confidence tracking

Lets a step carry a 0-1 confidence score and warns when confidence is low.

Revision support

Marks earlier steps as revised and records why a correction was needed.

Branching

Lets an agent split into alternate solution paths with branch IDs, names, and depth limits.

Dependency validation

Checks that a step declares the steps it depends on before continuing.

Session management

Groups related reasoning chains and can clean them up after a timeout.

Multiple output formats

Outputs the reasoning flow in console, JSON, or Markdown form.

Flexible validation

Supports strict mode for rigid input rules or flexible mode for more natural language.

How to get it

  1. 1Run
    npm install crash-mcp
  2. 2Or use directly with npx
    npx crash-mcp

README

CRASH.jpg


CRASH

Cascaded Reasoning with Adaptive Step Handling

An MCP (Model Context Protocol) server for structured, iterative reasoning. CRASH helps AI assistants break down complex problems into trackable steps with confidence tracking, revision support, and branching for exploring alternatives.

Inspired by MCP Sequential Thinking Server


Why CRASH?

I created this because typing "use sequential_thinking" was cumbersome. Now I can simply say "use crash" instead.

CRASH is more token-efficient than sequential thinking - it doesn't include code in thoughts and has streamlined prompting. It's my go-to solution when an agent can't solve an issue in one shot or when plan mode falls short.

Claude Code's Assessment

CRASH helped significantly for this specific task:

Where CRASH helped:
- Systematic analysis: Forced me to break down the issue methodically
- Solution exploration: Explored multiple approaches before settling on the best one
- Planning validation: Each step built on the previous one logically

The key difference:
CRASH forced me to be more thorough in the analysis phase. Without it, I might have
rushed to implement the first solution rather than exploring cleaner approaches.

Verdict: CRASH adds value for complex problems requiring systematic analysis of
multiple solution paths. For simpler tasks, internal planning is sufficient and faster.

Features

  • Structured reasoning steps - Track thought process, outcomes, and next actions
  • Confidence tracking - Express uncertainty with 0-1 scores, get warnings on low confidence
  • Revision mechanism - Correct previous steps, with original steps marked as revised
  • Branching support - Explore multiple solution paths with depth limits
  • Dependency validation - Declare and validate step dependencies
  • Session management - Group related reasoning chains with automatic timeout cleanup
  • Multiple output formats - Console (colored), JSON, or Markdown
  • Flexible validation - Strict mode for rigid rules, flexible mode for natural language

Installation

npm install crash-mcp

Or use directly with npx:

npx crash-mcp

Quick Setup

Most MCP clients use this JSON configuration:

{
  "mcpServers": {
    "crash": {
      "command": "npx",
      "args": ["-y", "crash-mcp"]
    }
  }
}

Configuration by Client

ClientSetup Method
Claude Codeclaude mcp add crash -- npx -y crash-mcp
CursorAdd to ~/.cursor/mcp.json
VS CodeAdd to settings JSON under mcp.servers
Claude DesktopAdd to claude_desktop_config.json
WindsurfAdd to MCP config file
JetBrainsSettings > Tools > AI Assistant > MCP
OthersUse standard MCP JSON config above
Windows Users

Use the cmd wrapper:

{
  "mcpServers": {
    "crash": {
      "command": "cmd",
      "args": ["/c", "npx", "-y", "crash-mcp"]
    }
  }
}
With Environment Variables
{
  "mcpServers": {
    "crash": {
      "command": "npx",
      "args": ["-y", "crash-mcp"],
      "env": {
        "CRASH_STRICT_MODE": "false",
        "MAX_HISTORY_SIZE": "100",
        "CRASH_OUTPUT_FORMAT": "console",
        "CRASH_SESSION_TIMEOUT": "60",
        "CRASH_MAX_BRANCH_DEPTH": "5"
      }
    }
  }
}
Using Docker
FROM node:18-alpine
WORKDIR /app
RUN npm install -g crash-mcp
CMD ["crash-mcp"]
{
  "mcpServers": {
    "crash": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "crash-mcp"]
    }
  }
}
Alternative Runtimes

Bun:

{ "command": "bunx", "args": ["-y", "crash-mcp"] }

Deno:

{
  "command": "deno",
  "args": ["run", "--allow-env", "--allow-net", "npm:crash-mcp"]
}

Configuration

VariableDefaultDescription
CRASH_STRICT_MODEfalseEnable strict validation (requires specific prefixes)
MAX_HISTORY_SIZE100Maximum steps to retain in history
CRASH_OUTPUT_FORMATconsoleOutput format: console, json, markdown
CRASH_NO_COLORfalseDisable colored console output
CRASH_SESSION_TIMEOUT60Session timeout in minutes
CRASH_MAX_BRANCH_DEPTH5Maximum branch nesting depth
CRASH_ENABLE_SESSIONSfalseEnable session management

Usage

Required Parameters

ParameterTypeDescription
step_numberintegerSequential step number (starts at 1)
estimated_totalintegerEstimated total steps (adjustable)
purposestringStep category: analysis, action, validation, exploration, hypothesis, correction, planning, or custom
contextstringWhat's already known to avoid redundancy
thoughtstringCurrent reasoning process
outcomestringExpected or actual result
next_actionstring/objectNext action (simple string or structured with tool details)
rationalestringWhy this next action was chosen

Optional Parameters

ParameterTypeDescription
is_final_stepbooleanMark as final step to complete reasoning
confidencenumberConfidence level 0-1 (warnings below 0.5)
uncertainty_notesstringDescribe doubts or assumptions
revises_stepintegerStep number being corrected
revision_reasonstringWhy revision is needed
branch_fromintegerStep to branch from
branch_idstringUnique branch identifier
branch_namestringHuman-readable branch name
dependenciesinteger[]Step numbers this depends on
session_idstringGroup related reasoning chains
tools_usedstring[]Tools used in this step
external_contextobjectExternal data relevant to step

Examples

Basic Usage

{
  "step_number": 1,
  "estimated_total": 3,
  "purpose": "analysis",
  "context": "User requested optimization of database queries",
  "thought": "I need to first understand the current query patterns before proposing changes",
  "outcome": "Identified slow queries for optimization",
  "next_action": "analyze query execution plans",
  "rationale": "Understanding execution plans will reveal bottlenecks"
}

With Confidence and Final Step

{
  "step_number": 3,
  "estimated_total": 3,
  "purpose": "summary",
  "context": "Analyzed queries and tested index optimizations",
  "thought": "The index on user_id reduced query time from 2s to 50ms",
  "outcome": "Performance issue resolved with new index",
  "next_action": "document the change",
  "rationale": "Team should know about the optimization",
  "confidence": 0.9,
  "is_final_step": true
}

Revision Example

{
  "step_number": 4,
  "estimated_total": 5,
  "purpose": "correction",
  "context": "Previous analysis missed a critical join condition",
  "thought": "The join was causing a cartesian product, not the index",
  "outcome": "Corrected root cause identification",
  "next_action": "fix the join condition",
  "rationale": "This is the actual performance issue",
  "revises_step": 2,
  "revision_reason": "Overlooked critical join in initial analysis"
}

Branching Example

{
  "step_number": 3,
  "estimated_total": 6,
  "purpose": "exploration",
  "context": "Two optimization approaches identified",
  "thought": "Exploring the indexing approach first as it's lower risk",
  "outcome": "Branch created for index optimization testing",
  "next_action": "test index performance",
  "rationale": "This approach has lower risk than query rewrite",
  "branch_from": 2,
  "branch_id": "index-optimization",
  "branch_name": "Index-based optimization"
}

When to Use CRASH

Good fit:

  • Complex multi-step problem solving
  • Code analysis and optimization
  • System design with multiple considerations
  • Debugging requiring systematic investigation
  • Exploring multiple solution paths
  • Tasks where you need to track confidence

Not needed:

  • Simple, single-step tasks
  • Pure information retrieval
  • Deterministic procedures with no uncertainty

Development

npm install        # Install dependencies
npm run build      # Build TypeScript
npm run dev        # Run with MCP inspector
npm start          # Start built server

Troubleshooting

Module Not Found Errors

Try using bunx instead of npx:

{ "command": "bunx", "args": ["-y", "crash-mcp"] }
ESM Resolution Issues

Try the experimental VM modules flag:

{ "args": ["-y", "--node-options=--experimental-vm-modules", "crash-mcp"] }

Credits

Author

Nikko Gonzales - nikkoxgonzales

License

MIT

Files in the repo

Repository payload10 top-level entries
  • .github
  • src
  • tests
  • CRASH.jpg
  • LICENSE
  • package-lock.json
  • package.json
  • README.md
  • tsconfig.json
  • vitest.config.ts

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More connectors

Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface

86k

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

43k

Universal provider proxy for OpenAI Codex & Claude Code — use any LLM (Claude, Gemini, Grok, DeepSeek, Ollama…) with Codex CLI, App, SDK, and Claude Code

14k
okf-memory/
okf-agent-memory

Git-native persistent memory for AI coding agents. Implements Google OKF v0.2 with sub-300µs in-memory BM25 search, embedded MCP server, and progressive disclosure. Slashes token bloat by 80% with zero external databases or dependencies. Built in pure Go.

547
tirth8205/
code-review-graph

Local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows.

31k
2akouwu/
reverify

Stop your AI from making things up — it proposes, deterministic tools decide, every claim checked against ground truth with evidence. Grounded facts and context survive resets. Reverse engineering is the proving ground. MCP server + CLI.

1.1k