@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.
Files changed (2) hide show
  1. package/README.md +128 -31
  2. 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:** Structured reasoning engine with block-based context management (Analysis -> Planning -> Execution -> Observation).
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
- ## Usage
14
+ ---
15
15
 
16
- ### Method 1: Using `npx` (Recommended)
16
+ ## Installation & Usage
17
17
 
18
- Run the server directly without global installation. This is best for Claude Desktop or other MCP clients.
18
+ ### Method 1: Using `npx` (No Install Required)
19
19
 
20
- #### Configuration for Claude Desktop (`claude_desktop_config.json`)
20
+ Best for quick use without cloning the repo.
21
21
 
22
- To use the **Web Search** features, you must provide at least one API key.
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
- "EXA_API_KEY": "your_exa_api_key_here",
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: You only need one of the search provider keys (Brave is recommended for general use).*
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
- ### Method 2: Running Locally
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
- 1. **Install dependencies:** `npm install`
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. Handles `analysis`, `planning`, `execution`, and `observation` steps.
55
- * **`start_thinking_block`**: Start a new thinking context (e.g., switch from "Planning" to "Coding"). Helps prevent context pollution.
56
- * **`get_thinking_blocks`**: View a summary of all discussion topics/blocks.
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
- * *Requires:* `BRAVE_API_KEY` OR `EXA_API_KEY` OR (`GOOGLE_SEARCH_API_KEY` + `GOOGLE_SEARCH_CX`).
64
- * **`fetch`**: Fetch raw content from a URL (GET/POST).
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
- * **`force_rebuild_graph`**: Clears cache and rebuilds the graph from scratch.
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 of the dependency graph.
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 by description or tags.
175
+ * **`search_code_db`**: Find saved code snippets.
79
176
 
80
- ### πŸ’» System & Coding
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.24",
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",