From 5e019945f209ed98e7064f2c2bde5c117d91afc1 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Mon, 25 Nov 2024 16:55:24 -0600 Subject: [PATCH] Fix TypeScript first server logging to stdout --- docs/first-server/typescript.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/first-server/typescript.mdx b/docs/first-server/typescript.mdx index e300b5d..18354ac 100644 --- a/docs/first-server/typescript.mdx +++ b/docs/first-server/typescript.mdx @@ -192,7 +192,10 @@ This guide uses the OpenWeatherMap API. You'll need a free API key from [OpenWea async run(): Promise { const transport = new StdioServerTransport(); await this.server.connect(transport); - console.log("Weather MCP server running on stdio"); + + // Although this is just an informative message, we must log to stderr, + // to avoid interfering with MCP communication that happens on stdout + console.error("Weather MCP server running on stdio"); } }