Labsco
fourcolors logo

Think Tool

โ˜… 6

from fourcolors

Enhances AI reasoning by providing a structured thinking environment.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

MCP Reflection Tool

A Model Context Protocol (MCP) server that provides a "reflect" tool for AI assistants to create cognitive checkpoints and structured reasoning. This tool helps LLMs maintain context, reflect on their work, and think through complex problems systematically.

Why Use This Tool?

Key Insight: Without explicitly outputting thought processes, no deep thinking occurs. This tool creates mandatory cognitive checkpoints that prevent shortcuts and improve accuracy.

Features

  • ๐Ÿง  Structured Reasoning: Forces AI assistants to reflect step-by-step through complex problems
  • โœ… Task Validation: Creates checkpoints to verify requirements are met
  • ๐Ÿ“ Learning Documentation: Captures discoveries and insights during problem-solving
  • ๐Ÿ” Debugging Aid: Helps work through issues systematically by elimination
  • ๐ŸŽฏ Decision Audit Trail: Creates a record of reasoning for important decisions

Integration with AI Tools

Claude Code

Add the server using a single command:

mcp add npx mcp-reflection-tool

This will automatically configure the server in your Claude Code settings. After running the command, restart Claude Code completely.

Cursor

Add to your Cursor configuration:

Option 1: Via Settings UI

  1. Open Cursor Settings (Cmd/Ctrl + ,)
  2. Search for "MCP" or navigate to Features > MCP
  3. Add the reflection tool configuration

Option 2: Direct Config Edit

Edit ~/.cursor/mcp_config.json:

{
  "mcpServers": {
    "reflection-tool": {
      "command": "npx",
      "args": ["mcp-reflection-tool"]
    }
  }
}

Restart Cursor after making changes.

Windsurf

Add to your Windsurf MCP configuration:

Location: ~/.windsurf/mcp.json (macOS/Linux) or %USERPROFILE%\.windsurf\mcp.json (Windows)

{
  "mcpServers": {
    "reflection-tool": {
      "command": "npx",
      "args": ["mcp-reflection-tool"]
    }
  }
}

Restart Windsurf to apply changes.

Cline (VS Code Extension)

Option 1: Via VS Code Settings UI

  1. Open VS Code Settings (Cmd/Ctrl + ,)
  2. Search for "Cline MCP"
  3. Add server configuration

Option 2: Edit settings.json

Add to your VS Code settings.json:

{
  "cline.mcpServers": {
    "reflection-tool": {
      "command": "npx",
      "args": ["mcp-reflection-tool"]
    }
  }
}

Reload VS Code window after configuration.

Alternative: Manual Server Mode

The server runs via stdio by default. If you need HTTP mode, use environment variables:

# Start server in stdio mode (default)
npx mcp-reflection-tool

# Start in HTTP mode on port 8080
HTTP=true npx mcp-reflection-tool

# Start in HTTP mode on custom port
HTTP=true PORT=3000 npx mcp-reflection-tool

Most modern AI tools support stdio mode automatically.

When the Tool Gets Used

The AI assistant will automatically use this tool as a cognitive scratchpad for:

  • ๐Ÿ” Chain-of-thought reasoning through complex problems
  • ๐Ÿ“‹ Planning your approach before taking actions
  • โœ… Reflecting on outcomes after completing tasks
  • โœ”๏ธ Validating that requirements are met
  • ๐Ÿ“ Documenting discoveries and learnings
  • ๐ŸŽฏ Creating cognitive checkpoints you can't skip

This helps the AI think step-by-step, improving accuracy and compliance.

Development

Prerequisites

  • Node.js 18+ or Bun runtime
  • npm or bun package manager

Setup

# Clone the repository
git clone https://github.com/sterling/think-tool.git
cd think-tool

# Install dependencies
bun install
# or
npm install

# Run in development mode (with hot-reload)
bun run dev
# or
npm run dev

Building from Source

# Build TypeScript to JavaScript
bun run build
# or
npm run build

# Run the built version
bun start
# or
npm start

Project Structure

โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ server.ts      # TypeScript source code
โ”œโ”€โ”€ dist/              # Built JavaScript (generated)
โ”‚   โ”œโ”€โ”€ server.js      # Main server file
โ”‚   โ””โ”€โ”€ cli.js         # CLI executable
โ”œโ”€โ”€ package.json       # NPM package configuration
โ””โ”€โ”€ tsconfig.json      # TypeScript configuration

How It Works

The reflection tool implements the Model Context Protocol (MCP) to provide a standardized way for AI assistants to access external tools. When an AI assistant needs to reflect on a problem:

  1. The AI calls the reflect tool with its reasoning
  2. The tool logs the thought process to the server console
  3. The tool acknowledges the checkpoint back to the AI
  4. This creates a cognitive checkpoint that improves reasoning quality

This "thinking out loud" effect has been shown to significantly improve the accuracy and completeness of AI responses.

Author

Created as an MCP implementation for enhancing AI reasoning capabilities.