diff --git a/src/sequentialthinking/README.md b/src/sequentialthinking/README.md index d7a03dca05..fd90b9b111 100644 --- a/src/sequentialthinking/README.md +++ b/src/sequentialthinking/README.md @@ -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... diff --git a/src/sequentialthinking/index.ts b/src/sequentialthinking/index.ts index c10301d707..bd486fdbb0 100644 --- a/src/sequentialthinking/index.ts +++ b/src/sequentialthinking/index.ts @@ -25,6 +25,11 @@ interface ThoughtData { class SequentialThinkingServer { private thoughtHistory: ThoughtData[] = []; private branches: Record = {}; + private disableThoughtLogging: boolean; + + constructor() { + this.disableThoughtLogging = (process.env.DISABLE_THOUGHT_LOGGING || "").toLowerCase() === "true"; + } private validateThoughtData(input: unknown): ThoughtData { const data = input as Record; @@ -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: [{