From a443af2389a48134f75b74f3c531ee192215a0f8 Mon Sep 17 00:00:00 2001 From: hukla <129692708+huklaa@users.noreply.github.com> Date: Wed, 19 Aug 2026 03:01:28 +0300 Subject: [PATCH] fix: keep MCP stdio logs off stdout --- index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.ts b/index.ts index a43205d..9201bb3 100644 --- a/index.ts +++ b/index.ts @@ -5,6 +5,11 @@ import { getGuide} from "./tools.js"; import { getGuideParams } from "./params.js"; import { fetchAndUpdateSidebar } from "./sidebar.js"; +// stdout is reserved for MCP protocol traffic when using stdio transport. +// Route application diagnostics to stderr so console.log calls in helpers +// cannot corrupt protocol messages. +console.log = console.error.bind(console); + // Initialize the server const server = new McpServer({ name: "docs-mcp",