feat(export): surface MCP server usage in JSON and CSV exports (#496)#514
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
codeburn exportnever showed MCP usage even when sessions had MCP activity (#496). Two distinct gaps:mcp_tool_call_endevent was unhandled). Fixed separately in fix(codex): attribute MCP calls emitted as event_msg/mcp_tool_call_end (#478) #513, which now populatessession.mcpBreakdown.exportJson/exportCsvemittedtoolsandshell-commandsbut no MCP section, and thetoolslist is built viaextractCoreTools, which deliberately stripsmcp__names. So even withmcpBreakdownpopulated, exports showed nothing MCP.Change
Add an
mcpsection (server -> calls, with share %) to the JSON export and anmcp.csvto the CSV export, sourced fromsession.mcpBreakdown. Mirrors the existingtoolssection; README updated.Schema string stays
codeburn.export.v2since this is purely additive (new keys, no changes to existing fields) and shouldn't break consumers pinned to v2.Validation on real local data
New tests:
exportJsonemits per-servermcprows with correct shares;exportCsvwritesmcp.csv. Full export + codex + export-date-range suites pass (26/26),tsc --noEmitclean.Out of scope
mcpInventory(which MCP/skill tools were available, vs used) is still empty for Codex becauseextractMcpInventoryonly understands Claude'sdeferred_tools_deltashape, not Codextool_search_outputevents. Tracked as a follow-up.Fixes #496