mirror of
https://github.com/run-llama/mcp-server-llamacloud.git
synced 2026-06-30 20:47:54 -04:00
mcp‑server‑llamacloud 0.1.1 prints non‑JSON logs to stdout → Claude Desktop “Unexpected token … is not valid JSON” #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Odysseus-deep on GitHub (May 2, 2025).
When starting @llamaindex/mcp-server-llamacloud@0.1.1, the server writes two plain‑text lines (“Created …”, “Starting MCP …”) to stdout before the first JSON‑RPC message. Claude Desktop expects a pure JSON stream and immediately throws Unexpected token parse errors, then disconnects.
Versions
mcp‑server‑llamacloud: 0.1.1 (latest on npm)
Node.js: v18.19.1
OS: macOS 14.4 (Apple Silicon)
Claude Desktop: 1.0.9
Steps to reproduce
Run the server exactly as Claude Desktop does:
LLAMA_CLOUD_PROJECT_NAME=Default \ LLAMA_CLOUD_API_KEY=llx-***redacted*** \ npx -y @llamaindex/mcp-server-llamacloud@0.1.1 \ --index Castoretpollux-talents-a --description "premiere base de CV" \ --index Castoretpollux-talents-b --description "Deuxieme base de CV"Observe the first two lines printed to stdout:
Created index tool for tool-a Starting MCP server…Claude Desktop immediately shows
Unexpected token 'C', "Created in"... is not valid JSON
and the connection drops
Actual behaviour
Two non‑JSON log lines are emitted on stdout.
Claude fails to parse them, raises an error, and disconnects.
Expected behaviour
All log lines should go to stderr.
stdout should contain only valid JSON‑RPC objects so that Claude (or any MCP client) can parse the stream.
Minimal log (stdout)
Created index tool for Castoretpollux-talents-a Starting MCP server… {"jsonrpc":"2.0","method":"mcp-bootstrap","params":{ … } }Environment
node -v # v18.19.1 npm view @llamaindex/mcp-server-llamacloud version # 0.1.1 uname -a # Darwin arm64 23.4.0Suggested fix
Move the two informational console.log statements to process.stderr (or remove them) so that stdout remains a valid JSON‑RPC channel.
Happy to open a PR if that helps.
@marcusschiesser commented on GitHub (May 6, 2025):
Great catch @Odysseus-deep thanks for finding this - want to send a PR?