Sequential Thinking Multi-Agent System (MAS)

by fradser

94 stars
5.5k downloads
Not rated
GitHub

About

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.

Details

Author
fradser
Repository
FradSer/mcp-server-mas-sequential-thinking
GitHub stars
94
Downloads
5,523
Categories
Developer Tools, Design, Workplace, AI, Search, Communication, Infrastructure, Frontend
Tags
#integration

ExaTools is attached to every agent except synthesis. Research is optional — it activates only when EXA_API_KEY is set. Without it, the system works on pure reasoning.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Sequential Thinking Multi-Agent System (MAS)
    Command (node, npx, python, etc.) mcp-server-mas-sequential-thinking
    Environment
    • EXA_API_KEY your_exa_key_optional
    • LLM_PROVIDER deepseek
    • DEEPSEEK_API_KEY your_api_key

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

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

uv pip install . # or: pip install .

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"
      }
    }
  }
}

```bash

uv pip install -e ".[dev]"

sequentialthinking

Runs every thought through a fixed multi-agent workflow. Parameters: thought (string), thoughtNumber (number), totalThoughts (number), nextThoughtNeeded (boolean), isRevision (boolean), branchFromThought (optional number), branchId (optional string), needsMoreThoughts (boolean).

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "sequential thinking multi-agent system (mas)": {
            "env": {
                "EXA_API_KEY": "your_exa_key_optional",
                "LLM_PROVIDER": "deepseek",
                "DEEPSEEK_API_KEY": "your_api_key"
            },
            "args": [],
            "command": "mcp-server-mas-sequential-thinking"
        }
    }
}

Linux

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

Macos

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

Windows

{
    "env": {
        "EXA_API_KEY": "your_exa_key_optional",
        "LLM_PROVIDER": "deepseek",
        "DEEPSEEK_API_KEY": "your_api_key"
    },
    "args": [
        "/c",
        "mcp-server-mas-sequential-thinking"
    ],
    "command": "cmd"
}

Sequential Thinking Multi-Agent System (MAS)

Python Version Framework Twitter Follow

English | 简体中文

An MCP server that processes sequential thoughts through a team of specialized AI agents, each analyzing the problem from a different cognitive perspective.

What This Is

This is an MCP server, not a standalone application. It runs as a background service that extends an MCP-compatible LLM client (like Claude Desktop) with structured sequential-thinking capabilities. It exposes one tool, sequentialthinking, that runs every thought through a fixed multi-agent workflow: an initial synthesis, several specialist agents thinking in parallel, and a final synthesis that answers the original question.

How It Works

The system uses a fixed full_exploration strategy for every request. The AI complexity analyzer still runs to record diagnostic metadata (complexity score, problem type, required thinking modes), but it no longer changes the execution path — all thoughts take the same route:

flowchart TD
    A[Input Thought] --> B[AI Complexity Analyzer]
    B --> C[Complexity Metadata Stored]
    C --> D[Fixed Strategy: full_exploration]
    D --> E[Step 1: Initial Synthesis]
    E --> F[Step 2: Parallel Specialist Agents]
    F --> G[Step 3: Final Synthesis]
    G --> H[Unified Response]

The Specialist Agents

Each request runs six specialist agents in parallel, plus a synthesis agent that runs twice (once at the start, once at the end). Every specialist except synthesis can optionally use web research via ExaTools.

| Agent | Thinking direction | Focus | Time budget |
| --- | --- | --- | --- |
| Factual | factual | Objective facts and verified data | 120s |
| Emotional | emotional | Intuition and gut reactions | 30s |
| Critical | critical | Risks, weaknesses, logical flaws | 120s |
| Optimistic | optimistic | Benefits, opportunities, value | 120s |
| Creative | creative | New ideas and alternatives | 240s |
| Meta-cognitive | metacognitive | Bias detection and reasoning-process evaluation | 90s |
| Synthesis | synthesis | Integration and final answer | 60s |

Key properties:

- Deterministic: every request runs the same multi-step path.
- Parallel: the specialist agents run simultaneously with asyncio.gather.
- Synthesis-driven: both orchestration and the final answer come from the synthesis agent, which uses the enhanced model.

Model Strategy

Two models are configured per provider:

- Enhanced model: used by the synthesis agent (integration tasks).
- Standard model: used by the specialist agents.

Research Capabilities

ExaTools is attached to every agent except synthesis. Research is optional — it activates only when EXA_API_KEY is set. Without it, the system works on pure reasoning.

The sequentialthinking Tool

The server exposes one MCP tool.

Input

{
  thought: string,               // One focused reasoning step
  thoughtNumber: number,         // 1-based step index; increment each call
  totalThoughts: number,         // Planned number of steps
  nextThoughtNeeded: boolean,    // true for intermediate steps, false on final step
  isRevision: boolean,           // true only when revising earlier conclusions
  branchFromThought?: number,    // Set with branchId to branch from a prior step
  branchId?: string,             // Branch identifier (required when branching)
  needsMoreThoughts: boolean     // true only when extending beyond totalThoughts
}

Output

{
  should_continue: boolean,      // Canonical continuation signal
  next_thought_number: number?,  // Recommended next thoughtNumber
  stop_reason: string,           // Why to continue/stop/retry
  current_thought_number: number,
  total_thoughts: number,
  next_call_arguments?: {        // Suggested next-call arguments when applicable
    thoughtNumber: number,
    totalThoughts: number,
    nextThoughtNeeded: boolean,
    needsMoreThoughts: boolean
  },
  parameter_usage: Record<string, string>
}

Call Contract

- Treat this tool as a multi-step loop, not a one-shot call.
- After every response, read structuredContent.should_continue.
- Keep calling until should_continue is false.
- Actively use reflection: when a step is weak or incorrect, send a revision step with isRevision=true.
- Prefer structuredContent.next_thought_number and next_call_arguments when building the next request.

Supported Providers

| Provider | Env var | Default enhanced model | Default standard model |
| --- | --- | --- | --- |
| DeepSeek (default) | DEEPSEEK_API_KEY | deepseek-chat | deepseek-chat |
| Groq | GROQ_API_KEY | openai/gpt-oss-120b | openai/gpt-oss-20b |
| OpenRouter | OPENROUTER_API_KEY | deepseek/deepseek-chat-v3-0324 | deepseek/deepseek-r1 |
| GitHub Models | GITHUB_TOKEN | openai/gpt-5 | openai/gpt-5-min |
| Anthropic | ANTHROPIC_API_KEY | claude-3-5-sonnet-20241022 | claude-3-5-haiku-20241022 |
| Ollama | none | devstral:24b | devstral:24b |

Installation

Prerequisites

- Python 3.10+
- An LLM API key from one of the providers above
- Optional: EXA_API_KEY for web research
- uv package manager (recommended) or pip

Install

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

uv pip install . # or: pip install .

Configure an MCP Client

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

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.