@gotza02/sequential-thinking 2026.2.24 β 2026.2.26
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.
- package/README.md +128 -31
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -4,23 +4,52 @@ A comprehensive Model Context Protocol (MCP) server that empowers AI models with
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **π§ Sequential Thinking:**
|
|
7
|
+
- **π§ Sequential Thinking Engine:** A structured reasoning system that forces the AI to think before acting, using a rigorous `Analysis -> Planning -> Execution -> Observation` loop.
|
|
8
8
|
- **π Web Research:** Built-in web search (Brave, Exa, Google) and webpage reading with ad-blocking/markdown conversion.
|
|
9
9
|
- **πΈοΈ Project Knowledge Graph:** Automatically scans and maps code dependencies (imports/exports) to understand project architecture.
|
|
10
|
-
- **π Persistent Notes:** Save and retrieve long-term project notes.
|
|
11
|
-
- **πΎ Code Database:** Store and search reusable code snippets.
|
|
10
|
+
- **π Persistent Notes:** Save and retrieve long-term project notes and facts.
|
|
11
|
+
- **πΎ Code Database:** Store and search reusable code snippets and architectural patterns.
|
|
12
12
|
- **π οΈ File & Code Tools:** Safe file operations and code analysis utilities.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
---
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
## Installation & Usage
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
### Method 1: Using `npx` (No Install Required)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Best for quick use without cloning the repo.
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
```bash
|
|
23
|
+
npx -y @gotza02/sequential-thinking
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Method 2: Running from Source (Local)
|
|
27
|
+
|
|
28
|
+
If you have cloned this repository, we provide a `smartagent` script for easy execution.
|
|
29
|
+
|
|
30
|
+
1. **Install dependencies:**
|
|
31
|
+
```bash
|
|
32
|
+
npm install
|
|
33
|
+
npm run build
|
|
34
|
+
```
|
|
35
|
+
2. **Run directly:**
|
|
36
|
+
```bash
|
|
37
|
+
./smartagent
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Client Configuration
|
|
23
43
|
|
|
44
|
+
To use this server with your AI client (Claude Desktop, Gemini CLI, etc.), add the following configuration.
|
|
45
|
+
|
|
46
|
+
### 1. Claude Desktop
|
|
47
|
+
|
|
48
|
+
**Config File Location:**
|
|
49
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
50
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
51
|
+
|
|
52
|
+
**Configuration (NPX - Recommended):**
|
|
24
53
|
```json
|
|
25
54
|
{
|
|
26
55
|
"mcpServers": {
|
|
@@ -30,55 +59,122 @@ To use the **Web Search** features, you must provide at least one API key.
|
|
|
30
59
|
"-y",
|
|
31
60
|
"@gotza02/sequential-thinking"
|
|
32
61
|
],
|
|
62
|
+
"env": {
|
|
63
|
+
"BRAVE_API_KEY": "your_brave_api_key_here"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Configuration (Local Source):**
|
|
71
|
+
```json
|
|
72
|
+
{
|
|
73
|
+
"mcpServers": {
|
|
74
|
+
"sequential-thinking": {
|
|
75
|
+
"command": "node",
|
|
76
|
+
"args": [
|
|
77
|
+
"/absolute/path/to/thinking/dist/index.js"
|
|
78
|
+
],
|
|
79
|
+
"env": {
|
|
80
|
+
"BRAVE_API_KEY": "your_brave_api_key_here"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2. Gemini CLI
|
|
88
|
+
|
|
89
|
+
For Gemini CLI tools that support MCP (often via a `config.json` or `mcp_config.json`):
|
|
90
|
+
|
|
91
|
+
**Config File Location:**
|
|
92
|
+
- Typically `~/.gemini/config.json` or check your specific CLI's documentation.
|
|
93
|
+
|
|
94
|
+
**Configuration:**
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"mcpServers": {
|
|
98
|
+
"smartagent": {
|
|
99
|
+
"command": "node",
|
|
100
|
+
"args": [
|
|
101
|
+
"/absolute/path/to/thinking/dist/index.js"
|
|
102
|
+
],
|
|
33
103
|
"env": {
|
|
34
104
|
"BRAVE_API_KEY": "your_brave_api_key_here",
|
|
35
|
-
"
|
|
36
|
-
"GOOGLE_SEARCH_API_KEY": "your_google_api_key",
|
|
37
|
-
"GOOGLE_SEARCH_CX": "your_google_cx_id"
|
|
105
|
+
"THOUGHTS_STORAGE_PATH": "/absolute/path/to/thoughts.json"
|
|
38
106
|
}
|
|
39
107
|
}
|
|
40
108
|
}
|
|
41
109
|
}
|
|
42
110
|
```
|
|
43
|
-
*Note:
|
|
111
|
+
*Note: Replace `/absolute/path/to/...` with the actual full paths on your system.*
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## π§ How to Use Sequential Thinking
|
|
116
|
+
|
|
117
|
+
This server forces a "Thick Thinking" approach. The AI should not just execute tools randomly but follow a strict cognitive loop.
|
|
118
|
+
|
|
119
|
+
### The Core Loop (Interleaved Thinking)
|
|
120
|
+
|
|
121
|
+
The correct workflow for solving complex problems is:
|
|
122
|
+
|
|
123
|
+
1. **π Analysis:** Understand the user's request, break it down, and identify what is missing.
|
|
124
|
+
2. **π Planning:** Decide *exactly* which tool to call next and why.
|
|
125
|
+
3. **β‘ Execution:** Declare the intent to call a tool (e.g., "I will read file X").
|
|
126
|
+
4. **[Tool Call]**: The actual MCP tool (e.g., `read_file`, `web_search`) is executed.
|
|
127
|
+
5. **ποΈ Observation:** Analyze the *output* of the tool. Did it work? What did we learn?
|
|
128
|
+
6. **π Reflexion:** (Optional) Critique the progress. Are we on track?
|
|
129
|
+
|
|
130
|
+
### Thought Types
|
|
131
|
+
|
|
132
|
+
When using the `sequentialthinking` tool, you must specify a `thoughtType`:
|
|
133
|
+
|
|
134
|
+
| Type | Description |
|
|
135
|
+
| :--- | :--- |
|
|
136
|
+
| **`analysis`** | Initial problem breakdown or re-evaluating the situation. |
|
|
137
|
+
| **`planning`** | Formulating a plan or next steps. **ALWAYS plan before executing.** |
|
|
138
|
+
| **`execution`** | Stating the action to be taken. Set `relatedToolCall` to the tool name. |
|
|
139
|
+
| **`observation`** | analyzing tool output. **MANDATORY after every tool call.** |
|
|
140
|
+
| **`hypothesis`** | Formulating a theory to test (e.g., "I suspect the bug is in auth.ts"). |
|
|
141
|
+
| **`reflexion`** | Self-correction or review. Use this if stuck. |
|
|
142
|
+
| **`solution`** | The final answer or completion of the task. |
|
|
143
|
+
|
|
144
|
+
### Best Practices
|
|
44
145
|
|
|
45
|
-
|
|
146
|
+
* **One Step at a Time:** Do not chain 10 thoughts in one go. Think -> Tool -> Observe -> Think.
|
|
147
|
+
* **Use Blocks:** When switching topics (e.g., from "Research" to "Coding"), use `start_thinking_block` to reset context and avoid loop detection errors.
|
|
148
|
+
* **Branching:** If a solution fails, don't keep trying the same thing. Use the `branchFromThought` parameter to "fork" your thinking process from an earlier point and try a different approach.
|
|
46
149
|
|
|
47
|
-
|
|
48
|
-
2. **Build:** `npm run build`
|
|
49
|
-
3. **Config:** Point to the built `dist/index.js` file.
|
|
150
|
+
---
|
|
50
151
|
|
|
51
152
|
## π§° Complete Tool List
|
|
52
153
|
|
|
53
154
|
### π§ Core Thinking
|
|
54
|
-
* **`sequentialthinking`**: The main engine for problem-solving.
|
|
55
|
-
* **`start_thinking_block`**: Start a new thinking context
|
|
56
|
-
* **`
|
|
57
|
-
* **`summarize_history`**: Compress past thoughts to save token space.
|
|
155
|
+
* **`sequentialthinking`**: The main engine for problem-solving.
|
|
156
|
+
* **`start_thinking_block`**: Start a new thinking context/topic.
|
|
157
|
+
* **`summarize_history`**: Compress past thoughts to save context window.
|
|
58
158
|
* **`search_thoughts`**: Search through your thinking history.
|
|
59
159
|
* **`clear_thought_history`**: Reset the thinking state completely.
|
|
60
160
|
|
|
61
161
|
### π Web & Research (Requires API Keys)
|
|
62
|
-
* **`web_search`**: Search the internet.
|
|
63
|
-
|
|
64
|
-
* **`fetch`**: Fetch raw content from a URL
|
|
65
|
-
* **`read_webpage`**: Download a webpage and convert it to clean Markdown (removes ads/clutter).
|
|
162
|
+
* **`web_search`**: Search the internet (Brave, Exa, Google).
|
|
163
|
+
* **`read_webpage`**: Download a webpage and convert it to clean Markdown.
|
|
164
|
+
* **`fetch`**: Fetch raw content from a URL.
|
|
66
165
|
|
|
67
166
|
### πΈοΈ Project Knowledge Graph
|
|
68
167
|
* **`build_project_graph`**: Scans the current directory to map file dependencies.
|
|
69
|
-
* **`
|
|
70
|
-
* **`get_file_relationships`**: Shows what a specific file imports and what imports it.
|
|
168
|
+
* **`get_file_relationships`**: Shows imports/exports for a specific file.
|
|
71
169
|
* **`get_project_graph_summary`**: High-level stats of the project structure.
|
|
72
|
-
* **`get_project_graph_visualization`**: Generates a Mermaid diagram
|
|
170
|
+
* **`get_project_graph_visualization`**: Generates a Mermaid diagram.
|
|
73
171
|
|
|
74
172
|
### π Notes & Memory
|
|
75
173
|
* **`manage_notes`**: Create, read, update, or delete persistent notes.
|
|
76
|
-
* **`list_notes`**: List all saved notes.
|
|
77
174
|
* **`add_code_snippet`**: Save a useful piece of code to the database.
|
|
78
|
-
* **`search_code_db`**: Find saved code snippets
|
|
175
|
+
* **`search_code_db`**: Find saved code snippets.
|
|
79
176
|
|
|
80
|
-
|
|
81
|
-
* (Include standard file system tools provided by the server context, typically `read_file`, `write_file`, etc., if exposed via this MCP, though often provided by the client itself. This server provides specialized graph/analysis tools.)
|
|
177
|
+
---
|
|
82
178
|
|
|
83
179
|
## Configuration Variables
|
|
84
180
|
|
|
@@ -90,6 +186,7 @@ To use the **Web Search** features, you must provide at least one API key.
|
|
|
90
186
|
| `GOOGLE_SEARCH_CX` | Google Custom Search Engine ID | `web_search` (Provider: Google) |
|
|
91
187
|
| `THOUGHTS_STORAGE_PATH` | Path to save thinking history (default: `thoughts_history.json`) | Persistence |
|
|
92
188
|
| `NOTES_STORAGE_PATH` | Path to save notes (default: `project_notes.json`) | Persistence |
|
|
189
|
+
| `DISABLE_THOUGHT_LOGGING` | Set to `true` to hide thoughts in console output | Optional |
|
|
93
190
|
|
|
94
191
|
## License
|
|
95
192
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gotza02/sequential-thinking",
|
|
3
|
-
"version": "2026.2.
|
|
3
|
+
"version": "2026.2.26",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"main": "dist/index.js",
|
|
19
19
|
"types": "dist/index.d.ts",
|
|
20
20
|
"bin": {
|
|
21
|
-
"mcp-server-sequential-thinking": "dist/index.js"
|
|
21
|
+
"mcp-server-sequential-thinking": "dist/index.js",
|
|
22
|
+
"smartagent": "dist/index.js"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
25
|
"dist",
|