Sequential Thinking Multi-Agent System logo

Sequential Thinking Multi-Agent System

Community
FradSer

An advanced sequential thinking process using a Multi-Agent System (MAS) built with the Agno framework and served via MCP.

PublisherFradSer
Repositorymcp-server-mas-sequential-thinking
LanguagePython
Forks
46
Stars
306
Available tools
0
Transport typestdio
Categories
Links
  • Connect tools to AI workflows

    Sequential Thinking Multi-Agent System exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    306 stars and 46 forks from the linked repository.

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:

mermaid
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.

AgentThinking directionFocusTime budget
FactualfactualObjective facts and verified data120s
EmotionalemotionalIntuition and gut reactions30s
CriticalcriticalRisks, weaknesses, logical flaws120s
OptimisticoptimisticBenefits, opportunities, value120s
CreativecreativeNew ideas and alternatives240s
Meta-cognitivemetacognitiveBias detection and reasoning-process evaluation90s
SynthesissynthesisIntegration and final answer60s

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

typescript
{
  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

typescript
{
  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

ProviderEnv varDefault enhanced modelDefault standard model
DeepSeek (default)DEEPSEEK_API_KEYdeepseek-chatdeepseek-chat
GroqGROQ_API_KEYopenai/gpt-oss-120bopenai/gpt-oss-20b
OpenRouterOPENROUTER_API_KEYdeepseek/deepseek-chat-v3-0324deepseek/deepseek-r1
GitHub ModelsGITHUB_TOKENopenai/gpt-5openai/gpt-5-min
AnthropicANTHROPIC_API_KEYclaude-3-5-sonnet-20241022claude-3-5-haiku-20241022
Ollamanonedevstral:24bdevstral: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

bash
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:

json
{
  "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
# LLM provider (required)
LLM_PROVIDER="deepseek"  # deepseek, groq, openrouter, github, anthropic, ollama
DEEPSEEK_API_KEY="sk-..."

# Optional: override the models per provider (prefixed by provider name)
# DEEPSEEK_ENHANCED_MODEL_ID="deepseek-chat"
# DEEPSEEK_STANDARD_MODEL_ID="deepseek-chat"

# Optional: web research (enables ExaTools)
# EXA_API_KEY="your_exa_api_key"

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

# Optional: team orchestration mode (standard/broadcast, route, coordinate)
# TEAM_MODE="standard"

Run the Server Directly

bash
mcp-server-mas-sequential-thinking        # installed script
uv run mcp-server-mas-sequential-thinking  # or via uv

Development

bash
# Install with dev dependencies
uv pip install -e ".[dev]"

# Code quality
uv run ruff check . --fix
uv run ruff format .
uv run mypy .

# Run tests
uv run pytest tests/

# Or use the Makefile
make test        # all tests with coverage + quality checks
make test-fast   # fast run without coverage
make check-all   # all quality checks

Test with MCP Inspector

bash
npx @modelcontextprotocol/inspector uv run mcp-server-mas-sequential-thinking

Open http://127.0.0.1:6274/ and test the sequentialthinking tool.

Token Consumption Warning

The multi-agent architecture consumes significantly more tokens than a single-agent tool — roughly 5-10x more per sequentialthinking call, because every call invokes multiple specialist agents. The tradeoff is deeper, multi-perspective analysis.

Project Structure

mcp-server-mas-sequential-thinking/
├── src/mcp_server_mas_sequential_thinking/
│   ├── main.py                          # MCP server entry point (MCPServer)
│   ├── processors/
│   │   ├── multi_thinking_core.py       # Specialist agent definitions
│   │   └── multi_thinking_processor.py  # Parallel sequence execution
│   ├── routing/
│   │   ├── ai_complexity_analyzer.py    # AI complexity analysis
│   │   ├── complexity_types.py          # Complexity metric models
│   │   └── multi_thinking_router.py     # Fixed full_exploration routing
│   ├── services/
│   │   ├── server_core.py               # ThoughtProcessor implementation
│   │   ├── processing_orchestrator.py   # Agno Team orchestration
│   │   ├── workflow_executor.py
│   │   └── context_builder.py
│   ├── infrastructure/
│   │   ├── persistent_memory.py         # SQLite session storage
│   │   └── learning_resources.py        # Agent learning machine
│   ├── security/rate_limiter.py         # Rate limiting and request validation
│   └── config/
│       ├── modernized_config.py         # Provider strategies
│       └── constants.py                 # System constants
├── scripts/mcp_python_client_smoke.py   # Protocol smoke test
├── tests/                               # Unit and integration tests
├── pyproject.toml
└── Makefile

Changelog

See CHANGELOG.md for version history.

Contributing

Contributions are welcome. Please ensure:

  1. Code follows the project style (ruff, mypy)
  2. Commit messages use conventional commits format
  3. All tests pass before submitting a PR
  4. Documentation is updated as needed

License

This project does not yet declare a license. See the LICENSE discussion if you need to reuse it.

Acknowledgments

  • Built with Agno v2.x
  • Model Context Protocol by Anthropic
  • Research capabilities powered by Exa (optional)
  • Multi-dimensional thinking inspired by Edward de Bono's work

Support

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "mas-sequential-thinking": {
      "command": "uvx",
      "args": [
        "mcp-server-mas-sequential-thinking"
      ],
      "env": {
        "LLM_PROVIDER": "deepseek",
        "DEEPSEEK_API_KEY": "your_deepseek_api_key",
        "LLM_BASE_URL": "your_base_url_if_needed",
        "EXA_API_KEY": "your_exa_api_key"
      }
    }
  }
}

Use Sequential Thinking Multi-Agent System MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Sequential Thinking Multi-Agent System is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Sequential Thinking Multi-Agent System as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Sequential Thinking Multi-Agent System MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "sequential-thinking-multi-agent-system": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-server-mas-sequential-thinking"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Sequential Thinking Multi-Agent System MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Sequential Thinking Multi-Agent System MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Sequential Thinking Multi-Agent System to help me with this task?
Sequential Thinking Multi-Agent System
Sure. I read it.
Here is what I found using Sequential Thinking Multi-Agent System.

Frequently asked questions

What is the Sequential Thinking Multi-Agent System MCP server used for?

Sequential Thinking Multi-Agent System is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Sequential Thinking Multi-Agent System MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Sequential Thinking Multi-Agent System with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Sequential Thinking Multi-Agent System MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Sequential Thinking Multi-Agent System connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Sequential Thinking Multi-Agent System MCP to TypingMind?

Sequential Thinking Multi-Agent System runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Sequential Thinking Multi-Agent System MCP provide in TypingMind?

Sequential Thinking Multi-Agent System exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Sequential Thinking Multi-Agent System MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Sequential Thinking Multi-Agent System requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇