Skip to content

feat(export): surface MCP server usage in JSON and CSV exports (#496)#514

Merged
iamtoruk merged 1 commit into
mainfrom
feat/export-mcp-usage
Jun 18, 2026
Merged

feat(export): surface MCP server usage in JSON and CSV exports (#496)#514
iamtoruk merged 1 commit into
mainfrom
feat/export-mcp-usage

Conversation

@iamtoruk

Copy link
Copy Markdown
Member

Problem

codeburn export never showed MCP usage even when sessions had MCP activity (#496). Two distinct gaps:

  1. MCP usage wasn't parsed for recent Codex sessions (the mcp_tool_call_end event was unhandled). Fixed separately in fix(codex): attribute MCP calls emitted as event_msg/mcp_tool_call_end (#478) #513, which now populates session.mcpBreakdown.
  2. The export schema never surfaced MCP at all (this PR). exportJson/exportCsv emitted tools and shell-commands but no MCP section, and the tools list is built via extractCoreTools, which deliberately strips mcp__ names. So even with mcpBreakdown populated, exports showed nothing MCP.

Change

Add an mcp section (server -> calls, with share %) to the JSON export and an mcp.csv to the CSV export, sourced from session.mcpBreakdown. Mirrors the existing tools section; README updated.

Schema string stays codeburn.export.v2 since this is purely additive (new keys, no changes to existing fields) and shouldn't break consumers pinned to v2.

Validation on real local data

$ codeburn export --format json --provider codex (June)
mcp: [{"Server":"node_repl","Calls":5,"Share (%)":100}]
tools: [{"Tool":"Bash",...},{"Tool":"Edit",...}]   # MCP correctly excluded here

New tests: exportJson emits per-server mcp rows with correct shares; exportCsv writes mcp.csv. Full export + codex + export-date-range suites pass (26/26), tsc --noEmit clean.

Out of scope

mcpInventory (which MCP/skill tools were available, vs used) is still empty for Codex because extractMcpInventory only understands Claude's deferred_tools_delta shape, not Codex tool_search_output events. Tracked as a follow-up.

Fixes #496

The export schema emitted tools and shell-commands but no MCP section, and
the tools list is built from extractCoreTools which strips mcp__ names, so
MCP usage never appeared in codeburn export output even when sessions had
MCP activity (issue #496).

Add an mcp section to the JSON export and an mcp.csv to the CSV export,
sourced from session.mcpBreakdown (server -> calls, with share). Mirrors the
existing tools section.

The underlying parse fix (Codex mcp_tool_call_end attribution) landed in
#513; this makes that data visible in exports. Validated on real local data:
the JSON export now reports mcp: [{Server: node_repl, Calls: 5, ...}].

Fixes #496
@iamtoruk iamtoruk merged commit 808a149 into main Jun 18, 2026
3 checks passed
@iamtoruk iamtoruk deleted the feat/export-mcp-usage branch June 18, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant