Sequential Thinking Multi-Agent System
The Sequential Thinking Multi-Agent System server enhances LLM clients with advanced sequential thinking capabilities by orchestrating 6 specialized AI agents (Factual, Emotional, Critical, Optimistic, Creative, Synthesis) that analyze problems from diverse cognitive perspectives.
Core Capabilities:
AI-powered routing: Automatically determines optimal processing strategies (Single, Double, Triple, or Full Agent sequences) based on problem complexity
Multi-perspective analysis: Each agent applies unique cognitive approaches for comprehensive problem assessment
Web research integration: Four agents conduct targeted research using ExaTools for current facts, counterexamples, success stories, and innovations
Sequential processing: Manages iterative thought sequences, revisions, branching into alternative approaches, and tracks progress through complex problems
Dual-model strategy: Uses Enhanced Models for complex synthesis tasks and Standard Models for individual agent processing
Multi-provider support: Works with DeepSeek, Groq, OpenRouter, Anthropic, GitHub Models, and Ollama
MCP integration: Extends LLM clients like Claude Desktop with sophisticated thinking capabilities via the
sequentialthinkingtool
Ideal for philosophical, analytical, creative, and multi-faceted problems requiring deep analysis and comprehensive synthesis from multiple cognitive angles.
Supports configuration through environment variables, allowing secure storage of API keys for external services like DeepSeek and Exa.
Enables robust data validation for thought steps in the sequential thinking process, ensuring input integrity before processing by the agent team.
Leverages the Python AI/ML ecosystem for implementing the Multi-Agent System architecture, supporting advanced sequential thinking capabilities.
Referenced as the language of the original implementation that this version evolved from, showing architectural progression from a simple state tracker to a Multi-Agent System.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Sequential Thinking Multi-Agent Systemanalyze the pros and cons of implementing a four-day workweek"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Sequential Thinking Multi-Agent System (MAS) 
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.
Related MCP server: Sequential-Thinking
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 |
| Objective facts and verified data | 120s |
Emotional |
| Intuition and gut reactions | 30s |
Critical |
| Risks, weaknesses, logical flaws | 120s |
Optimistic |
| Benefits, opportunities, value | 120s |
Creative |
| New ideas and alternatives | 240s |
Meta-cognitive |
| Bias detection and reasoning-process evaluation | 90s |
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_continueisfalse.Actively use reflection: when a step is weak or incorrect, send a revision step with
isRevision=true.Prefer
structuredContent.next_thought_numberandnext_call_argumentswhen building the next request.
Supported Providers
Provider | Env var | Default enhanced model | Default standard model |
DeepSeek (default) |
|
|
|
Groq |
|
|
|
OpenRouter |
|
|
|
GitHub Models |
|
|
|
Anthropic |
|
|
|
Ollama | none |
|
|
Installation
Prerequisites
Python 3.10+
An LLM API key from one of the providers above
Optional:
EXA_API_KEYfor web researchuvpackage manager (recommended) orpip
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
# 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
mcp-server-mas-sequential-thinking # installed script
uv run mcp-server-mas-sequential-thinking # or via uvDevelopment
# 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 checksTest with MCP Inspector
npx @modelcontextprotocol/inspector uv run mcp-server-mas-sequential-thinkingOpen 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
└── MakefileChangelog
See CHANGELOG.md for version history.
Contributing
Contributions are welcome. Please ensure:
Code follows the project style (ruff, mypy)
Commit messages use conventional commits format
All tests pass before submitting a PR
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
GitHub Issues: Report bugs or request features
Documentation: see CLAUDE.md for implementation notes
MCP Protocol: Official MCP Documentation
Available Tools
1 toolsequentialthinkingA
Multi-step sequential reasoning contract. Always treat this tool as iterative: after each response, read structuredContent.should_continue and continue calling until it is false. Actively use reflection: when a step reveals a flaw, explicitly send a revision step with isRevision=true. Input contract:
thought: one concrete reasoning step in natural language.
thoughtNumber: 1-based step index; increment by one for each new step.
totalThoughts: target number of steps for the current plan.
nextThoughtNeeded: true while the sequence should continue; false on final step.
isRevision: true only when revising an earlier conclusion.
branchFromThought + branchId: set together to explore an alternative branch.
needsMoreThoughts: true only when extending beyond totalThoughts. Output contract:
structuredContent.should_continue: canonical continuation signal.
structuredContent.next_thought_number: next recommended thoughtNumber.
structuredContent.stop_reason: canonical reason code for orchestration.
| Name | Required | Description | Default |
|---|---|---|---|
| thought | Yes | Current reasoning step text. Keep this to one concrete step. | |
| thoughtNumber | Yes | 1-based sequence index for this thought. Increment for each step. | |
| totalThoughts | Yes | Estimated total number of steps in the current reasoning plan. | |
| nextThoughtNeeded | Yes | Set true when another thought follows this one. Set false on the final thought. | |
| isRevision | Yes | Set true only when this step revises an earlier conclusion. | |
| branchFromThought | Yes | Original thought number for branching. Null for the main path. | |
| branchId | Yes | Branch identifier. Required when branchFromThought is not null. | |
| needsMoreThoughts | Yes | Set true only when you must continue beyond totalThoughts. |
Output Schema
| Name | Required | Description |
|---|---|---|
| should_continue | Yes | If true, call sequentialthinking again. The tool is designed for multi-step reasoning loops. |
| next_thought_number | No | Recommended thoughtNumber for the next call. Null means no next step is currently required. |
| stop_reason | Yes | Machine-readable reason that explains why to continue or stop. |
| current_thought_number | Yes | Echo of the current thoughtNumber after normalization. |
| total_thoughts | Yes | Echo of current totalThoughts after normalization. |
| next_call_arguments | No | Concrete argument recommendations for the next call when the current run completes successfully and should continue. |
| parameter_usage | Yes | Contract reminders for each core parameter to keep multi-step iterations consistent. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries full burden. It discloses the iterative nature, revision mechanism, and output contract. It lacks explicit statements about side effects or auth but is sufficient for the intended reasoning use.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (input contract, output contract) and front-loaded with the core concept. It is slightly lengthy but each sentence adds value, so it earns a 4.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (8 required params, output schema), the description covers the input and output contracts, usage pattern, and corner cases like revision and branching. It is nearly complete, lacking only examples or defaults, which are covered by the schema.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions for all 8 parameters. The description adds value by contextualizing parameter usage, such as grouping branchFromThought and branchId, and clarifying that needsMoreThoughts extends beyond totalThoughts.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool is a 'Multi-step sequential reasoning contract' and explains its iterative, revision, and branching capabilities. It is very specific and distinguishes itself by detailing the contract-like behavior.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly instructs to treat the tool iteratively, read structuredContent.should_continue, and continue until false. It also specifies when to use revisions (when a flaw is revealed) and branching (with branchFromThought and branchId).
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.8.0- Changed
sequentialthinking31 fields changed- added
Input schema / properties / branchFromThoughtAdded value: +{ + "anyOf": [ + { + "minimum": 1, + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "Original thought number for branching. Null for the main path.", + "title": "Branchfromthought" +} - added
Input schema / properties / branchIdAdded value: +{ + "anyOf": [ + { + "minLength": 1, + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Branch identifier. Required when branchFromThought is not null.", + "title": "Branchid" +} - removed
Input schema / properties / branch_fromRemoved value: -{ - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Branch From" -} - removed
Input schema / properties / branch_idRemoved value: -{ - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Branch Id" -} - added
Input schema / properties / isRevisionAdded value: +{ + "description": "Set true only when this step revises an earlier conclusion.", + "title": "Isrevision", + "type": "boolean" +} - removed
Input schema / properties / is_revisionRemoved value: -{ - "default": false, - "title": "Is Revision", - "type": "boolean" -} - added
Input schema / properties / needsMoreThoughtsAdded value: +{ + "description": "Set true only when you must continue beyond totalThoughts.", + "title": "Needsmorethoughts", + "type": "boolean" +} - removed
Input schema / properties / needs_moreRemoved value: -{ - "default": false, - "title": "Needs More", - "type": "boolean" -} - added
Input schema / properties / nextThoughtNeededAdded value: +{ + "description": "Set true when another thought follows this one. Set false on the final thought.", + "title": "Nextthoughtneeded", + "type": "boolean" +} - removed
Input schema / properties / next_neededRemoved value: -{ - "title": "Next Needed", - "type": "boolean" -} - removed
Input schema / properties / revises_thoughtRemoved value: -{ - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Revises Thought" -} - added
Input schema / properties / thought / descriptionAdded value: +"Current reasoning step text. Keep this to one concrete step." - added
Input schema / properties / thought / minLengthAdded value: +1 - added
Input schema / properties / thoughtNumberAdded value: +{ + "description": "1-based sequence index for this thought. Increment for each step.", + "minimum": 1, + "title": "Thoughtnumber", + "type": "integer" +} - removed
Input schema / properties / thought_numberRemoved value: -{ - "title": "Thought Number", - "type": "integer" -} - added
Input schema / properties / totalThoughtsAdded value: +{ + "description": "Estimated total number of steps in the current reasoning plan.", + "minimum": 1, + "title": "Totalthoughts", + "type": "integer" +} - removed
Input schema / properties / total_thoughtsRemoved value: -{ - "title": "Total Thoughts", - "type": "integer" -} - changed
Input schema / requiredPrevious value: -[ - "thought", - "thought_number", - "total_thoughts", - "next_needed" -]New value: +[ + "thought", + "thoughtNumber", + "totalThoughts", + "nextThoughtNeeded", + "isRevision", + "branchFromThought", + "branchId", + "needsMoreThoughts" +] - added
Input schema / titleAdded value: +"sequentialthinkingArguments" - added
Output schema / $defsAdded value: +{ + "NextCallArguments": { + "description": "Recommended arguments for the next tool call.", + "properties": { + "needsMoreThoughts": { + "description": "Set to true only when you need to exceed totalThoughts and extend the sequence.", + "title": "Needsmorethoughts", + "type": "boolean" + }, + "nextThoughtNeeded": { + "description": "Set to true when another step should follow the next call. Set to false on the final thought.", + "title": "Nextthoughtneeded", + "type": "boolean" + }, + "thoughtNumber": { + "description": "Recommended thoughtNumber for the next tool call.", + "minimum": 1, + "title": "Thoughtnumber", + "type": "integer" + }, + "totalThoughts": { + "description": "Recommended totalThoughts for the next tool call.", + "minimum": 1, + "title": "Totalthoughts", + "type": "integer" + } + }, + "required": [ + "thoughtNumber", + "totalThoughts", + "nextThoughtNeeded", + "needsMoreThoughts" + ], + "title": "NextCallArguments", + "type": "object" + }, + "StopReason": { + "description": "Reason code for continuing or stopping thought iteration.", + "enum": [ + "next_thought_required", + "needs_more_thoughts", + "thought_sequence_complete", + "validation_error", + "processing_error", + "rate_limited", + "request_too_large", + "unexpected_error" + ], + "title": "StopReason", + "type": "string" + } +} - added
Output schema / descriptionAdded value: +"Structured control fields returned on every tool response." - added
Output schema / properties / current_thought_numberAdded value: +{ + "description": "Echo of the current thoughtNumber after normalization.", + "minimum": 1, + "title": "Current Thought Number", + "type": "integer" +} - added
Output schema / properties / next_call_argumentsAdded value: +{ + "anyOf": [ + { + "$ref": "#/$defs/NextCallArguments" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Concrete argument recommendations for the next call when the current run completes successfully and should continue." +} - added
Output schema / properties / next_thought_numberAdded value: +{ + "anyOf": [ + { + "minimum": 1, + "type": "integer" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Recommended thoughtNumber for the next call. Null means no next step is currently required.", + "title": "Next Thought Number" +} - added
Output schema / properties / parameter_usageAdded value: +{ + "additionalProperties": { + "type": "string" + }, + "description": "Contract reminders for each core parameter to keep multi-step iterations consistent.", + "title": "Parameter Usage", + "type": "object" +} - removed
Output schema / properties / resultRemoved value: -{ - "title": "Result", - "type": "string" -} - added
Output schema / properties / should_continueAdded value: +{ + "description": "If true, call sequentialthinking again. The tool is designed for multi-step reasoning loops.", + "title": "Should Continue", + "type": "boolean" +} - added
Output schema / properties / stop_reasonAdded value: +{ + "$ref": "#/$defs/StopReason", + "description": "Machine-readable reason that explains why to continue or stop." +} - added
Output schema / properties / total_thoughtsAdded value: +{ + "description": "Echo of current totalThoughts after normalization.", + "minimum": 1, + "title": "Total Thoughts", + "type": "integer" +} - changed
Output schema / requiredPrevious value: -[ - "result" -]New value: +[ + "should_continue", + "stop_reason", + "current_thought_number", + "total_thoughts", + "parameter_usage" +] - changed
Output schema / titlePrevious value: -"sequentialthinkingOutput"New value: +"SequentialThinkingStructuredContent"
1 tool update
v1.0.0- First observed
sequentialthinking
TDQS
Only one tool exists, so there is no possibility of ambiguity or confusion between tools.
With a single tool, naming consistency is inherently perfect; the name clearly describes the action.
One tool is appropriate for a focused multi-step reasoning system; the tool itself is complex and self-contained.
The tool covers the full sequential reasoning lifecycle including revision, branching, and extension, leaving no obvious gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
MCP server for building and testing AI agents with multi-model experimentation and insights.
An MCP server for deep research or task groups
Official MCP server for subfeed.app — the cloud for agents. 15+ tools for AI agents to register, build, and deploy other agents. Zero human required. Start here: subfeed.app/skill.md
Related MCP Servers
- FlicenseCqualityDmaintenanceAn MCP server implementing the Unified Cognitive Processing Framework for advanced problem-solving, creative thinking, and cognitive analysis through structured tools for knowledge mapping, recursive questioning, and perspective generation.316-
- AlicenseAqualityDmaintenanceA MCP server that implements sequential thinking protocols, provides structured problem-solving methods, decomposes complex problems into manageable steps, and supports iterative optimization and alternative reasoning paths.12Apache 2.0
- AlicenseAqualityDmaintenanceA structured problem-solving MCP server that breaks down complex tasks into sequential steps, supports iterative refinement and branching, and helps maintain context and explore alternative reasoning paths.11542MIT
- AlicenseNot gradedqualityDmaintenanceA powerful MCP server that enhances LLMs with advanced sequential thinking capabilities, supporting 19 thinking modes for structured reasoning and complex cognitive tasks.17MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/FradSer/mcp-server-mas-sequential-thinking'
If you have feedback or need assistance with the MCP directory API, please join our Discord server