Retrieval-Augmented Thinking MCP server

Enhances AI capabilities with structured, retrieval-augmented thinking processes, enabling dynamic thought chains and recursive refinement for improved reasoning and complex problem-solving.
Back to servers
Setup instructions
Provider
stat-guy
Release date
Feb 24, 2025
Language
TypeScript
Stats
15 stars

Retrieval Augmented Thinking (RAT) MCP Server is a reasoning tool for Claude that processes structured thoughts with metrics, branching, and revision capabilities. It helps organize and enhance analytical thinking by tracking thought sequences and providing metrics on your reasoning process.

Installation

Simple 3-Step Process

git clone https://github.com/stat-guy/retrieval-augmented-thinking.git
cd retrieval-augmented-thinking
npm install -g .

Verify Installation

Test that the installation worked correctly:

npx mcp-server-rat-node --help

If you see RAT MCP Server (Node.js) running on stdio, your installation is ready!

Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "retrieval-augmented-thinking": {
      "command": "npx",
      "args": ["mcp-server-rat-node"]
    }
  }
}

After adding the configuration, restart Claude Desktop to load the RAT server.

Usage

The server provides a single rat tool for processing structured thoughts:

Basic Usage

{
  "thought": "I need to analyze this problem step by step...",
  "nextThoughtNeeded": true,
  "thoughtNumber": 1,
  "totalThoughts": 3
}

With Revision

{
  "thought": "Let me reconsider my previous analysis...",
  "nextThoughtNeeded": false,
  "thoughtNumber": 2,
  "totalThoughts": 3,
  "isRevision": true,
  "revisesThought": 1
}

With Branching

{
  "thought": "Alternative approach: what if we consider...",
  "nextThoughtNeeded": true,
  "thoughtNumber": 2,
  "totalThoughts": 4,
  "branchFromThought": 1,
  "branchId": "alt-path-1"
}

Tool Parameters

Required Parameters

  • thought (string): The thought content to process
  • nextThoughtNeeded (boolean): Whether another thought is needed to continue
  • thoughtNumber (integer): Current thought number in the sequence
  • totalThoughts (integer): Total expected thoughts (adjustable)

Optional Parameters

  • isRevision (boolean): Whether this revises a previous thought
  • revisesThought (integer): The thought number being revised
  • branchFromThought (integer): Thought number to branch from
  • branchId (string): Unique identifier for this branch
  • needsMoreThoughts (boolean): Extend beyond totalThoughts if needed

Response Format

{
  "thought_number": 1,
  "total_thoughts": 3,
  "metrics": {
    "complexity": 0.342,
    "depth": 0.521,
    "quality": 0.643,
    "impact": 0.289,
    "confidence": 0.758
  },
  "analytics": {
    "total_thoughts": 5,
    "average_quality": 0.612,
    "chain_effectiveness": 0.145
  },
  "next_thought_needed": true,
  "visual_output": "ā”Œā”€ šŸ’­ Thought 1/3 ─────────────────┐\\n│ Analysis shows clear patterns... │\\nā”œā”€ Metrics ──────────────────────┤\\n│ Quality: 0.64 | Impact: 0.29... │\\nā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜"
}

Troubleshooting

Installation Issues

If you encounter installation problems:

  1. Ensure you have Node.js and npm installed
  2. Try the alternative installation method:
    npm install -g git+https://github.com/stat-guy/retrieval-augmented-thinking.git
    
  3. For rare permission issues:
    chmod +x $(npm bin -g)/mcp-server-rat-node
    

Verification Steps

Before configuring Claude Desktop, always verify the installation:

npx mcp-server-rat-node --help

If this shows "RAT MCP Server (Node.js) running on stdio", you're ready to configure Claude Desktop.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "retrieval-augmented-thinking" '{"command":"npx","args":["mcp-server-rat-node"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "retrieval-augmented-thinking": {
            "command": "npx",
            "args": [
                "mcp-server-rat-node"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "retrieval-augmented-thinking": {
            "command": "npx",
            "args": [
                "mcp-server-rat-node"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later