sequential-thinking 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sequential_thinking-0.6.0/.envrc +3 -0
- sequential_thinking-0.6.0/.gitignore +6 -0
- sequential_thinking-0.6.0/CHANGELOG.md +71 -0
- sequential_thinking-0.6.0/CLAUDE.md +100 -0
- sequential_thinking-0.6.0/LICENSE +22 -0
- sequential_thinking-0.6.0/PKG-INFO +475 -0
- sequential_thinking-0.6.0/README.md +459 -0
- sequential_thinking-0.6.0/debug_mcp_connection.py +75 -0
- sequential_thinking-0.6.0/example.md +785 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/__init__.py +0 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/analysis.py +219 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/logging_conf.py +22 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/models.py +200 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/server.py +213 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/storage.py +152 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/storage_utils.py +107 -0
- sequential_thinking-0.6.0/mcp_sequential_thinking/utils.py +71 -0
- sequential_thinking-0.6.0/pyproject.toml +94 -0
- sequential_thinking-0.6.0/run_server.py +30 -0
- sequential_thinking-0.6.0/tests/__init__.py +1 -0
- sequential_thinking-0.6.0/tests/test_analysis.py +113 -0
- sequential_thinking-0.6.0/tests/test_models.py +136 -0
- sequential_thinking-0.6.0/tests/test_server.py +177 -0
- sequential_thinking-0.6.0/tests/test_storage.py +195 -0
- sequential_thinking-0.6.0/tests/test_storage_utils.py +109 -0
- sequential_thinking-0.6.0/tests/test_utils.py +63 -0
- sequential_thinking-0.6.0/uv.lock +1088 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Version 0.5.0 (Unreleased)
|
|
4
|
+
|
|
5
|
+
### Code Quality Improvements
|
|
6
|
+
|
|
7
|
+
#### 1. Separation of Test Code from Production Code
|
|
8
|
+
- Created a new `testing.py` module for test-specific utilities
|
|
9
|
+
- Implemented conditional test detection using `importlib.util`
|
|
10
|
+
- Improved code clarity by moving test-specific logic out of main modules
|
|
11
|
+
- Enhanced maintainability by clearly separating test and production code paths
|
|
12
|
+
- Replaced hardcoded test strings with named constants
|
|
13
|
+
|
|
14
|
+
#### 2. Reduced Code Duplication in Storage Layer
|
|
15
|
+
- Created a new `storage_utils.py` module with shared utility functions
|
|
16
|
+
- Implemented reusable functions for file operations and serialization
|
|
17
|
+
- Standardized error handling and backup creation
|
|
18
|
+
- Improved consistency across serialization operations
|
|
19
|
+
- Optimized resource management with cleaner context handling
|
|
20
|
+
|
|
21
|
+
#### 3. API and Data Structure Improvements
|
|
22
|
+
- Added explicit parameter for ID inclusion in `to_dict()` method
|
|
23
|
+
- Created utility module with snake_case/camelCase conversion functions
|
|
24
|
+
- Eliminated flag-based solution in favor of explicit method parameters
|
|
25
|
+
- Improved readability with clearer, more explicit list comprehensions
|
|
26
|
+
- Eliminated duplicate calculations in analysis methods
|
|
27
|
+
|
|
28
|
+
## Version 0.4.0
|
|
29
|
+
|
|
30
|
+
### Major Improvements
|
|
31
|
+
|
|
32
|
+
#### 1. Serialization & Validation with Pydantic
|
|
33
|
+
- Converted `ThoughtData` from dataclass to Pydantic model
|
|
34
|
+
- Added automatic validation with field validators
|
|
35
|
+
- Maintained backward compatibility with existing code
|
|
36
|
+
|
|
37
|
+
#### 2. Thread-Safety in Storage Layer
|
|
38
|
+
- Added file locking with `portalocker` to prevent race conditions
|
|
39
|
+
- Added thread locks to protect shared data structures
|
|
40
|
+
- Made all methods thread-safe
|
|
41
|
+
|
|
42
|
+
#### 3. Fixed Division-by-Zero in Analysis
|
|
43
|
+
- Added proper error handling in `generate_summary` method
|
|
44
|
+
- Added safe calculation of percent complete with default values
|
|
45
|
+
|
|
46
|
+
#### 4. Case-Insensitive Stage Comparison
|
|
47
|
+
- Updated `ThoughtStage.from_string` to use case-insensitive comparison
|
|
48
|
+
- Improved user experience by accepting any case for stage names
|
|
49
|
+
|
|
50
|
+
#### 5. Added UUID to ThoughtData
|
|
51
|
+
- Added a unique identifier to each thought for better tracking
|
|
52
|
+
- Maintained backward compatibility with existing code
|
|
53
|
+
|
|
54
|
+
#### 6. Consolidated Logging Setup
|
|
55
|
+
- Created a central logging configuration in `logging_conf.py`
|
|
56
|
+
- Standardized logging across all modules
|
|
57
|
+
|
|
58
|
+
#### 7. Improved Package Entry Point
|
|
59
|
+
- Cleaned up the path handling in `run_server.py`
|
|
60
|
+
- Removed redundant code
|
|
61
|
+
|
|
62
|
+
### New Dependencies
|
|
63
|
+
- Added `portalocker` for file locking
|
|
64
|
+
- Added `pydantic` for data validation
|
|
65
|
+
|
|
66
|
+
## Version 0.3.0
|
|
67
|
+
|
|
68
|
+
Initial release with basic functionality:
|
|
69
|
+
- Sequential thinking process with defined stages
|
|
70
|
+
- Thought storage and retrieval
|
|
71
|
+
- Analysis and summary generation
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# CLAUDE.md — Project Working Rules
|
|
2
|
+
|
|
3
|
+
These rules apply to every task in this repository unless the user explicitly overrides them.
|
|
4
|
+
Bias toward caution on non-trivial work; use judgment and move quickly on trivial, reversible tasks.
|
|
5
|
+
|
|
6
|
+
## Project Snapshot
|
|
7
|
+
|
|
8
|
+
This is a Python MCP server for sequential thinking tools.
|
|
9
|
+
|
|
10
|
+
Common commands:
|
|
11
|
+
|
|
12
|
+
- Run tests with coverage: `uv run --group dev pytest`
|
|
13
|
+
- Run a focused test: `uv run --group dev pytest tests/test_models.py -q`
|
|
14
|
+
- Format Python: `uv run --group dev ruff format .`
|
|
15
|
+
- Lint/fix Python: `uv run --group dev ruff check --fix .`
|
|
16
|
+
- Type check: `uv run --group dev basedpyright`
|
|
17
|
+
|
|
18
|
+
If a command is unavailable in the current environment, say so and choose the closest useful verification.
|
|
19
|
+
|
|
20
|
+
## Rule 1 — Think Before Coding
|
|
21
|
+
|
|
22
|
+
State assumptions when they affect the solution.
|
|
23
|
+
If the request is ambiguous, present the plausible interpretations and ask before making high-impact changes.
|
|
24
|
+
Push back when a simpler approach would solve the problem.
|
|
25
|
+
If confused, stop and name what is unclear.
|
|
26
|
+
|
|
27
|
+
## Rule 2 — Simplicity First
|
|
28
|
+
|
|
29
|
+
Write the minimum code that solves the stated problem.
|
|
30
|
+
Do not add speculative features, broad abstractions, or one-off frameworks.
|
|
31
|
+
Prefer boring, explicit code over clever code.
|
|
32
|
+
Test: would a senior maintainer call this overbuilt? If yes, simplify.
|
|
33
|
+
|
|
34
|
+
## Rule 3 — Surgical Changes
|
|
35
|
+
|
|
36
|
+
Touch only the files needed for the task.
|
|
37
|
+
Do not refactor, reformat, rename, or "clean up" adjacent code unless required.
|
|
38
|
+
Preserve existing style, public APIs, and behavior unless changing them is the point of the task.
|
|
39
|
+
Clean up only the mess introduced by this change.
|
|
40
|
+
|
|
41
|
+
## Rule 4 — Goal-Driven Execution
|
|
42
|
+
|
|
43
|
+
Define the success criteria before implementing.
|
|
44
|
+
Do not blindly follow a checklist; use the checklist to reach verified success.
|
|
45
|
+
Keep iterating until the success criteria are met or a blocker is surfaced.
|
|
46
|
+
|
|
47
|
+
## Rule 5 — Use Tools for Deterministic Work
|
|
48
|
+
|
|
49
|
+
Use the language model for judgment: design tradeoffs, classification, drafting, summarization, and explanation.
|
|
50
|
+
Use code, tests, search, and scripts for deterministic work: routing, counting, parsing, retries, formatting, and verification.
|
|
51
|
+
If code can answer a factual question reliably, let code answer it.
|
|
52
|
+
|
|
53
|
+
## Rule 6 — Manage Context and Token Budget
|
|
54
|
+
|
|
55
|
+
Keep each task focused.
|
|
56
|
+
If the work is becoming large, summarize the current state, decisions, and remaining work before continuing.
|
|
57
|
+
Do not silently exceed the scope implied by the request.
|
|
58
|
+
Surface when a task needs a fresh session, a separate plan, or user prioritization.
|
|
59
|
+
|
|
60
|
+
## Rule 7 — Surface Conflicts, Don't Average Them
|
|
61
|
+
|
|
62
|
+
If two patterns, requirements, or sources disagree, choose one intentionally.
|
|
63
|
+
Prefer the more local, recent, tested, or user-provided source.
|
|
64
|
+
Explain the choice briefly and flag the conflicting pattern for follow-up if needed.
|
|
65
|
+
Do not blend incompatible conventions.
|
|
66
|
+
|
|
67
|
+
## Rule 8 — Read Before Writing
|
|
68
|
+
|
|
69
|
+
Before changing code, inspect the relevant exports, immediate callers, tests, and shared utilities.
|
|
70
|
+
Do not assume a file is isolated just because it looks small.
|
|
71
|
+
If the structure seems odd, look for the reason before changing it.
|
|
72
|
+
|
|
73
|
+
## Rule 9 — Tests Verify Intent
|
|
74
|
+
|
|
75
|
+
Tests should encode why the behavior matters, not just what happens today.
|
|
76
|
+
Add or update tests when behavior changes or when fixing a bug.
|
|
77
|
+
A test that would still pass after breaking the intended behavior is not good enough.
|
|
78
|
+
|
|
79
|
+
## Rule 10 — Checkpoint on Significant Work
|
|
80
|
+
|
|
81
|
+
After each significant step, be able to state:
|
|
82
|
+
|
|
83
|
+
- What changed
|
|
84
|
+
- What was verified
|
|
85
|
+
- What remains
|
|
86
|
+
- Any uncertainty or blocker
|
|
87
|
+
|
|
88
|
+
For trivial edits, keep the checkpoint brief.
|
|
89
|
+
|
|
90
|
+
## Rule 11 — Match Repository Conventions
|
|
91
|
+
|
|
92
|
+
Conformance beats personal taste inside this codebase.
|
|
93
|
+
Follow existing naming, layout, dependency, typing, testing, and error-handling patterns.
|
|
94
|
+
If a convention appears harmful, surface it instead of silently forking the style.
|
|
95
|
+
|
|
96
|
+
## Rule 12 — Fail Loud
|
|
97
|
+
|
|
98
|
+
Do not claim completion if anything important was skipped.
|
|
99
|
+
Do not claim tests pass if tests were not run, failed, or were only partially run.
|
|
100
|
+
Report skipped verification, environmental limits, assumptions, and risks plainly.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sebastian Otaegui
|
|
4
|
+
Copyright (c) 2025 Arben Ademi
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sequential-thinking
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: A Sequential Thinking MCP Server for advanced problem solving
|
|
5
|
+
Project-URL: Source, https://github.com/feniix/mcp-sequential-thinking
|
|
6
|
+
Project-URL: Original, https://github.com/arben-adm/mcp-sequential-thinking
|
|
7
|
+
Author-email: Sebastian Otaegui <feniix@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: ai,mcp,problem-solving,sequential-thinking
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Requires-Dist: mcp>=1.27.1
|
|
13
|
+
Requires-Dist: portalocker>=3.2.0
|
|
14
|
+
Requires-Dist: pydantic>=2.13.4
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# Sequential Thinking MCP Server
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
Maintained by **Sebastian Otaegui <feniix@gmail.com>**.
|
|
22
|
+
|
|
23
|
+
This project is based on the original [`arben-adm/mcp-sequential-thinking`](https://github.com/arben-adm/mcp-sequential-thinking) project by Arben Ademi. See [Attribution](#attribution) for details.
|
|
24
|
+
|
|
25
|
+
[](https://www.python.org/downloads/)
|
|
26
|
+
[](https://opensource.org/licenses/MIT)
|
|
27
|
+
[](https://docs.astral.sh/ruff/)
|
|
28
|
+
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- **Structured Thinking Framework**: Organizes thoughts through standard cognitive stages (Problem Definition, Research, Analysis, Synthesis, Conclusion)
|
|
32
|
+
- **Thought Tracking**: Records and manages sequential thoughts with metadata
|
|
33
|
+
- **Related Thought Analysis**: Identifies connections between similar thoughts
|
|
34
|
+
- **Progress Monitoring**: Tracks your position in the overall thinking sequence
|
|
35
|
+
- **Summary Generation**: Creates concise overviews of the entire thought process
|
|
36
|
+
- **Persistent Storage**: Automatically saves your thinking sessions with thread-safety
|
|
37
|
+
- **Data Import/Export**: Share and reuse thinking sessions
|
|
38
|
+
- **Extensible Architecture**: Easily customize and extend functionality
|
|
39
|
+
- **Robust Error Handling**: Graceful handling of edge cases and corrupted data
|
|
40
|
+
- **Type Safety**: Comprehensive type annotations and validation
|
|
41
|
+
|
|
42
|
+
## Prerequisites
|
|
43
|
+
|
|
44
|
+
- Python 3.10 or higher
|
|
45
|
+
- UV package manager ([Install Guide](https://github.com/astral-sh/uv))
|
|
46
|
+
|
|
47
|
+
## Key Technologies
|
|
48
|
+
|
|
49
|
+
- **MCP Python SDK / FastMCP**: For Model Context Protocol integration
|
|
50
|
+
- **Pydantic**: For data validation and serialization
|
|
51
|
+
- **Portalocker**: For thread-safe file access
|
|
52
|
+
- **uv**: For dependency management and reproducible development environments
|
|
53
|
+
- **Ruff + basedpyright**: For linting, formatting, and strict type checking
|
|
54
|
+
|
|
55
|
+
## Project Structure
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
mcp-sequential-thinking/
|
|
59
|
+
├── mcp_sequential_thinking/
|
|
60
|
+
│ ├── server.py # Main server implementation and MCP tools
|
|
61
|
+
│ ├── models.py # Data models with Pydantic validation
|
|
62
|
+
│ ├── storage.py # Thread-safe persistence layer
|
|
63
|
+
│ ├── storage_utils.py # Shared utilities for storage operations
|
|
64
|
+
│ ├── analysis.py # Thought analysis and pattern detection
|
|
65
|
+
│ ├── utils.py # Common utilities and helper functions
|
|
66
|
+
│ ├── logging_conf.py # Centralized logging configuration
|
|
67
|
+
│ └── __init__.py # Package initialization
|
|
68
|
+
├── tests/
|
|
69
|
+
│ ├── test_analysis.py # Tests for analysis functionality
|
|
70
|
+
│ ├── test_models.py # Tests for data models
|
|
71
|
+
│ ├── test_server.py # Tests for MCP server tools
|
|
72
|
+
│ ├── test_storage.py # Tests for persistence layer
|
|
73
|
+
│ ├── test_storage_utils.py # Tests for storage utility edge cases
|
|
74
|
+
│ ├── test_utils.py # Tests for common utilities
|
|
75
|
+
│ └── __init__.py
|
|
76
|
+
├── run_server.py # Server entry point script
|
|
77
|
+
├── debug_mcp_connection.py # Utility for debugging connections
|
|
78
|
+
├── README.md # Main documentation
|
|
79
|
+
├── CHANGELOG.md # Version history and changes
|
|
80
|
+
├── example.md # Customization examples
|
|
81
|
+
├── LICENSE # MIT License
|
|
82
|
+
└── pyproject.toml # Project configuration and dependencies
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Quick Start
|
|
86
|
+
|
|
87
|
+
1. **Set Up Project**
|
|
88
|
+
```bash
|
|
89
|
+
# Create and activate virtual environment
|
|
90
|
+
uv venv
|
|
91
|
+
.venv\Scripts\activate # Windows
|
|
92
|
+
source .venv/bin/activate # Unix
|
|
93
|
+
|
|
94
|
+
# Install package and dependencies
|
|
95
|
+
uv pip install -e .
|
|
96
|
+
|
|
97
|
+
# For development with testing tools
|
|
98
|
+
uv sync --group dev
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
2. **Run the Server**
|
|
102
|
+
```bash
|
|
103
|
+
# Run directly
|
|
104
|
+
uv run -m mcp_sequential_thinking.server
|
|
105
|
+
|
|
106
|
+
# Or use the installed script
|
|
107
|
+
mcp-sequential-thinking
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
3. **Run Tests**
|
|
111
|
+
```bash
|
|
112
|
+
# Run all tests with coverage
|
|
113
|
+
uv run --group dev pytest
|
|
114
|
+
|
|
115
|
+
# Run linting and type checks
|
|
116
|
+
uv run --group dev ruff check .
|
|
117
|
+
uv run --group dev basedpyright
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Claude Desktop Integration
|
|
121
|
+
|
|
122
|
+
Add to your Claude Desktop configuration:
|
|
123
|
+
- **Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
124
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
125
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
126
|
+
|
|
127
|
+
### Option 1: Using the virtual environment (recommended for Linux/macOS)
|
|
128
|
+
|
|
129
|
+
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+):
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"sequential-thinking": {
|
|
135
|
+
"command": "/path/to/mcp-sequential-thinking/.venv/bin/python",
|
|
136
|
+
"args": [
|
|
137
|
+
"-m",
|
|
138
|
+
"mcp_sequential_thinking.server"
|
|
139
|
+
],
|
|
140
|
+
"cwd": "/path/to/mcp-sequential-thinking"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Option 2: Using uv run
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"mcpServers": {
|
|
151
|
+
"sequential-thinking": {
|
|
152
|
+
"command": "uv",
|
|
153
|
+
"args": [
|
|
154
|
+
"run",
|
|
155
|
+
"--directory",
|
|
156
|
+
"/path/to/mcp-sequential-thinking",
|
|
157
|
+
"-m",
|
|
158
|
+
"mcp_sequential_thinking.server"
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### Option 3: Using the installed entry point
|
|
166
|
+
|
|
167
|
+
If you've installed the package globally with `pip install -e .`:
|
|
168
|
+
|
|
169
|
+
```json
|
|
170
|
+
{
|
|
171
|
+
"mcpServers": {
|
|
172
|
+
"sequential-thinking": {
|
|
173
|
+
"command": "mcp-sequential-thinking"
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Option 4: Using uvx (no local install needed)
|
|
180
|
+
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"mcpServers": {
|
|
184
|
+
"sequential-thinking": {
|
|
185
|
+
"command": "uvx",
|
|
186
|
+
"args": [
|
|
187
|
+
"--from",
|
|
188
|
+
"git+https://github.com/feniix/mcp-sequential-thinking",
|
|
189
|
+
"mcp-sequential-thinking"
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Editor & IDE Integration
|
|
197
|
+
|
|
198
|
+
### Cursor
|
|
199
|
+
|
|
200
|
+
Add to your Cursor MCP configuration at `.cursor/mcp.json` in your project root (or globally at `~/.cursor/mcp.json`):
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"mcpServers": {
|
|
205
|
+
"sequential-thinking": {
|
|
206
|
+
"command": "uv",
|
|
207
|
+
"args": [
|
|
208
|
+
"run",
|
|
209
|
+
"--directory",
|
|
210
|
+
"/path/to/mcp-sequential-thinking",
|
|
211
|
+
"-m",
|
|
212
|
+
"mcp_sequential_thinking.server"
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### VS Code (Copilot MCP)
|
|
220
|
+
|
|
221
|
+
VS Code supports MCP servers since version 1.99+. Add to `.vscode/mcp.json` in your workspace or to your user `settings.json`:
|
|
222
|
+
|
|
223
|
+
```json
|
|
224
|
+
{
|
|
225
|
+
"servers": {
|
|
226
|
+
"sequential-thinking": {
|
|
227
|
+
"command": "uv",
|
|
228
|
+
"args": [
|
|
229
|
+
"run",
|
|
230
|
+
"--directory",
|
|
231
|
+
"/path/to/mcp-sequential-thinking",
|
|
232
|
+
"-m",
|
|
233
|
+
"mcp_sequential_thinking.server"
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
> **Note:** Enable MCP support in VS Code via `"chat.mcp.enabled": true` in your settings.
|
|
241
|
+
|
|
242
|
+
### Zed
|
|
243
|
+
|
|
244
|
+
Add to your Zed settings (`~/.config/zed/settings.json`):
|
|
245
|
+
|
|
246
|
+
```json
|
|
247
|
+
{
|
|
248
|
+
"context_servers": {
|
|
249
|
+
"sequential-thinking": {
|
|
250
|
+
"command": {
|
|
251
|
+
"path": "uv",
|
|
252
|
+
"args": [
|
|
253
|
+
"run",
|
|
254
|
+
"--directory",
|
|
255
|
+
"/path/to/mcp-sequential-thinking",
|
|
256
|
+
"-m",
|
|
257
|
+
"mcp_sequential_thinking.server"
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Claude Code (CLI)
|
|
266
|
+
|
|
267
|
+
Add the server using the CLI:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
claude mcp add sequential-thinking -- uv run --directory /path/to/mcp-sequential-thinking -m mcp_sequential_thinking.server
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Or manually create/edit `.mcp.json` in your project root:
|
|
274
|
+
|
|
275
|
+
```json
|
|
276
|
+
{
|
|
277
|
+
"mcpServers": {
|
|
278
|
+
"sequential-thinking": {
|
|
279
|
+
"command": "uv",
|
|
280
|
+
"args": [
|
|
281
|
+
"run",
|
|
282
|
+
"--directory",
|
|
283
|
+
"/path/to/mcp-sequential-thinking",
|
|
284
|
+
"-m",
|
|
285
|
+
"mcp_sequential_thinking.server"
|
|
286
|
+
]
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Windsurf
|
|
293
|
+
|
|
294
|
+
Add to your Windsurf MCP configuration at `~/.codeium/windsurf/mcp_config.json`:
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
{
|
|
298
|
+
"mcpServers": {
|
|
299
|
+
"sequential-thinking": {
|
|
300
|
+
"command": "uv",
|
|
301
|
+
"args": [
|
|
302
|
+
"run",
|
|
303
|
+
"--directory",
|
|
304
|
+
"/path/to/mcp-sequential-thinking",
|
|
305
|
+
"-m",
|
|
306
|
+
"mcp_sequential_thinking.server"
|
|
307
|
+
]
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### Gemini CLI
|
|
314
|
+
|
|
315
|
+
Add to your Gemini CLI settings at `~/.gemini/settings.json`:
|
|
316
|
+
|
|
317
|
+
```json
|
|
318
|
+
{
|
|
319
|
+
"mcpServers": {
|
|
320
|
+
"sequential-thinking": {
|
|
321
|
+
"type": "stdio",
|
|
322
|
+
"command": "uvx",
|
|
323
|
+
"args": [
|
|
324
|
+
"--from",
|
|
325
|
+
"git+https://github.com/feniix/mcp-sequential-thinking",
|
|
326
|
+
"mcp-sequential-thinking"
|
|
327
|
+
],
|
|
328
|
+
"env": {}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
> **Tip:** All editor configurations above use `uv run` or `uvx`. You can also point directly to the venv Python interpreter (see [Claude Desktop Option 1](#option-1-using-the-virtual-environment-recommended-for-linuxmacos)) or use `uvx` (see [Option 4](#option-4-using-uvx-no-local-install-needed)) if you prefer not to clone the repository.
|
|
335
|
+
|
|
336
|
+
# How It Works
|
|
337
|
+
|
|
338
|
+
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.
|
|
339
|
+
|
|
340
|
+
## Usage Guide
|
|
341
|
+
|
|
342
|
+
The Sequential Thinking server exposes five main tools:
|
|
343
|
+
|
|
344
|
+
### 1. `process_thought`
|
|
345
|
+
|
|
346
|
+
Records and analyzes a new thought in your sequential thinking process.
|
|
347
|
+
|
|
348
|
+
**Parameters:**
|
|
349
|
+
|
|
350
|
+
- `thought` (string): The content of your thought
|
|
351
|
+
- `thought_number` (integer): Position in your sequence (e.g., 1 for first thought)
|
|
352
|
+
- `total_thoughts` (integer): Expected total thoughts in the sequence
|
|
353
|
+
- `next_thought_needed` (boolean): Whether more thoughts are needed after this one
|
|
354
|
+
- `stage` (string): The thinking stage - must be one of:
|
|
355
|
+
- "Problem Definition"
|
|
356
|
+
- "Research"
|
|
357
|
+
- "Analysis"
|
|
358
|
+
- "Synthesis"
|
|
359
|
+
- "Conclusion"
|
|
360
|
+
- `tags` (list of strings, optional): Keywords or categories for your thought
|
|
361
|
+
- `axioms_used` (list of strings, optional): Principles or axioms applied in your thought
|
|
362
|
+
- `assumptions_challenged` (list of strings, optional): Assumptions your thought questions or challenges
|
|
363
|
+
|
|
364
|
+
**Example:**
|
|
365
|
+
|
|
366
|
+
```python
|
|
367
|
+
# First thought in a 5-thought sequence
|
|
368
|
+
process_thought(
|
|
369
|
+
thought="The problem of climate change requires analysis of multiple factors including emissions, policy, and technology adoption.",
|
|
370
|
+
thought_number=1,
|
|
371
|
+
total_thoughts=5,
|
|
372
|
+
next_thought_needed=True,
|
|
373
|
+
stage="Problem Definition",
|
|
374
|
+
tags=["climate", "global policy", "systems thinking"],
|
|
375
|
+
axioms_used=["Complex problems require multifaceted solutions"],
|
|
376
|
+
assumptions_challenged=["Technology alone can solve climate change"]
|
|
377
|
+
)
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### 2. `generate_summary`
|
|
381
|
+
|
|
382
|
+
Generates a summary of your entire thinking process.
|
|
383
|
+
|
|
384
|
+
**Example output:**
|
|
385
|
+
|
|
386
|
+
```json
|
|
387
|
+
{
|
|
388
|
+
"summary": {
|
|
389
|
+
"totalThoughts": 5,
|
|
390
|
+
"stages": {
|
|
391
|
+
"Problem Definition": 1,
|
|
392
|
+
"Research": 1,
|
|
393
|
+
"Analysis": 1,
|
|
394
|
+
"Synthesis": 1,
|
|
395
|
+
"Conclusion": 1
|
|
396
|
+
},
|
|
397
|
+
"timeline": [
|
|
398
|
+
{"number": 1, "stage": "Problem Definition"},
|
|
399
|
+
{"number": 2, "stage": "Research"},
|
|
400
|
+
{"number": 3, "stage": "Analysis"},
|
|
401
|
+
{"number": 4, "stage": "Synthesis"},
|
|
402
|
+
{"number": 5, "stage": "Conclusion"}
|
|
403
|
+
]
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### 3. `clear_history`
|
|
409
|
+
|
|
410
|
+
Resets the thinking process by clearing all recorded thoughts.
|
|
411
|
+
|
|
412
|
+
### 4. `export_session`
|
|
413
|
+
|
|
414
|
+
Exports the current thinking session to a JSON file for sharing or backup.
|
|
415
|
+
|
|
416
|
+
**Parameters:**
|
|
417
|
+
|
|
418
|
+
- `file_path` (string): Path to the output JSON file (parent directories are created automatically)
|
|
419
|
+
|
|
420
|
+
**Example:**
|
|
421
|
+
|
|
422
|
+
```python
|
|
423
|
+
export_session(file_path="/home/user/exports/my-analysis.json")
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### 5. `import_session`
|
|
427
|
+
|
|
428
|
+
Imports a previously exported thinking session from a JSON file.
|
|
429
|
+
|
|
430
|
+
**Parameters:**
|
|
431
|
+
|
|
432
|
+
- `file_path` (string): Path to the JSON file to import
|
|
433
|
+
|
|
434
|
+
## Practical Applications
|
|
435
|
+
|
|
436
|
+
- **Decision Making**: Work through important decisions methodically
|
|
437
|
+
- **Problem Solving**: Break complex problems into manageable components
|
|
438
|
+
- **Research Planning**: Structure your research approach with clear stages
|
|
439
|
+
- **Writing Organization**: Develop ideas progressively before writing
|
|
440
|
+
- **Project Analysis**: Evaluate projects through defined analytical stages
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
## Getting Started
|
|
444
|
+
|
|
445
|
+
With the proper MCP setup, simply use the `process_thought` tool to begin working through your thoughts in sequence. As you progress, you can get an overview with `generate_summary` and reset when needed with `clear_history`.
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
# Customizing the Sequential Thinking Server
|
|
450
|
+
|
|
451
|
+
For detailed examples of how to customize and extend the Sequential Thinking server, see [example.md](example.md). It includes code samples for:
|
|
452
|
+
|
|
453
|
+
- Modifying thinking stages
|
|
454
|
+
- Enhancing thought data structures with Pydantic
|
|
455
|
+
- Adding persistence with databases
|
|
456
|
+
- Implementing enhanced analysis with NLP
|
|
457
|
+
- Creating custom prompts
|
|
458
|
+
- Setting up advanced configurations
|
|
459
|
+
- Building web UI integrations
|
|
460
|
+
- Implementing visualization tools
|
|
461
|
+
- Connecting to external services
|
|
462
|
+
- Creating collaborative environments
|
|
463
|
+
- Separating test code
|
|
464
|
+
- Building reusable utilities
|
|
465
|
+
|
|
466
|
+
## Attribution
|
|
467
|
+
|
|
468
|
+
This project is maintained by Sebastian Otaegui <feniix@gmail.com>.
|
|
469
|
+
|
|
470
|
+
It is based on the original [`arben-adm/mcp-sequential-thinking`](https://github.com/arben-adm/mcp-sequential-thinking) project by Arben Ademi. The original project is also licensed under the MIT License.
|
|
471
|
+
|
|
472
|
+
## License
|
|
473
|
+
|
|
474
|
+
MIT License. See [LICENSE](LICENSE) for the full license text.
|
|
475
|
+
|