Skip to content

Codex export misses MCP/skill usage despite MCP events in session logs #496

@martinmclee

Description

@martinmclee

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)

  1. Run:
codeburn export --format json --from 2026-06-17 --to 2026-06-17 --output $env:TEMP\codeburn-issue-repro-2026-06-17.json

Observed 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).

  1. Repeat a date that I know has MCP usage (session files with node_repl invocations):
codeburn export --format json --from 2026-05-18 --to 2026-05-18 --output $env:TEMP\codeburn-issue-repro-2026-05-18.json

Observed: 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, namespace mcp__node_repl__, mcp__codex_apps__github) around line 33.
  • MCP function call is present with response_item/function_call, namespace mcp__node_repl__ around line 37.
  • Matching event_msg payload.type is mcp_tool_call_end around line 39 with invocation.server=node_repl and invocation.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_call
    • entry.type === event_msg && entry.payload?.type === patch_apply_end
  • No explicit branch for mcp_tool_call_end to synthesize MCP calls.
  • Tool mapping (toolNameMap2) currently contains only built-ins (exec_command, read_file, write_file, etc.) and not MCP names like mcp__node_repl__.*.
  • mcpBreakdown exists 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions