Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/sequentialthinking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ Add this to your `claude_desktop_config.json`:
}
```

To disable logging of thought information set env var: `DISABLE_THOUGHT_LOGGING` to `true`.
Comment

### Usage with VS Code

For quick installation, click one of the installation buttons below...
Expand Down
11 changes: 9 additions & 2 deletions src/sequentialthinking/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ interface ThoughtData {
class SequentialThinkingServer {
private thoughtHistory: ThoughtData[] = [];
private branches: Record<string, ThoughtData[]> = {};
private disableThoughtLogging: boolean;

constructor() {
this.disableThoughtLogging = (process.env.DISABLE_THOUGHT_LOGGING || "").toLowerCase() === "true";
}

private validateThoughtData(input: unknown): ThoughtData {
const data = input as Record<string, unknown>;
Expand Down Expand Up @@ -100,8 +105,10 @@ class SequentialThinkingServer {
this.branches[validatedInput.branchId].push(validatedInput);
}

const formattedThought = this.formatThought(validatedInput);
console.error(formattedThought);
if (!this.disableThoughtLogging) {
const formattedThought = this.formatThought(validatedInput);
console.error(formattedThought);
}

return {
content: [{
Expand Down