Labsco
arben-adm logo

Sequential Thinking

β˜… 921

from arben-adm

A server that facilitates structured, progressive thinking through defined stages.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeAdvanced setup

MseeP.ai Security Assessment Badge Verified on MseeP

Sequential Thinking MCP Server

A Model Context Protocol (MCP) server that facilitates structured, progressive thinking through defined stages. This tool helps break down complex problems into sequential thoughts, track the progression of your thinking process, and generate summaries.

Python Version License: MIT Code Style: Black

<a href="https://glama.ai/mcp/servers/m83dfy8feg"><img width="380" height="200" src="https://glama.ai/mcp/servers/m83dfy8feg/badge" alt="Sequential Thinking Server MCP server" /></a>

Features

  • Structured Thinking Framework: Organizes thoughts through standard cognitive stages (Problem Definition, Research, Analysis, Synthesis, Conclusion)
  • Revisions & Branching: Revise earlier thoughts or fork alternative lines of reasoning, with revision- and branch-aware analysis and summaries
  • Thought Tracking: Records and manages sequential thoughts with metadata
  • Related Thought Analysis: Identifies connections between similar thoughts
  • Progress Monitoring: Tracks your position in the overall thinking sequence
  • Summary Generation: Creates concise overviews of the entire thought process
  • Persistent Storage: Append-only JSONL session log with thread-safety and automatic crash recovery
  • Data Import/Export: Share and reuse thinking sessions
  • Extensible Architecture: Easily customize and extend functionality
  • Robust Error Handling: Graceful handling of edge cases and corrupted data
  • Type Safety: Comprehensive type annotations and validation

Key Technologies

  • Pydantic: For data validation and serialization
  • Portalocker: For thread-safe file access
  • FastMCP: For Model Context Protocol integration

Project Structure

Copy & paste β€” that's it
mcp-sequential-thinking/
β”œβ”€β”€ mcp_sequential_thinking/
β”‚   β”œβ”€β”€ server.py       # Main server implementation and MCP tools
β”‚   β”œβ”€β”€ models.py       # Data models with Pydantic validation
β”‚   β”œβ”€β”€ storage.py      # Thread-safe persistence layer
β”‚   β”œβ”€β”€ storage_utils.py # Shared utilities for storage operations
β”‚   β”œβ”€β”€ analysis.py     # Thought analysis and pattern detection
β”‚   β”œβ”€β”€ utils.py        # Common utilities and helper functions
β”‚   β”œβ”€β”€ logging_conf.py # Centralized logging configuration
β”‚   └── __init__.py     # Package initialization
β”œβ”€β”€ tests/              
β”‚   β”œβ”€β”€ test_analysis.py # Tests for analysis functionality
β”‚   β”œβ”€β”€ test_models.py   # Tests for data models
β”‚   β”œβ”€β”€ test_storage.py  # Tests for persistence layer
β”‚   └── __init__.py
β”œβ”€β”€ run_server.py       # Server entry point script
β”œβ”€β”€ debug_mcp_connection.py # Utility for debugging connections
β”œβ”€β”€ README.md           # Main documentation
β”œβ”€β”€ CHANGELOG.md        # Version history and changes
β”œβ”€β”€ example.md          # Customization examples
β”œβ”€β”€ LICENSE             # MIT License
└── pyproject.toml      # Project configuration and dependencies

Claude Desktop Integration

Add to your Claude Desktop configuration:

  • Linux: ~/.config/Claude/claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Option 1: Using uvx with the PyPI package (recommended)

No clone, no venv, no manual updates β€” uvx fetches the package from PyPI and runs it:

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "uvx",
      "args": ["mcp-sequential-thinking"]
    }
  }
}

To test unreleased changes, point uvx at the repository instead:

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/arben-adm/mcp-sequential-thinking",
        "mcp-sequential-thinking"
      ]
    }
  }
}

Option 2: Using the installed entry point

If you've installed the package with pip install mcp-sequential-thinking (or pip install -e . from a clone):

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "mcp-sequential-thinking"
    }
  }
}

Option 3: Using a local clone's virtual environment (development)

If you have set up the project with uv venv && uv pip install -e ., point directly to the venv Python interpreter. This avoids dependency resolution issues (e.g., on systems with Python 3.14+):

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "/path/to/mcp-sequential-thinking/.venv/bin/python",
      "args": [
        "-m",
        "mcp_sequential_thinking.server"
      ],
      "cwd": "/path/to/mcp-sequential-thinking"
    }
  }
}

Option 4: Using uv run on a local clone (development)

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/path/to/mcp-sequential-thinking",
        "-m",
        "mcp_sequential_thinking.server"
      ]
    }
  }
}

Editor & IDE Integration

Cursor

Add to your Cursor MCP configuration at .cursor/mcp.json in your project root (or globally at ~/.cursor/mcp.json):

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "uvx",
      "args": ["mcp-sequential-thinking"]
    }
  }
}

VS Code (Copilot MCP)

VS Code supports MCP servers since version 1.99+. Add to .vscode/mcp.json in your workspace or to your user settings.json:

Copy & paste β€” that's it
{
  "servers": {
    "sequential-thinking": {
      "command": "uvx",
      "args": ["mcp-sequential-thinking"]
    }
  }
}

Note: Enable MCP support in VS Code via "chat.mcp.enabled": true in your settings.

Zed

Add to your Zed settings (~/.config/zed/settings.json):

Copy & paste β€” that's it
{
  "context_servers": {
    "sequential-thinking": {
      "command": {
        "path": "uvx",
        "args": ["mcp-sequential-thinking"]
      }
    }
  }
}

Claude Code (CLI)

Add the server using the CLI:

Copy & paste β€” that's it
claude mcp add sequential-thinking -- uvx mcp-sequential-thinking

Or manually create/edit .mcp.json in your project root:

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "uvx",
      "args": ["mcp-sequential-thinking"]
    }
  }
}

Windsurf

Add to your Windsurf MCP configuration at ~/.codeium/windsurf/mcp_config.json:

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "command": "uvx",
      "args": ["mcp-sequential-thinking"]
    }
  }
}

Gemini CLI

Add to your Gemini CLI settings at ~/.gemini/settings.json:

Copy & paste β€” that's it
{
  "mcpServers": {
    "sequential-thinking": {
      "type": "stdio",
      "command": "uvx",
      "args": ["mcp-sequential-thinking"],
      "env": {}
    }
  }
}

Tip: All editor configurations above run the published PyPI package via uvx. To run from a local clone instead (e.g. for development), use uv run --directory /path/to/mcp-sequential-thinking -m mcp_sequential_thinking.server or point directly to the venv Python interpreter (see Claude Desktop Options 3 and 4).

How It Works

The server maintains a history of thoughts and processes them through a structured workflow. Each thought is validated using Pydantic models, categorized into thinking stages, and stored with relevant metadata in a thread-safe storage system. The server automatically handles data persistence, backup creation, and provides tools for analyzing relationships between thoughts.

Sessions are persisted as an append-only JSONL log at ~/.mcp_sequential_thinking/current_session.jsonl (override the directory with the MCP_STORAGE_DIR environment variable). Each process_thought call appends a single fsynced line, so the file doubles as an audit trail and a truncated final line from an interrupted write is recovered automatically. Sessions from v0.5.x (current_session.json) are migrated losslessly on first start; the original file is kept as current_session.json.migrated-to-v2.

Comparison to the official sequential-thinking server

The official MCP sequential-thinking server provides the core paradigm: numbered thoughts with revisions and branching, held in memory for the duration of the process. This server implements the same paradigm and adds:

  • Persistence: sessions survive restarts (append-only JSONL log with crash recovery and automatic migration), and can be exported, shared and re-imported as JSON.
  • Thinking stages: thoughts are categorized into cognitive stages (Problem Definition, Research, Analysis, Synthesis, Conclusion), enabling stage-based filtering and completeness checks.
  • Analysis: related-thought detection via stages and tags, per-thought progress, and rich summaries including branch and revision statistics.

If you only need ephemeral chain-of-thought scaffolding, the official server is a lighter choice; if you want durable, analyzable thinking sessions, this one is built for that.

Practical Applications

  • Decision Making: Work through important decisions methodically
  • Problem Solving: Break complex problems into manageable components
  • Research Planning: Structure your research approach with clear stages
  • Writing Organization: Develop ideas progressively before writing
  • Project Analysis: Evaluate projects through defined analytical stages

License

MIT License