Repository navigation
Description
Summary
CodeBurn reports mcpServers/mcpInventory/mcpBreakdown as empty for sessions that clearly contain MCP and skill tool activity, even though the raw .codex/sessions JSONL has MCP/skill invocations.
Repro (local machine)
- Run:
codeburn export --format json --from 2026-06-17 --to 2026-06-17 --output $env:TEMP\codeburn-issue-repro-2026-06-17.jsonObserved output includes:
Exported (2026-06-17 to 2026-06-17) to: C:\Users\User\AppData\Local\Temp\codeburn-issue-repro-2026-06-17.json
And the exported JSON does not contain MCP fields (mcpBreakdown, mcpServers, or mcpInventory).
- Repeat a date that I know has MCP usage (session files with
node_replinvocations):
codeburn export --format json --from 2026-05-18 --to 2026-05-18 --output $env:TEMP\codeburn-issue-repro-2026-05-18.jsonObserved: MCP_FIELDS_MISSING
Evidence of MCP in raw logs
Raw session line sample (actual payloads exist):
C:\Users\User\.codex\sessions\2026\05\18\rollout-2026-05-18T15-31-52-019e39ff-981e-77f2-b8c2-559543a87024.jsonl
- MCP tool discovery is present (
tool_search_output, namespacemcp__node_repl__,mcp__codex_apps__github) around line 33. - MCP function call is present with
response_item/function_call, namespacemcp__node_repl__around line 37. - Matching
event_msgpayload.typeismcp_tool_call_endaround line 39 withinvocation.server=node_replandinvocation.tool=js.
Parser gap in installed codeburn
From C:\Users\User\AppData\Roaming\npm\node_modules\codeburn\dist\main.js:
- Parsing branch only handles:
entry.type === response_item && entry.payload?.type === function_callentry.type === event_msg && entry.payload?.type === patch_apply_end
- No explicit branch for
mcp_tool_call_endto synthesize MCP calls. - Tool mapping (
toolNameMap2) currently contains only built-ins (exec_command,read_file,write_file, etc.) and not MCP names likemcp__node_repl__.*. mcpBreakdownexists and is accumulated later, so it only helps if MCP calls are successfully added to call records.
Expected
codeburn export should include non-empty MCP/skill inventory/usage stats when sessions contain MCP/skill tool events.
Actual
mcpBreakdown, mcpInventory, and mcpServers are empty despite MCP/skill activity in source logs.
If useful, I can provide a minimal patch suggestion: add mcp_tool_call_end handling into the ingestion loop and normalize MCP namespace/tool into call.mcpTools.
Activity
feat(export): surface MCP server usage in JSON and CSV exports (#514)
iamtoruk commentedon Jun 18, 2026
Fixed across two PRs (both merged to
main):Parsing (#513): recent Codex sessions report completed MCP calls as an
event_msgwithtype: "mcp_tool_call_end"rather than afunction_callitem, and the parser had no branch for it, exactly as you diagnosed fromdist/main.js. It now readsinvocation.server/invocation.tooland rebuilds the canonicalmcp__<server>__<tool>name. The Codex result cache was bumped (v3 -> v4) so previously scanned sessions re-parse automatically.Export (#514): the export schema itself never surfaced MCP, the
toolssection is built fromextractCoreTools, which stripsmcp__names, and there was no separate MCP section. Added anmcpblock to the JSON export and anmcp.csvto the CSV export, sourced from per-session MCP usage (server -> calls, with share).Validated on real local Codex data:
where before the parse fix it was empty.
One thing intentionally left as a follow-up:
mcpInventory(the MCP/skill tools that were available, vs the ones actually invoked). For Codex that comes fromtool_search_outputevents, and our inventory extraction currently only understands Claude's tool-loading format, so it still reports empty for Codex. That needs its own parser change and validation, happy to track it separately if the available-tools list is useful to you.Thanks for the detailed report, the
dist/main.jsbranch analysis and the exact event shapes made both fixes fast to pin down.