Sequential Thinking Multi-Agent System MCP server

Orchestrates a team of specialized agents working in parallel to break down complex problems through structured thinking steps, enabling multi-disciplinary analysis with greater depth than single-agent approaches.
Back to servers
Setup instructions
Provider
Frad Lee
Release date
Apr 03, 2025
Language
Python
Package
Stats
3.4K downloads
259 stars

The Sequential Thinking Multi-Agent System (MAS) is an advanced MCP server that enhances your LLM client with sophisticated sequential thinking capabilities through coordinated, specialized AI agents. It processes complex thoughts from multiple cognitive angles, delivering comprehensive analysis and problem-solving assistance.

Installation

Prerequisites

  • Python 3.10+
  • LLM API access (choose one provider):
    • DeepSeek: DEEPSEEK_API_KEY (default, recommended)
    • Groq: GROQ_API_KEY
    • OpenRouter: OPENROUTER_API_KEY
    • GitHub Models: GITHUB_TOKEN
    • Anthropic: ANTHROPIC_API_KEY
    • Ollama: Local installation (no API key)
  • Optional: EXA_API_KEY for web research capabilities

Quick Start

Option 1: Install via Smithery (Recommended)

npx -y @smithery/cli install @FradSer/mcp-server-mas-sequential-thinking --client claude

Option 2: Manual Installation

# Clone the repository
git clone https://github.com/FradSer/mcp-server-mas-sequential-thinking.git
cd mcp-server-mas-sequential-thinking

# Install with uv (recommended)
uv pip install .

# Or with pip
pip install .

Configuration

For MCP Clients (Claude Desktop, etc.)

Add to your MCP client configuration:

{
  "mcpServers": {
    "sequential-thinking": {
      "command": "mcp-server-mas-sequential-thinking",
      "env": {
        "LLM_PROVIDER": "deepseek",
        "DEEPSEEK_API_KEY": "your_api_key",
        "EXA_API_KEY": "your_exa_key_optional"
      }
    }
  }
}

Environment Variables

Create a .env file or set these variables:

# LLM Provider (required)
LLM_PROVIDER="deepseek"  # deepseek, groq, openrouter, github, anthropic, ollama
DEEPSEEK_API_KEY="sk-..."

# Optional: Enhanced/Standard Model Selection
# DEEPSEEK_ENHANCED_MODEL_ID="deepseek-chat"  # For synthesis
# DEEPSEEK_STANDARD_MODEL_ID="deepseek-chat"  # For other agents

# Optional: Web Research (enables ExaTools)
# EXA_API_KEY="your_exa_api_key"

# Optional: Custom endpoint
# LLM_BASE_URL="https://custom-endpoint.com"

Model Configuration Examples

# Groq with different models
GROQ_ENHANCED_MODEL_ID="openai/gpt-oss-120b"
GROQ_STANDARD_MODEL_ID="openai/gpt-oss-20b"

# Anthropic with Claude models
ANTHROPIC_ENHANCED_MODEL_ID="claude-3-5-sonnet-20241022"
ANTHROPIC_STANDARD_MODEL_ID="claude-3-5-haiku-20241022"

# GitHub Models
GITHUB_ENHANCED_MODEL_ID="gpt-4o"
GITHUB_STANDARD_MODEL_ID="gpt-4o-mini"

Usage

As MCP Server

Once installed and configured in your MCP client:

  1. The sequentialthinking tool becomes available
  2. Your LLM can use it to process complex thoughts
  3. The system automatically routes to appropriate thinking agents
  4. Results are synthesized and returned to your LLM

Direct Execution

Run the server manually for testing:

# Using installed script
mcp-server-mas-sequential-thinking

# Using uv
uv run mcp-server-mas-sequential-thinking

# Using Python
python src/mcp_server_mas_sequential_thinking/main.py

Core Architecture

Multi-Dimensional Thinking Agents

The system employs 6 specialized thinking agents, each with a distinct cognitive perspective:

1. Factual Agent

  • Focus: Objective facts and verified data
  • Approach: Analytical, evidence-based reasoning
  • Capabilities: Web research for current facts, data verification
  • Time allocation: 120 seconds

2. Emotional Agent

  • Focus: Intuition and emotional intelligence
  • Approach: Gut reactions and feelings
  • Capabilities: Quick intuitive responses, emotional pattern recognition
  • Time allocation: 30 seconds

3. Critical Agent

  • Focus: Risk assessment and problem identification
  • Approach: Logical scrutiny and devil's advocate
  • Capabilities: Research counterexamples, identify logical flaws
  • Time allocation: 120 seconds

4. Optimistic Agent

  • Focus: Benefits, opportunities, and value
  • Approach: Positive exploration with realistic grounding
  • Capabilities: Research success stories, identify feasible opportunities
  • Time allocation: 120 seconds

5. Creative Agent

  • Focus: Innovation and alternative solutions
  • Approach: Lateral thinking and idea generation
  • Capabilities: Cross-industry innovation research, multiple solution generation
  • Time allocation: 240 seconds

6. Synthesis Agent

  • Focus: Integration and metacognitive orchestration
  • Approach: Holistic synthesis and final answer generation
  • Capabilities: Integrate all perspectives into coherent response
  • Time allocation: 60 seconds
  • Note: Uses enhanced model

AI-Powered Intelligent Routing

The system uses AI-driven complexity analysis to determine the optimal thinking sequence:

Processing Strategies:

  1. Single Agent (Simple questions)

    • Direct factual or emotional response
    • Fastest processing for straightforward queries
  2. Double Agent (Moderate complexity)

    • Two-step sequences (e.g., Optimistic → Critical)
    • Balanced perspectives for evaluation tasks
  3. Triple Agent (Core thinking)

    • Factual → Creative → Synthesis
    • Philosophical and analytical problems
  4. Full Sequence (Complex problems)

    • All 6 agents orchestrated together
    • Comprehensive multi-perspective analysis

Research Capabilities

Four out of six agents are equipped with web research capabilities via ExaTools:

  • Factual Agent: Search for current facts, statistics, verified data
  • Critical Agent: Find counterexamples, failed cases, regulatory issues
  • Optimistic Agent: Research success stories, positive case studies
  • Creative Agent: Discover innovations across different industries

Research is optional - requires EXA_API_KEY environment variable. The system works without it, using pure reasoning capabilities.

MCP Tool: sequentialthinking

The server exposes a single MCP tool that processes sequential thoughts:

Parameters:

{
  thought: string,              // Current thinking step content
  thoughtNumber: number,         // Sequence number (≥1)
  totalThoughts: number,         // Estimated total steps
  nextThoughtNeeded: boolean,    // Is another step required?
  isRevision: boolean,           // Revising previous thought?
  branchFromThought?: number,    // Branch point (for exploration)
  branchId?: string,             // Branch identifier
  needsMoreThoughts: boolean     // Need to extend sequence?
}

Token Usage Considerations

Due to the Multi-Agent System architecture, this tool consumes significantly more tokens than single-agent alternatives. Each sequentialthinking call invokes multiple specialized agents simultaneously, potentially using 5-10x more tokens than simpler approaches, but providing correspondingly deeper and more comprehensive analysis.

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 "mas-sequential-thinking" '{"command":"uvx","args":["mcp-server-mas-sequential-thinking"],"env":{"LLM_PROVIDER":"deepseek","DEEPSEEK_API_KEY":"your_deepseek_api_key","EXA_API_KEY":"your_exa_api_key"}}'

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": {
        "mas-sequential-thinking": {
            "command": "uvx",
            "args": [
                "mcp-server-mas-sequential-thinking"
            ],
            "env": {
                "LLM_PROVIDER": "deepseek",
                "DEEPSEEK_API_KEY": "your_deepseek_api_key",
                "EXA_API_KEY": "your_exa_api_key"
            }
        }
    }
}

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": {
        "mas-sequential-thinking": {
            "command": "uvx",
            "args": [
                "mcp-server-mas-sequential-thinking"
            ],
            "env": {
                "LLM_PROVIDER": "deepseek",
                "DEEPSEEK_API_KEY": "your_deepseek_api_key",
                "EXA_API_KEY": "your_exa_api_key"
            }
        }
    }
}

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