[PR #7] [MERGED] fix: send startup logs to stderr to keep stdout JSON-only #7

Closed
opened 2026-02-16 02:17:31 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/mcp-server-llamacloud/pull/7
Author: @Odysseus-deep
Created: 5/6/2025
Status: Merged
Merged: 5/6/2025
Merged by: @marcusschiesser

Base: mainHead: fix/stdout-logs


📝 Commits (4)

  • 6253cff fix: send startup logs to stderr to keep stdout JSON-only
  • 0943d92 chore: fix prettier formatting in index.ts
  • 942a02c chore: ignore Morgan prompts from version control
  • 9239ee5 chore: reformat with fresh Prettier cache

📊 Changes

3 files changed (+11 additions, -5 deletions)

View changed files

.DS_Store (+0 -0)
📝 .gitignore (+3 -1)
📝 src/index.ts (+8 -4)

📄 Description

When starting the server, two log lines (Created index… and Starting MCP server…) were printed to stdout before the first JSON-RPC message. This caused Claude Desktop and other strict MCP clients to throw:

Unexpected token 'C' … is not valid JSON

This PR moves those logs to stderr, so stdout remains a valid JSON-RPC channel from the very beginning.

Closes #5.

Tested locally with:

  • Node v18.20.8 (via Homebrew, macOS)
  • Claude Desktop 1.0.9
  • Two live LlamaCloud indexes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/mcp-server-llamacloud/pull/7 **Author:** [@Odysseus-deep](https://github.com/Odysseus-deep) **Created:** 5/6/2025 **Status:** ✅ Merged **Merged:** 5/6/2025 **Merged by:** [@marcusschiesser](https://github.com/marcusschiesser) **Base:** `main` ← **Head:** `fix/stdout-logs` --- ### 📝 Commits (4) - [`6253cff`](https://github.com/run-llama/mcp-server-llamacloud/commit/6253cff1154a1abc1c2d5502a161d320803f5f09) fix: send startup logs to stderr to keep stdout JSON-only - [`0943d92`](https://github.com/run-llama/mcp-server-llamacloud/commit/0943d92a98c14ec8f395eb0aa97f5049f38f7248) chore: fix prettier formatting in index.ts - [`942a02c`](https://github.com/run-llama/mcp-server-llamacloud/commit/942a02c76e373e50a45651703747f2bf8e8f5406) chore: ignore Morgan prompts from version control - [`9239ee5`](https://github.com/run-llama/mcp-server-llamacloud/commit/9239ee5de6a85de955cc4422ab18585498ca3fe3) chore: reformat with fresh Prettier cache ### 📊 Changes **3 files changed** (+11 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `.DS_Store` (+0 -0) 📝 `.gitignore` (+3 -1) 📝 `src/index.ts` (+8 -4) </details> ### 📄 Description When starting the server, two log lines (`Created index…` and `Starting MCP server…`) were printed to stdout before the first JSON-RPC message. This caused Claude Desktop and other strict MCP clients to throw: `Unexpected token 'C' … is not valid JSON` This PR moves those logs to `stderr`, so `stdout` remains a valid JSON-RPC channel from the very beginning. Closes #5. Tested locally with: - Node v18.20.8 (via Homebrew, macOS) - Claude Desktop 1.0.9 - Two live LlamaCloud indexes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 02:17:31 -05:00
yindo closed this issue 2026-02-16 02:17:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/mcp-server-llamacloud#7