Skip to main content
Glama
rover-001

Recursive Thinking MCP Server

by rover-001
README.md
# Chain-of-Thought Recursive Thinking MCP Server

**v2.2.0 - Expert Roles, Custom Checklists, and Strict Validation!**

Token-efficient MCP server that makes AI agents think deeper through structured reasoning chains, self-critique, and automatic rethinking loops.

## 🎯 What's New in v2.2.0

| Feature | Description | Benefit |
|---------|-------------|---------|
| **Expert Roles** | AI assumes specific personas (e.g., Security Architect) | Rigorous perspective-based thinking |
| **Custom Checklists** | Validate solutions against specific requirements | Tailored quality enforcement |
| **Strict Mode** | Prevents finalization unless all criteria are met | High-bar production quality |
| **Chain of Thought** | AI explains WHY it chose each solution | Transparent reasoning, better decisions |
| **Self-Evaluation** | AI rates its own solutions (1-10 scale) | Honest assessment of solution quality |
| **Rethink Loop** | Automatic rethinking if rating <7 or issues found | Continuous improvement |

## ✨ Features

- **🧠 Chain of Thought**: AI must explain reasoning behind every decision
- **🎭 Expert Roles**: Inject specialized expertise into the thinking process
- **πŸ“‹ Custom Checklists**: Force AI to validate against your specific requirements
- **βš–οΈ Strict Mode**: Ensure the AI never settles for "good enough"
- **πŸ“Š Self-Evaluation**: AI rates solutions with score (1-10), good/bad flag, and rationale
- **πŸ”„ Continuous Rethinking**: Automatically rethinks if solution scored <7 or has weaknesses
- **🎯 Phase-Based Workflow**: Structured 5-phase thinking process
- **πŸ’° Token Optimized**: Smart compression, phase-focused prompts (~70% reduction)

## πŸ”„ How It Works

### The 5 Phases

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  1. EXPLORE β”‚ ──→ Propose solution with reasoning & expert perspective
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  2. JUSTIFY β”‚ ──→ Critically examine reasoning & assumptions
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  3. EVALUATEβ”‚ ──→ Rate solution (1-10) against checklist
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β–Ό
   β”Œβ”€β”€β”€β”΄β”€β”€β”€β”
   β”‚ Score β”‚
   β”‚ β‰₯7?   β”‚ ──NO─→ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β””β”€β”€β”€β”¬β”€β”€β”€β”˜        β”‚  4. RETHINK β”‚ ──→ Improve based on weaknesses
       β”‚YES         β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β–Ό                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”            β”‚
β”‚  5. FINALIZEβ”‚ β†β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

## πŸš€ Usage

### Starting a Thinking Session with Advanced Config

```typescript
await mcp.callTool('recursive_thinking', {
  action: 'start',
  task: 'Design a highly available database schema for a global payment system',
  config: {
    role: 'Database Reliability Engineer',
    checklist: [
      'Must handle 10k transactions/sec',
      'ACID compliance mandatory',
      'Multi-region failover strategy',
      'Data encryption at rest and in transit'
    ],
    strictMode: true,
    minRating: 8
  }
});
```

## βš™οΈ Configuration Options

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `role` | string | - | Expert persona to assume (e.g., 'Senior DevOps') |
| `checklist` | string[] | [] | Specific requirements to validate against |
| `strictMode` | boolean | false | If true, fails instead of finalizing if criteria aren't met |
| `maxDepth` | number | 5 | Maximum recursion depth |
| `minConfidence` | number | 0.85 | Stop when confidence meets threshold |
| `minRating` | number | 7 | Minimum acceptable score (1-10) |
| `enableRethinking` | boolean | true | Enable continuous refinement loop |

## πŸ“¦ Installation

```bash
npx -y recursive-thinking-mcp
```

## πŸ“„ License

MIT

## πŸ”— Links

- [NPM Package](https://www.npmjs.com/package/recursive-thinking-mcp)
- [GitHub Repository](https://github.com/Parth3930/recursive-thinking-mcp)