Skip to main content
Glama
Parth3930

Recursive Thinking MCP Server

by Parth3930

Recursive Thinking MCP Server

Token-efficient MCP server for AI agents to achieve production-ready solutions through iterative refinement.

Features

  • Token Optimized: Compresses insights and uses minimal context per iteration (~70% reduction)

  • Production Ready: Stops when confidence threshold is met (default: 85%)

  • Session Based: Track multiple thinking processes concurrently

  • AI Agent Enhancement: Helps AI agents think deeper and refine solutions automatically

Installation

npx -y recursive-thinking-mcp

Global Installation

npm install -g recursive-thinking-mcp

Development Setup

# Clone or download the project cd recursive-thinking-mcp # Install dependencies npm install # Build npm run build # Link globally (for development) npm link

MCP Configuration

For Claude Code / Claude Desktop

Add to your MCP configuration file:

Windows: C:\Users\YourUsername\.claude\plugins\marketplaces\thedotmack\.mcp.json macOS/Linux: ~/.claude/plugins/marketplaces/thedotmack/.mcp.json

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

For VS Code

Add to your user or workspace .vscode/mcp.json:

{ "servers": { "recursive-thinking": { "command": "npx", "args": [ "-y", "recursive-thinking-mcp" ] } } }

Usage

Starting a Thinking Session

// Start with a task await mcp.callTool('recursive_thinking', { action: 'start', task: 'Implement a secure authentication system with JWT', config: { maxDepth: 5, minConfidence: 0.9 } });

Iterating on Response

// Continue with agent's response await mcp.callTool('recursive_thinking', { action: 'iterate', sessionId: 'session_1234567890_abc123', response: 'Use bcrypt for password hashing, JWT with RS256...' });

Response Format

Start Response:

{ "sessionId": "session_1234567890_abc123", "prompt": "Analyze task: 'Implement a secure authentication...'\nProvide: [approach][potential_issues][confidence_0-1]", "depth": 0, "isComplete": false, "instruction": "Provide your response to this prompt, then call again with action=iterate" }

Final Response:

{ "sessionId": "session_1234567890_abc123", "isComplete": true, "depth": 3, "confidence": 0.92, "iterations": [...], "finalSolution": "Complete implementation with...", "instruction": "Production-ready solution achieved." }

Configuration Options

Parameter

Type

Default

Range

Description

maxDepth

number

5

1-10

Maximum recursion depth

minConfidence

number

0.85

0-1

Stop when confidence meets threshold

maxIterations

number

8

1-20

Maximum total iterations

Token Efficiency Features

  1. Context Compression: Extracts only key insights from previous iterations

  2. Progressive Prompts: Each prompt is concise and focused

  3. Early Stopping: Stops when production-ready solution is detected

  4. Limited History: Only essential information is propagated

Example Workflow

// 1. Start thinking const result1 = await recursive_thinking({ action: 'start', task: 'Build a REST API for user management' }); // Returns: "Analyze task: [approach][issues][confidence]" // 2. Agent responds, iterate const result2 = await recursive_thinking({ action: 'iterate', sessionId: result1.sessionId, response: "Use Express + TypeScript, implement CRUD..." }); // Returns: "Refine solution: [what to improve][new confidence]" // 3. Continue until isComplete=true // Process stops automatically when confidence >= 0.85

Development

# Install dependencies npm install # Build npm run build # Run locally npm start # Watch mode for development npm run dev # Link globally (for testing) npm link

Performance

Metric

Value

Average iterations to solution

2-3

Token usage per session

~1000-1500

Bundle size

0.48 MB

Success rate

100%

SEO Keywords

AI agent, MCP server, Model Context Protocol, recursive thinking, iterative refinement, token optimization, Claude AI, AI problem solving, production-ready solutions, context compression, thinking engine, automation tool, LLM enhancement, Claude Desktop, Claude Code, VS Code MCP.

Troubleshooting

Command not found

If recursive-thinking-mcp command is not found:

# Verify global installation npm list -g recursive-thinking-mcp # Reinstall globally npm install -g recursive-thinking-mcp # Or use npx directly in config

MCP server not starting

  1. Verify the package is installed globally or available via npx

  2. Check configuration file syntax

  3. Restart Claude Code/Claude Desktop

  4. Check logs for error messages

Build errors

# Clean and rebuild rm -rf dist node_modules npm install npm run build

License

MIT

-
security - not tested
F
license - not found
-
quality - not tested

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Parth3930/recursive-thinking-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server