Skip to main content
Glama
sequential-thinking-mcp

sequential-thinking-mcp

by philogicae

Sequential Thinking MCP

uv Python PyPI Actions status License: MIT Ask DeepWiki

This repository provides an MCP (Model Context Protocol) server that enables an AI agent to perform advanced meta-cognition and dynamic, reflective problem-solving.

This version of Sequential Thinking is quite different than the original one, as it only forces the agent to virtually log its thoughts and plans, without actually doing anything, except prompting itself. I found it to be sufficient enough for any kind of LLMs.

Table of Contents

Related MCP server: Root Signals MCP Server

Features

  • Advanced Meta-Cognition: Provides a think tool for dynamic and reflective problem-solving through thought logging.

  • Agentic Workflow Orchestration: Guides AI agents through complex tasks by breaking them into precise, manageable, and traceable steps.

  • Iterative Refinement: Assesses the success of each step and self-corrects if necessary, adapting to new information or errors.

  • Proactive Planning: Utilizes left_to_be_done for explicit future state management and task estimation.

  • Tool Recommendation: Suggests specific tools via tool_recommendation to execute planned actions or gather necessary information.

Setup

Prerequisites

  • Python 3.10+

  • uv (for local development)

Installation

Choose one of the following installation methods.

This method is best for using the package as a library or running the server without modifying the code.

  1. Install the package from PyPI:

pip install sequential-thinking-mcp
  1. Run the MCP server (default: stdio):

python -m sequential_thinking

For Local Development

This method is for contributors who want to modify the source code. Using uv:

  1. Clone the repository:

git clone https://github.com/philogicae/sequential-thinking-mcp.git
cd sequential-thinking-mcp
  1. Install dependencies using uv:

uv sync --locked
  1. Run the MCP server (default: stdio):

uv run -m sequential_thinking

For Docker

  1. Clone the repository (if you haven't already):

git clone https://github.com/philogicae/sequential-thinking-mcp.git
cd sequential-thinking-mcp
  1. Build and run the container using Docker Compose (default port: 8000):

docker compose up --build -d
  1. Access container logs:

docker logs sequential-thinking-mcp -f

Usage

As MCP Server

from sequential_thinking import mcp

mcp.run(transport="sse")

Via MCP Clients

Usable with any MCP-compatible client. Available tools:

  • think: Log a thought, plan next steps, and recommend tools.

Example with Windsurf

Configuration:

{
  "mcpServers": {
    ...
    # with stdio (only requires uv)
    "sequential-thinking-mcp": {
      "command": "uvx",
      "args": [ "sequential-thinking-mcp" ]
    },
    # with docker (only requires docker)
    "sequential-thinking-mcp": {
      "command": "docker",
      "args": [ "run", "-i", "-p", "8000:8000", "philogicae/sequential-thinking-mcp:latest", "sequential-thinking-mcp" ]
    },
    # with sse transport (requires installation)
    "sequential-thinking-mcp": {
      "serverUrl": "http://127.0.0.1:8000/sse"
    },
    # with streamable-http transport (requires installation)
    "sequential-thinking-mcp": {
      "serverUrl": "http://127.0.0.1:8000/mcp" # not yet supported by every client
    },
    ...
  }
}

Changelog

See CHANGELOG.md for a history of changes to this project.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Available Tools

1 tool
thinkA

Logs a thought step for agentic problem-solving, tracking reasoning, tools, and future plans. Start a new thread for each user message.

Capabilities

  • Workflow Orchestration: Breaks complex tasks into manageable steps.

  • Iterative Refinement: Self-corrects based on new info or errors.

  • Tool Recommendation: Suggests specific tools for the next action.

  • Forward Planning: Tracks remaining tasks via left_to_be_done.

Args: thread_purpose: Short objective/topic for the thread. thought: Current reasoning or action description. thought_index: Monotonically increasing step number (1, 2, 3...). tool_recommendation: Tool to call next, or 'None'. left_to_be_done: Remaining steps/sub-goals, or 'None'. Returns: Confirmation of log.

Example

  1. User: "I keep hearing about central banks, but I don't understand what they are and how they work."

  2. think( thread_purpose="Explain Central Banks", thought="The user needs a comprehensive explanation of central banks. I need to identify their core definition, key roles (monetary policy, financial stability, currency issuance), and operational mechanisms (interest rates, reserves). I should search for a structured overview to ensure I don't miss major aspects like the Federal Reserve or ECB as examples.", thought_index=1, tool_recommendation="search_web", left_to_be_done="1. Search for 'how central banks work' and key functions. 2. Synthesize findings into a clear explanation. 3. Create a visual graph of the banking system structure if possible. 4. Present final answer." )

  3. call search_web(query="how central banks work and their main functions")

  4. think( thread_purpose="Explain Central Banks", thought="Search results clarify that central banks manage currency stability, control inflation via interest rates, and act as lenders of last resort. I have enough textual information. Now, to make this easier to understand, I should create a graph representing the flow of money and influence between the central bank, commercial banks, and the economy.", thought_index=2, tool_recommendation="create_graph", left_to_be_done="Create a graph showing Central Bank -> Commercial Banks -> Public/Economy relations." )

  5. call create_graph(data=...)

  6. Final Response: "Here is an explanation of central banks..." (Task complete, no further think call needed).

Inputs: thread_purpose (required), thought (required), thought_index (required), tool_recommendation, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.6/5.0

    Scored across 1 tool

    Disambiguation5/5

    Only one tool exists, so there is no possibility of confusion with other tools. The tool's purpose is clearly unique.

    Naming Consistency5/5

    With a single tool named 'think', there is no inconsistency. The name is a clear verb describing the action.

    Tool Count5/5

    One tool is perfect for this server's focused purpose—tracking reasoning steps. It fits seamlessly into larger agent workflows without unnecessary complexity.

    Completeness5/5

    The tool fully covers the intended functionality: logging thought steps. No additional operations are needed for the given domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers