feat(mcp): ask agents to report their model in server instructions
Summary
Follow-up to #4235. In the first 24h of prod data (2026-11-27 15:21 ā 2026-11-28 15:30 UTC) the hosted MCP emitted 136 $mcp_tool_call events (1:1 with Hosted MCP Tool Invoked), but 0 of 136 carried $mcp_llm_model, so PostHog's tool-quality-by-model view is empty.
The argument is advertised on all 85 tools and the pipeline works: a manual capgo_list_apps call with llm_model landed as $mcp_llm_model=claude-opus-5-5, $mcp_llm_model_source=self_reported. Agents just don't fill an optional argument that only the tool schema describes.
This adds one sentence to the initialize instructions asking agents to set llm_model on every Capgo tool call. Instructions stay within the 2048-byte Claude Code limit (1653 ā ~1790 bytes).
Not included
Grouping sessions by Mcp-Session-Id: the stateless server never issues one, so clients never send it back. Doing that would require issuing (and then honoring) session IDs, which is out of scope here. Sessions stay one per HTTP request.
Test plan
-
tests/mcp-analytics.unit.test.ts: instructions ask forllm_model, andinitializereturns them -
tests/mcp-remote.unit.test.ts: instructions byte limit still holds -
tsc --project tsconfig.backend.json, oxlint, eslint - After deploy: share of
$mcp_tool_callwith$mcp_llm_modelset rises above 0
š¤ Generated with Claude Code