MCP server corrupts stdio stream with console.log output
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu bằng cách tìm kiếm các vị trí console.log đã nêu trong bốn tệp bị ảnh hưởng—src/embeddings.ts, src/indexer.ts, src/conversations.ts và src/index.ts. Thay thế đầu ra gỡ lỗi như đã chỉ định, sau đó chạy đường dẫn MCP stdio và xác minh rằng stdout chỉ chứa các thông báo JSON-RPC, trong khi đầu ra gỡ lỗi được chuyển đến stderr.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Bug
The MCP server uses console.log() for debug output in several source files. Since MCP servers communicate with the host over stdio JSON-RPC, any non-JSON output on stdout corrupts the protocol stream.
This manifests as a parse error in Claude Code:
Unexpected identifier Indexer
How it happens
Normal MCP stdio traffic looks like this:
Host → Server:
{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search_memory","arguments":{"query":"console log fix"}}}
Server → Host (expected):
{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"..."}]}}
But with console.log calls in the code, what actually arrives on stdout is:
[Indexer] Starting full index rebuild...
[Indexer] Parsing journal...
[Indexer] Indexing 18 items...
{"jsonrpc":"2.0","id":1,"result":{"content":[{"type":"text","text":"..."}]}}
The host reads line by line and tries to JSON.parse each one. The first line it sees is [Indexer] Starting full index rebuild... — not valid JSON — so the parser throws:
Unexpected identifier 'Indexer'
The actual response that follows never gets processed correctly because the stream is now out of sync.
Affected files
src/embeddings.ts(1 occurrence)src/indexer.ts(9 occurrences)src/conversations.ts(10 occurrences)src/index.ts(2 occurrences)
Fix
Replace all console.log( with console.error( in these files. stderr is not part of the MCP stdio pipe and is safe for debug output.
This issue was identified and filed with the help of Claude Code.
- Ngôn ngữ chính
- TypeScript
- Star
- 119
- Fork
- 6
- Merge trung bình
- 1 giờ 32 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ascorbic/macrodata
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Support Cursor Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Tất cả issue của ascorbic/macrodata
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
danielmiessler/LifeOS#2218 ·