MCP server JSONL logs: timestamp should be first field
Problem
The JSONL log files written by Claude Code for MCP servers (at AppData/Local/claude-cli-nodejs/Cache/<project>/mcp-logs-<server>/) emit timestamp as a non-leading field:
{"error":"Server stderr: [idle-manager] started (idle timeout: 30min)\n","timestamp":"2026-04-27T05:31:29.942Z","sessionId":"c962fdc3-...","cwd":"C:\path\to\project"}
Why it matters
Timestamp is the primary key when reading logs — it's what you correlate, filter, and sort by. When it appears mid-object after a potentially long error string, the log lines become jagged and unreadable without a JSON pretty-printer. A wall of MCP log output is already dense; burying the timestamp makes it a tool-required read rather than a human-readable one.
Expected format
{"timestamp":"2026-04-27T05:31:29.942Z","error":"Server stderr: ...","sessionId":"c962fdc3-...","cwd":"C:\path\to\project"}
Timestamp first, then type/level, then content, then context fields.
Fix
Reorder the key sequence in the MCP log serialiser so timestamp is always the first field. One-line change — just restructure the object literal to { timestamp, ...rest }.
Note: this issue may apply to many other logs in claude and not just MCP logs....
Also to your credit claude is not the only software which shows this issue... I have seen it repeat at scores of other places which tells me that it is an open source library which is doing it... pls patch that as well... TY
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗