This MCP (Model Context Protocol) server implements a sophisticated sequential thinking process using multiple specialized AI agents working together to solve complex problems. It provides a more advanced approach compared to simpler state-tracking methods by utilizing coordinated agents for deeper analysis.
GROQ_API_KEY
)DEEPSEEK_API_KEY
)OPENROUTER_API_KEY
)uv
package manager (recommended) or pip
For automatic installation via Smithery for Claude Desktop:
npx -y @smithery/cli install @FradSer/mcp-server-mas-sequential-thinking --client claude
Clone the repository:
git clone [email protected]:FradSer/mcp-server-mas-sequential-thinking.git
cd mcp-server-mas-sequential-thinking
Set up environment variables in a .env
file:
# Select LLM provider (default is "deepseek")
LLM_PROVIDER="deepseek"
# API key for chosen provider
DEEPSEEK_API_KEY="your_deepseek_api_key"
# Only if using Exa for research capabilities
EXA_API_KEY="your_exa_api_key"
Install dependencies:
# Create and activate virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Using uv (recommended)
uv pip install -r requirements.txt
# Or using pip
pip install -r requirements.txt
To configure this server with your MCP client, add it to your client's configuration:
{
"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"
}
}
}
}
Start the server using one of these methods:
# Using uv (recommended)
uv --directory /path/to/mcp-server-mas-sequential-thinking run mcp-server-mas-sequential-thinking
# Or directly with Python
python main.py
The server will listen for requests via stdio, making the sequentialthinking
tool available to compatible MCP clients.
The tool accepts parameters according to the ThoughtData
model:
thought: str # Content of the current thought/step
thoughtNumber: int # Sequence number (>=1)
totalThoughts: int # Estimated total steps (>=1, suggest >=5)
nextThoughtNeeded: bool # Is another step required after this?
isRevision: bool = False # Is this revising a previous thought?
revisesThought: Optional[int] = None # If isRevision, which thought number?
branchFromThought: Optional[int] = None # If branching, from which thought?
branchId: Optional[str] = None # Unique ID for the new branch being created
needsMoreThoughts: bool = False # Signal if estimate is too low before last step
sequentialthinking
tool with the first thoughtThe tool returns a JSON response containing:
{
"processedThoughtNumber": 1,
"estimatedTotalThoughts": 5,
"nextThoughtNeeded": true,
"coordinatorResponse": "Analysis of the thought...",
"branches": ["main"],
"thoughtHistoryLength": 1,
"branchDetails": {
"currentBranchId": "main",
"branchOriginThought": null,
"allBranches": {
"main": 1
}
},
"isRevision": false,
"revisesThought": null,
"isBranch": false,
"status": "success",
"error": null
}
The tool supports complex thought patterns:
isRevision: true
and revisesThought: N
branchFromThought: N
and providing a branchId
When configured with an Exa API key, the Researcher agent can gather information from external sources to enhance the thinking process.
⚠️ This Multi-Agent System consumes significantly more tokens than single-agent alternatives due to its architecture. Each call potentially involves multiple specialist agents working in parallel, leading to 3-6x higher token usage compared to simpler approaches. The system prioritizes analysis depth and quality over token efficiency.
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 > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.