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.
DEEPSEEK_API_KEY
(default, recommended)GROQ_API_KEY
OPENROUTER_API_KEY
GITHUB_TOKEN
ANTHROPIC_API_KEY
EXA_API_KEY
for web research capabilitiesnpx -y @smithery/cli install @FradSer/mcp-server-mas-sequential-thinking --client claude
# 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 .
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"
}
}
}
}
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"
# 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"
Once installed and configured in your MCP client:
sequentialthinking
tool becomes availableRun 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
The system employs 6 specialized thinking agents, each with a distinct cognitive perspective:
The system uses AI-driven complexity analysis to determine the optimal thinking sequence:
Single Agent (Simple questions)
Double Agent (Moderate complexity)
Triple Agent (Core thinking)
Full Sequence (Complex problems)
Four out of six agents are equipped with web research capabilities via ExaTools:
Research is optional - requires EXA_API_KEY
environment variable. The system works without it, using pure reasoning capabilities.
The server exposes a single MCP tool that processes sequential thoughts:
{
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?
}
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.
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.
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.
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"
}
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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