@gotza02/sequential-thinking 2026.2.25 β 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 +60 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,13 +4,15 @@ 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
|
+
---
|
|
15
|
+
|
|
14
16
|
## Installation & Usage
|
|
15
17
|
|
|
16
18
|
### Method 1: Using `npx` (No Install Required)
|
|
@@ -35,9 +37,11 @@ If you have cloned this repository, we provide a `smartagent` script for easy ex
|
|
|
35
37
|
./smartagent
|
|
36
38
|
```
|
|
37
39
|
|
|
40
|
+
---
|
|
41
|
+
|
|
38
42
|
## Client Configuration
|
|
39
43
|
|
|
40
|
-
To use this server with your AI client (Claude Desktop, Gemini CLI, etc.), add the following configuration
|
|
44
|
+
To use this server with your AI client (Claude Desktop, Gemini CLI, etc.), add the following configuration.
|
|
41
45
|
|
|
42
46
|
### 1. Claude Desktop
|
|
43
47
|
|
|
@@ -82,7 +86,7 @@ To use this server with your AI client (Claude Desktop, Gemini CLI, etc.), add t
|
|
|
82
86
|
|
|
83
87
|
### 2. Gemini CLI
|
|
84
88
|
|
|
85
|
-
|
|
89
|
+
For Gemini CLI tools that support MCP (often via a `config.json` or `mcp_config.json`):
|
|
86
90
|
|
|
87
91
|
**Config File Location:**
|
|
88
92
|
- Typically `~/.gemini/config.json` or check your specific CLI's documentation.
|
|
@@ -104,40 +108,73 @@ If you are using a Gemini CLI tool that supports MCP (often via a `config.json`
|
|
|
104
108
|
}
|
|
105
109
|
}
|
|
106
110
|
```
|
|
107
|
-
|
|
108
111
|
*Note: Replace `/absolute/path/to/...` with the actual full paths on your system.*
|
|
109
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
|
|
145
|
+
|
|
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.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
110
152
|
## π§° Complete Tool List
|
|
111
153
|
|
|
112
154
|
### π§ Core Thinking
|
|
113
|
-
* **`sequentialthinking`**: The main engine for problem-solving.
|
|
114
|
-
* **`start_thinking_block`**: Start a new thinking context
|
|
115
|
-
* **`
|
|
116
|
-
* **`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.
|
|
117
158
|
* **`search_thoughts`**: Search through your thinking history.
|
|
118
159
|
* **`clear_thought_history`**: Reset the thinking state completely.
|
|
119
160
|
|
|
120
161
|
### π Web & Research (Requires API Keys)
|
|
121
|
-
* **`web_search`**: Search the internet.
|
|
122
|
-
|
|
123
|
-
* **`fetch`**: Fetch raw content from a URL
|
|
124
|
-
* **`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.
|
|
125
165
|
|
|
126
166
|
### πΈοΈ Project Knowledge Graph
|
|
127
167
|
* **`build_project_graph`**: Scans the current directory to map file dependencies.
|
|
128
|
-
* **`
|
|
129
|
-
* **`get_file_relationships`**: Shows what a specific file imports and what imports it.
|
|
168
|
+
* **`get_file_relationships`**: Shows imports/exports for a specific file.
|
|
130
169
|
* **`get_project_graph_summary`**: High-level stats of the project structure.
|
|
131
|
-
* **`get_project_graph_visualization`**: Generates a Mermaid diagram
|
|
170
|
+
* **`get_project_graph_visualization`**: Generates a Mermaid diagram.
|
|
132
171
|
|
|
133
172
|
### π Notes & Memory
|
|
134
173
|
* **`manage_notes`**: Create, read, update, or delete persistent notes.
|
|
135
|
-
* **`list_notes`**: List all saved notes.
|
|
136
174
|
* **`add_code_snippet`**: Save a useful piece of code to the database.
|
|
137
|
-
* **`search_code_db`**: Find saved code snippets
|
|
175
|
+
* **`search_code_db`**: Find saved code snippets.
|
|
138
176
|
|
|
139
|
-
|
|
140
|
-
* (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
|
+
---
|
|
141
178
|
|
|
142
179
|
## Configuration Variables
|
|
143
180
|
|
|
@@ -149,7 +186,8 @@ If you are using a Gemini CLI tool that supports MCP (often via a `config.json`
|
|
|
149
186
|
| `GOOGLE_SEARCH_CX` | Google Custom Search Engine ID | `web_search` (Provider: Google) |
|
|
150
187
|
| `THOUGHTS_STORAGE_PATH` | Path to save thinking history (default: `thoughts_history.json`) | Persistence |
|
|
151
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 |
|
|
152
190
|
|
|
153
191
|
## License
|
|
154
192
|
|
|
155
|
-
MIT
|
|
193
|
+
MIT
|