Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Normalize Copilot MCP tool names#374

Open
ozymandiashh wants to merge 1 commit into
getagentseal:mainfrom
ozymandiashh:fix/copilot-mcp-tool-normalization
Open

Normalize Copilot MCP tool names#374
ozymandiashh wants to merge 1 commit into
getagentseal:mainfrom
ozymandiashh:fix/copilot-mcp-tool-normalization

Conversation

@ozymandiashh
Copy link
Copy Markdown
Contributor

Summary

Closes #371 by making Copilot MCP tool calls show up in MCP server breakdowns instead of being counted as ordinary core tools.

Root cause

CodeBurn's MCP aggregation expects tool names in the Claude-style mcp__server__tool format. Copilot records MCP calls as <server>-<tool> in toolRequests, for example github-mcp-server-list_issues, cyberday-get_tasks, and mempalace-mempalace_search. The Copilot provider only mapped built-in tools like bash and read_file, so those MCP calls stayed as raw strings and extractMcpTools() ignored them.

What changed

  • Normalize Copilot MCP tool names from <server>-<tool> to mcp__server__tool in both legacy session-state logs and VS Code transcript logs.
  • Keep built-in Copilot tools mapped first, so bash still reports as Bash and does not get misclassified as MCP.
  • Pass through already-normalized mcp__... names idempotently.
  • Add Copilot-only parser cache invalidation so previously cached Copilot sessions are reparsed with the new normalization.
  • Harden Copilot tool parsing against malformed toolRequests elements.

Validation

I ran a concrete Copilot fixture through the actual CLI. The fixture contains this assistant toolRequests input:

github-mcp-server-list_issues
cyberday-get_tasks
mempalace-mempalace_search
bash

codeburn report --format json --provider copilot --from 2026-05-21 --to 2026-05-21 now reports the MCP tools as MCP servers and leaves only Bash in core tools:

{
  "reportMcpServers": [
    { "name": "github_mcp_server", "calls": 1 },
    { "name": "cyberday", "calls": 1 },
    { "name": "mempalace", "calls": 1 }
  ],
  "reportCoreTools": [
    { "name": "Bash", "calls": 1 }
  ]
}

Additional checks:

npm test -- --run tests/providers/copilot.test.ts tests/session-cache.test.ts
npm test -- --run
npm run build
git diff --check
Claude Opus 4.7 effort max review - PASS
Gemini 3.1 Pro Preview review - PASS

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.

MCP Servers panel shows 'No MCP usage' for GitHub Copilot CLI sessions

1 participant