Fix TypeScript first server logging to stdout

This commit is contained in:
Justin Spahr-Summers 2024-11-25 16:55:24 -06:00
commit 5e019945f2
No known key found for this signature in database

View file

@ -192,7 +192,10 @@ This guide uses the OpenWeatherMap API. You'll need a free API key from [OpenWea
async run(): Promise<void> {
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");
}
}