@gotza02/sequential-thinking 2026.1.26 → 2026.1.27
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 +22 -0
- package/dist/index.js +80 -0
- package/dist/lib.js +5 -0
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -49,6 +49,9 @@ The core engine for structured problem-solving. It forces a step-by-step analysi
|
|
|
49
49
|
|
|
50
50
|
**Best Practice:** Use this for ANY non-trivial task. Don't just answer; think first.
|
|
51
51
|
|
|
52
|
+
#### `clear_thought_history`
|
|
53
|
+
Clears the stored thinking history. Use this to start fresh or free up context.
|
|
54
|
+
|
|
52
55
|
### 🌐 External Knowledge
|
|
53
56
|
|
|
54
57
|
#### `web_search`
|
|
@@ -70,6 +73,12 @@ Performs a direct HTTP request to a URL. Useful for getting raw HTML, JSON, or t
|
|
|
70
73
|
- `headers`: JSON object for headers (e.g., `{"Authorization": "Bearer..."}`).
|
|
71
74
|
- `body`: Request body for POST/PUT.
|
|
72
75
|
|
|
76
|
+
#### `read_webpage`
|
|
77
|
+
Reads a webpage and converts it to clean Markdown, removing ads and navigation. Great for reading articles or documentation to save tokens.
|
|
78
|
+
|
|
79
|
+
**Inputs:**
|
|
80
|
+
- `url` (string, required): The URL to read.
|
|
81
|
+
|
|
73
82
|
### 🏗 Codebase Intelligence
|
|
74
83
|
|
|
75
84
|
#### `build_project_graph`
|
|
@@ -90,6 +99,13 @@ Zoom in on a specific file to see its context.
|
|
|
90
99
|
- `imports`: What this file needs.
|
|
91
100
|
- `importedBy`: Who relies on this file.
|
|
92
101
|
|
|
102
|
+
#### `search_code`
|
|
103
|
+
Searches for a text pattern across all code files in the project. Useful for finding usage examples or specific logic.
|
|
104
|
+
|
|
105
|
+
**Inputs:**
|
|
106
|
+
- `pattern` (string, required): Text to search for.
|
|
107
|
+
- `path` (string, optional): Root directory (defaults to `.`).
|
|
108
|
+
|
|
93
109
|
### 🛠 System Operations
|
|
94
110
|
|
|
95
111
|
#### `read_file`
|
|
@@ -198,6 +214,12 @@ npm run build
|
|
|
198
214
|
npm test
|
|
199
215
|
```
|
|
200
216
|
|
|
217
|
+
## Recent Updates (v2026.1.27)
|
|
218
|
+
- **New Tools**:
|
|
219
|
+
- `read_webpage`: Convert webpages to Markdown for efficient reading.
|
|
220
|
+
- `search_code`: Recursive text search in code files.
|
|
221
|
+
- `clear_thought_history`: Reset the thinking process.
|
|
222
|
+
|
|
201
223
|
## Recent Updates (v2026.1.26)
|
|
202
224
|
|
|
203
225
|
- **Rate Limiting**:
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,10 @@ import * as fs from 'fs/promises';
|
|
|
7
7
|
import { exec } from 'child_process';
|
|
8
8
|
import { promisify } from 'util';
|
|
9
9
|
import { ProjectKnowledgeGraph } from './graph.js';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
import { JSDOM } from 'jsdom';
|
|
12
|
+
import { Readability } from '@mozilla/readability';
|
|
13
|
+
import TurndownService from 'turndown';
|
|
10
14
|
const execAsync = promisify(exec);
|
|
11
15
|
const server = new McpServer({
|
|
12
16
|
name: "sequential-thinking-server",
|
|
@@ -314,6 +318,82 @@ async function runServer() {
|
|
|
314
318
|
await server.connect(transport);
|
|
315
319
|
console.error("Sequential Thinking MCP Server (Extended) running on stdio");
|
|
316
320
|
}
|
|
321
|
+
// --- New Tools v2026.1.27 ---
|
|
322
|
+
// 9. read_webpage
|
|
323
|
+
server.tool("read_webpage", "Read a webpage and convert it to clean Markdown (removes ads, navs, etc.).", {
|
|
324
|
+
url: z.string().url().describe("The URL to read")
|
|
325
|
+
}, async ({ url }) => {
|
|
326
|
+
try {
|
|
327
|
+
const response = await fetch(url);
|
|
328
|
+
const html = await response.text();
|
|
329
|
+
const doc = new JSDOM(html, { url });
|
|
330
|
+
const reader = new Readability(doc.window.document);
|
|
331
|
+
const article = reader.parse();
|
|
332
|
+
if (!article)
|
|
333
|
+
throw new Error("Could not parse article content");
|
|
334
|
+
const turndownService = new TurndownService();
|
|
335
|
+
const markdown = turndownService.turndown(article.content || "");
|
|
336
|
+
return {
|
|
337
|
+
content: [{
|
|
338
|
+
type: "text",
|
|
339
|
+
text: `Title: ${article.title}\n\n${markdown}`
|
|
340
|
+
}]
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
return {
|
|
345
|
+
content: [{ type: "text", text: `Read Error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
346
|
+
isError: true
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
// 10. search_code
|
|
351
|
+
server.tool("search_code", "Search for a text pattern in project files (excludes node_modules, etc.).", {
|
|
352
|
+
pattern: z.string().describe("The text to search for"),
|
|
353
|
+
path: z.string().optional().default('.').describe("Root directory to search")
|
|
354
|
+
}, async ({ pattern, path: searchPath }) => {
|
|
355
|
+
try {
|
|
356
|
+
async function searchDir(dir) {
|
|
357
|
+
const results = [];
|
|
358
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
359
|
+
for (const entry of entries) {
|
|
360
|
+
const fullPath = path.join(dir, entry.name);
|
|
361
|
+
if (entry.isDirectory()) {
|
|
362
|
+
if (['node_modules', '.git', 'dist', 'coverage', '.gemini'].includes(entry.name))
|
|
363
|
+
continue;
|
|
364
|
+
results.push(...await searchDir(fullPath));
|
|
365
|
+
}
|
|
366
|
+
else if (/\.(ts|js|json|md|txt|html|css|py|java|c|cpp|h|rs|go)$/.test(entry.name)) {
|
|
367
|
+
const content = await fs.readFile(fullPath, 'utf-8');
|
|
368
|
+
if (content.includes(pattern)) {
|
|
369
|
+
results.push(fullPath);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return results;
|
|
374
|
+
}
|
|
375
|
+
const matches = await searchDir(path.resolve(searchPath || '.'));
|
|
376
|
+
return {
|
|
377
|
+
content: [{
|
|
378
|
+
type: "text",
|
|
379
|
+
text: matches.length > 0 ? `Found "${pattern}" in:\n${matches.join('\n')}` : `No matches found for "${pattern}"`
|
|
380
|
+
}]
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
return {
|
|
385
|
+
content: [{ type: "text", text: `Search Error: ${error instanceof Error ? error.message : String(error)}` }],
|
|
386
|
+
isError: true
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
// 11. clear_thought_history
|
|
391
|
+
server.tool("clear_thought_history", "Clear the sequential thinking history.", {}, async () => {
|
|
392
|
+
await thinkingServer.clearHistory();
|
|
393
|
+
return {
|
|
394
|
+
content: [{ type: "text", text: "Thought history cleared." }]
|
|
395
|
+
};
|
|
396
|
+
});
|
|
317
397
|
runServer().catch((error) => {
|
|
318
398
|
console.error("Fatal error running server:", error);
|
|
319
399
|
process.exit(1);
|
package/dist/lib.js
CHANGED
|
@@ -38,6 +38,11 @@ export class SequentialThinkingServer {
|
|
|
38
38
|
console.error(`Error saving history to ${this.storagePath}:`, error);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
async clearHistory() {
|
|
42
|
+
this.thoughtHistory = [];
|
|
43
|
+
this.branches = {};
|
|
44
|
+
await this.saveHistory();
|
|
45
|
+
}
|
|
41
46
|
addToMemory(input) {
|
|
42
47
|
if (input.thoughtNumber > input.totalThoughts) {
|
|
43
48
|
input.totalThoughts = input.thoughtNumber;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gotza02/sequential-thinking",
|
|
3
|
-
"version": "2026.1.
|
|
3
|
+
"version": "2026.1.27",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,12 +29,17 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.24.0",
|
|
32
|
+
"@mozilla/readability": "^0.6.0",
|
|
32
33
|
"chalk": "^5.3.0",
|
|
34
|
+
"jsdom": "^27.4.0",
|
|
35
|
+
"turndown": "^7.2.2",
|
|
33
36
|
"typescript": "^5.3.3",
|
|
34
37
|
"yargs": "^17.7.2"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
40
|
+
"@types/jsdom": "^27.0.0",
|
|
37
41
|
"@types/node": "^22",
|
|
42
|
+
"@types/turndown": "^5.0.6",
|
|
38
43
|
"@types/yargs": "^17.0.32",
|
|
39
44
|
"@vitest/coverage-v8": "^2.1.8",
|
|
40
45
|
"shx": "^0.3.4",
|