@posthog/mcp 0.13.1 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -160,17 +160,19 @@ guarantee, `context: false` and the `beforeSend` hook above remain the ways to d
160
160
 
161
161
  ### What `$mcp_llm_model` records, and when it stays empty
162
162
 
163
- `captureModel` is **off** by default. Turn it on and the SDK adds a required `llm_model` parameter to
164
- every tool it advertises — including the `get_more_tools` virtual tool — asks the agent which model
165
- it runs as, and records the answer as `$mcp_llm_model` with `$mcp_llm_model_source = "self_reported"`.
163
+ `captureModel` is **off** by default. Turn it on and the SDK records the best model id visible to the
164
+ server as `$mcp_llm_model`. Recognized client metadata wins with source `client_metadata`. Otherwise,
165
+ the SDK injects a required `llm_model` parameter and records the answer with source `self_reported`.
166
166
 
167
- The value is self-reported and unverified, exactly like `clientInfo` in the MCP spec. Use it to spot
168
- degradation across models ("does our MCP get worse on model X?"), never for billing or access
169
- control. An agent that answers `unknown` is recorded as nothing rather than as a model called
170
- "unknown".
167
+ MCP does not standardize or attest model identity. Client metadata and self-report are both
168
+ unverified. Use the value to spot degradation across models, never for billing or access control.
169
+ Missing, blank, and `unknown` values are recorded as nothing.
171
170
 
172
- Unlike `context`, this option degrades to **silence** rather than to a kept argument. Both the strip
173
- and the capture require the SDK to have confirmed the parameter is its own:
171
+ The recognized metadata path is Codex's `x-codex-turn-metadata.model` field inside request `_meta`.
172
+ Other clients keep using self-report until they expose a stable model field.
173
+
174
+ Unlike `context`, the self-report fallback degrades to **silence** rather than to a kept argument.
175
+ Its capture and stripping require the SDK to have confirmed the parameter is its own:
174
176
 
175
177
  - `instrument(server)` on a high-level `McpServer` resolves ownership for your registered tools per
176
178
  request from the live tool registry, so those work even on a fresh instance.
@@ -198,13 +200,18 @@ const posthog = new PostHogMCP(process.env.POSTHOG_PROJECT_TOKEN, { captureModel
198
200
 
199
201
  const tools = posthog.prepareToolList(serverTools)
200
202
  const originalTool = serverTools.find((tool) => tool.name === toolName)
201
- const { args, llmModel, llmModelSource } = posthog.prepareToolCall(toolName, rawArgs, { originalTool })
203
+ const { args, llmModel, llmModelSource } = posthog.prepareToolCall(toolName, rawArgs, {
204
+ originalTool,
205
+ requestMeta: request.params?._meta,
206
+ })
202
207
  const result = await dispatch(toolName, args)
203
208
 
204
209
  posthog.captureToolCall({ toolName, llmModel, llmModelSource, isError: false })
205
210
  ```
206
211
 
207
212
  A persistent single-process dispatcher can omit `originalTool` after it has prepared its tool list.
213
+ Pass `requestMeta` whenever the request supplies `_meta`; this enables recognized client metadata
214
+ without changing the arguments sent to the tool.
208
215
 
209
216
  ### If you switched to `instrument(server.server)`
210
217
 
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../src/extensions/instrumentation.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,aAAa,EAId,MAAM,UAAU,CAAA;AAqBjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAIrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AASxC;;;;;;GAMG;AAEH,KAAK,iBAAiB,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,6BAA6B,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAE7G,2EAA2E;AAC3E,KAAK,YAAY,GAAG,CAAC,iBAAiB,EAAE,cAAc,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAE3E,UAAU,mBAAmB;IAC3B,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,EAAE,gBAAgB,CAAA;IACtB,OAAO,EAAE,cAAc,CAAA;IACvB,KAAK,CAAC,EAAE,6BAA6B,CAAA;IACrC,OAAO,EAAE,YAAY,CAAA;IACrB,2FAA2F;IAC3F,kBAAkB,CAAC,EAAE,2B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C,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,6BAA6B,GAAG,SAAS,EAChD,MAAM,EAAE,QAAQ,GACf,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAoB9B;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,aAAa,EACrB,wBAAwB,EAAE,iBAAiB,EAC3C,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,6BAA6B,GAAG,SAAS,EAChD,MAAM,EAAE,QAAQ,GACf,OAAO,CAAC,uBAAuB,CAAC,CAmElC;AAiGD,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,GAAG,SAAS,GAClD,IAAI,CASN;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGtE;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1B,KAAK,EAAE,uBAAuB,CAAC,OAAO,CAAC,GAAG,SAAS,GAClD,IAAI,CAUN;AAuHD;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,aAAa,EACrB,yBAAyB,EAAE,iBAAiB,EAC5C,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,6BAA6B,GAAG,SAAS,EAChD,MAAM,EAAE,QAAQ,GACf,OAAO,CAAC,OAAO,CAAC,CA2ElB"}
@@ -123,7 +123,10 @@ async function prepareToolCallEvent(server, data, request, downstreamRequest, ex
123
123
  const requestAttribution = (0, external_internal_js_namespaceObject.withIdentity)(sessionInfo, identity);
124
124
  await (0, external_tracing_helpers_js_namespaceObject.applyResolvedMetadata)(event, data, request, extra);
125
125
  (0, external_intent_js_namespaceObject.setEventIntent)(event, await (0, external_intent_js_namespaceObject.resolveToolCallIntent)(data, request, canCaptureContextIntent, extra));
126
- if (ownership.llmModel) (0, external_model_parameters_js_namespaceObject.setEventModel)(event, (0, external_model_parameters_js_namespaceObject.getModelArgument)(request));
126
+ if ((0, external_model_parameters_js_namespaceObject.isCaptureModelEnabled)(data.options.captureModel)) {
127
+ const resolvedModel = (0, external_model_parameters_js_namespaceObject.resolveModel)(request, ownership.llmModel);
128
+ (0, external_model_parameters_js_namespaceObject.setEventModel)(event, resolvedModel?.model, resolvedModel?.source);
129
+ }
127
130
  return {
128
131
  event,
129
132
  requestAttribution
@@ -1,6 +1,6 @@
1
1
  import { getAnalyticsParameterOwnership, stripOwnedAnalyticsArguments } from "./analytics-parameters.mjs";
2
2
  import { addContextParameterToTools, getContextDescription, isContextEnabled } from "./context-parameters.mjs";
3
- import { addModelParameterToTools, getModelArgument, getModelDescription, isCaptureModelEnabled, setEventModel } from "./model-parameters.mjs";
3
+ import { addModelParameterToTools, getModelDescription, isCaptureModelEnabled, resolveModel, setEventModel } from "./model-parameters.mjs";
4
4
  import { addConversationIdToTools, canInjectConversationIdPromptBack, injectConversationIdPromptBack, resolveConversationId } from "./conversation-id.mjs";
5
5
  import { stampClientIdentity } from "./client-identity.mjs";
6
6
  import { stampTransportIdentity } from "./transport-identity.mjs";
@@ -82,7 +82,10 @@ async function prepareToolCallEvent(server, data, request, downstreamRequest, ex
82
82
  const requestAttribution = withIdentity(sessionInfo, identity);
83
83
  await applyResolvedMetadata(event, data, request, extra);
84
84
  setEventIntent(event, await resolveToolCallIntent(data, request, canCaptureContextIntent, extra));
85
- if (ownership.llmModel) setEventModel(event, getModelArgument(request));
85
+ if (isCaptureModelEnabled(data.options.captureModel)) {
86
+ const resolvedModel = resolveModel(request, ownership.llmModel);
87
+ setEventModel(event, resolvedModel?.model, resolvedModel?.source);
88
+ }
86
89
  return {
87
90
  event,
88
91
  requestAttribution
@@ -1,22 +1,19 @@
1
- import type { MCPAnalyticsOptions, MCPRequestLike, McpEvent } from '../types';
1
+ import type { MCPAnalyticsModelSource, MCPAnalyticsOptions, MCPRequestLike, McpEvent } from '../types';
2
2
  import { type AnalyticsInjectableJsonSchema } from './analytics-parameters';
3
3
  import { type LoggerFn } from './logger';
4
4
  /**
5
- * Self-reported model capture (`captureModel`).
5
+ * Model capture (`captureModel`).
6
6
  *
7
- * MCP keeps servers deliberately model-ignorant: the wire carries client
8
- * name/version and protocol version, never the LLM behind the client, and no
9
- * spec revision changes that. The one place the information exists on the
10
- * server side of the connection is the agent itself — harnesses inject the
11
- * model id into the system prompt, so the agent can state it the same way it
12
- * states its intent through the `context` parameter.
7
+ * MCP does not standardize model identity. Some clients expose it through
8
+ * vendor metadata, while other harnesses inject the model id into the system
9
+ * prompt so the agent can state it like intent through the `context` parameter.
13
10
  *
14
11
  * This module injects a required `llm_model` string parameter into every tool
15
12
  * (mirroring `context-parameters.ts`), strips it before the tool runs, and
16
- * captures it as `$mcp_llm_model` with `$mcp_llm_model_source = "self_reported"`.
17
- * The source property is deliberate: like `clientInfo` in the MCP spec, the
18
- * value is self-reported and unverified — right for degradation analytics
19
- * ("does our MCP get worse on model X?"), never for billing or security.
13
+ * captures the best available value as `$mcp_llm_model`. Client metadata wins
14
+ * over self-report, and `$mcp_llm_model_source` preserves that provenance.
15
+ * Both sources are unverified — right for degradation analytics ("does our MCP
16
+ * get worse on model X?"), never for billing or security.
20
17
  *
21
18
  * Reasoning effort is deliberately NOT captured: it never crosses the wire,
22
19
  * and models cannot reliably self-report it (harnesses apply it as a sampling
@@ -44,5 +41,15 @@ export declare function addModelParameterToTools<TTool extends ModelInjectableTo
44
41
  * not become a property value queries would group by.
45
42
  */
46
43
  export declare function getModelArgument(request: MCPRequestLike): string | undefined;
47
- export declare function setEventModel(event: McpEvent, model: string | undefined): void;
44
+ export interface ResolvedModel {
45
+ model: string;
46
+ source: MCPAnalyticsModelSource;
47
+ }
48
+ /**
49
+ * Resolves model identity from sources visible to an MCP server. The Codex
50
+ * request metadata is host-generated and therefore more reliable than a model
51
+ * filling an injected argument, but remains unverified client input.
52
+ */
53
+ export declare function resolveModel(request: MCPRequestLike, allowSelfReported: boolean): ResolvedModel | undefined;
54
+ export declare function setEventModel(event: McpEvent, model: string | undefined, source?: MCPAnalyticsModelSource): void;
48
55
  //# sourceMappingURL=model-parameters.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-parameters.d.ts","sourceRoot":"","sources":["../../src/extensions/model-parameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC7E,OAAO,EAA+B,KAAK,6BAA6B,EAAE,MAAM,wBAAwB,CAAA;AAExG,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,6BAA6B,CAAA;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,GAAG,OAAO,CAEhG;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,mBAAmB,CAAC,cAAc,CAAC,GAAG,MAAM,GAAG,SAAS,CAEzG;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,SAAS,mBAAmB,EACvE,IAAI,EAAE,KAAK,EACX,wBAAwB,CAAC,EAAE,MAAM,EACjC,MAAM,GAAE,QAAc,GACrB,KAAK,CAQP;AAED,wBAAgB,wBAAwB,CAAC,KAAK,SAAS,mBAAmB,EACxE,KAAK,EAAE,KAAK,EAAE,EACd,wBAAwB,CAAC,EAAE,MAAM,EACjC,MAAM,GAAE,QAAc,GACrB,KAAK,EAAE,CAET;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,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E;AAID,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,uBAAuB,CAAA;CAChC;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAiB3G;AAiBD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,GAAE,uBAAyC,GAChD,IAAI,CAON"}
@@ -33,6 +33,7 @@ __webpack_require__.d(__webpack_exports__, {
33
33
  getModelArgument: ()=>getModelArgument,
34
34
  getModelDescription: ()=>getModelDescription,
35
35
  isCaptureModelEnabled: ()=>isCaptureModelEnabled,
36
+ resolveModel: ()=>resolveModel,
36
37
  setEventModel: ()=>setEventModel
37
38
  });
38
39
  const external_analytics_parameters_js_namespaceObject = require("./analytics-parameters.js");
@@ -53,23 +54,45 @@ function addModelParameterToTools(tools, modelDescriptionOverride, logger = exte
53
54
  function getModelArgument(request) {
54
55
  return normalizeModel(request.params?.arguments?.llm_model);
55
56
  }
57
+ const CODEX_TURN_METADATA_KEY = 'x-codex-turn-metadata';
58
+ function resolveModel(request, allowSelfReported) {
59
+ const codexMetadata = request.params?._meta?.[CODEX_TURN_METADATA_KEY];
60
+ if (isRecord(codexMetadata) && Object.prototype.hasOwnProperty.call(codexMetadata, 'model')) {
61
+ const model = normalizeModel(codexMetadata.model);
62
+ if (model) return {
63
+ model,
64
+ source: 'client_metadata'
65
+ };
66
+ }
67
+ if (allowSelfReported) {
68
+ const model = getModelArgument(request);
69
+ if (model) return {
70
+ model,
71
+ source: 'self_reported'
72
+ };
73
+ }
74
+ }
75
+ function isRecord(value) {
76
+ return 'object' == typeof value && null !== value && !Array.isArray(value);
77
+ }
56
78
  function normalizeModel(model) {
57
79
  if ('string' != typeof model) return;
58
80
  const trimmed = model.trim();
59
81
  if (!trimmed || 'unknown' === trimmed.toLowerCase()) return;
60
82
  return trimmed;
61
83
  }
62
- function setEventModel(event, model) {
84
+ function setEventModel(event, model, source = 'self_reported') {
63
85
  const normalizedModel = normalizeModel(model);
64
86
  if (!normalizedModel) return;
65
87
  event.llmModel = normalizedModel;
66
- event.llmModelSource = 'self_reported';
88
+ event.llmModelSource = source;
67
89
  }
68
90
  exports.addModelParameterToTool = __webpack_exports__.addModelParameterToTool;
69
91
  exports.addModelParameterToTools = __webpack_exports__.addModelParameterToTools;
70
92
  exports.getModelArgument = __webpack_exports__.getModelArgument;
71
93
  exports.getModelDescription = __webpack_exports__.getModelDescription;
72
94
  exports.isCaptureModelEnabled = __webpack_exports__.isCaptureModelEnabled;
95
+ exports.resolveModel = __webpack_exports__.resolveModel;
73
96
  exports.setEventModel = __webpack_exports__.setEventModel;
74
97
  for(var __rspack_i in __webpack_exports__)if (-1 === [
75
98
  "addModelParameterToTool",
@@ -77,6 +100,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
77
100
  "getModelArgument",
78
101
  "getModelDescription",
79
102
  "isCaptureModelEnabled",
103
+ "resolveModel",
80
104
  "setEventModel"
81
105
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
82
106
  Object.defineProperty(exports, '__esModule', {
@@ -16,16 +16,37 @@ function addModelParameterToTools(tools, modelDescriptionOverride, logger = log)
16
16
  function getModelArgument(request) {
17
17
  return normalizeModel(request.params?.arguments?.llm_model);
18
18
  }
19
+ const CODEX_TURN_METADATA_KEY = 'x-codex-turn-metadata';
20
+ function resolveModel(request, allowSelfReported) {
21
+ const codexMetadata = request.params?._meta?.[CODEX_TURN_METADATA_KEY];
22
+ if (isRecord(codexMetadata) && Object.prototype.hasOwnProperty.call(codexMetadata, 'model')) {
23
+ const model = normalizeModel(codexMetadata.model);
24
+ if (model) return {
25
+ model,
26
+ source: 'client_metadata'
27
+ };
28
+ }
29
+ if (allowSelfReported) {
30
+ const model = getModelArgument(request);
31
+ if (model) return {
32
+ model,
33
+ source: 'self_reported'
34
+ };
35
+ }
36
+ }
37
+ function isRecord(value) {
38
+ return 'object' == typeof value && null !== value && !Array.isArray(value);
39
+ }
19
40
  function normalizeModel(model) {
20
41
  if ('string' != typeof model) return;
21
42
  const trimmed = model.trim();
22
43
  if (!trimmed || 'unknown' === trimmed.toLowerCase()) return;
23
44
  return trimmed;
24
45
  }
25
- function setEventModel(event, model) {
46
+ function setEventModel(event, model, source = 'self_reported') {
26
47
  const normalizedModel = normalizeModel(model);
27
48
  if (!normalizedModel) return;
28
49
  event.llmModel = normalizedModel;
29
- event.llmModelSource = 'self_reported';
50
+ event.llmModelSource = source;
30
51
  }
31
- export { addModelParameterToTool, addModelParameterToTools, getModelArgument, getModelDescription, isCaptureModelEnabled, setEventModel };
52
+ export { addModelParameterToTool, addModelParameterToTools, getModelArgument, getModelDescription, isCaptureModelEnabled, resolveModel, setEventModel };
@@ -14,8 +14,8 @@ export interface PostHogMCPOptions extends PostHogOptions {
14
14
  */
15
15
  missingCapabilityToolName?: string;
16
16
  /**
17
- * Inject a required `llm_model` argument into advertised tools and capture
18
- * the agent's self-reported value. Off by default.
17
+ * Capture the calling model from recognized client metadata, with an injected
18
+ * `llm_model` argument as fallback. Off by default.
19
19
  */
20
20
  captureModel?: MCPAnalyticsOptions['captureModel'];
21
21
  }
@@ -112,7 +112,7 @@ export declare class PostHogMCP extends PostHog {
112
112
  * @example
113
113
  * ```ts
114
114
  * const { intent, intentSource, llmModel, llmModelSource, args, isMissingCapability } =
115
- * posthog.prepareToolCall(name, rawArgs)
115
+ * posthog.prepareToolCall(name, rawArgs, { requestMeta: request.params?._meta })
116
116
  * if (isMissingCapability) {
117
117
  * posthog.captureMissingCapability({ context: intent, llmModel, llmModelSource, ...identity })
118
118
  * return getMoreToolsResult()
@@ -1 +1 @@
1
- {"version":3,"file":"posthog-mcp.d.ts","sourceRoot":"","sources":["../../src/extensions/posthog-mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA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AAwB,CAAC,IAAI,EAAE,4BAA4B,GAAG,IAAI;CAmBnE"}
@@ -63,8 +63,7 @@ class PostHogMCP extends external_posthog_node_namespaceObject.PostHog {
63
63
  event.isError = data.isError;
64
64
  event.errorType = data.errorType;
65
65
  applyIntent(event, data.intent, data.intentSource);
66
- (0, external_model_parameters_js_namespaceObject.setEventModel)(event, data.llmModel);
67
- if (event.llmModel && data.llmModelSource) event.llmModelSource = data.llmModelSource;
66
+ (0, external_model_parameters_js_namespaceObject.setEventModel)(event, data.llmModel, data.llmModelSource);
68
67
  if (data.isError) event.error = (0, external_exceptions_js_namespaceObject.captureException)(data.error ?? `Tool ${data.toolName} returned an error`);
69
68
  this.#emit(event);
70
69
  }
@@ -115,17 +114,18 @@ class PostHogMCP extends external_posthog_node_namespaceObject.PostHog {
115
114
  const rawContext = args?.context;
116
115
  const intent = 'string' == typeof rawContext && rawContext.trim() ? rawContext.trim() : void 0;
117
116
  const ownsModel = (0, external_model_parameters_js_namespaceObject.isCaptureModelEnabled)(this.#captureModel) && (options.originalTool ? (0, external_analytics_parameters_js_namespaceObject.analyticsOwnsParameter)(options.originalTool.inputSchema, 'llm_model') : true === this.#modelParameterOwnership.get(name));
118
- const llmModel = ownsModel ? (0, external_model_parameters_js_namespaceObject.getModelArgument)({
117
+ const resolvedModel = (0, external_model_parameters_js_namespaceObject.isCaptureModelEnabled)(this.#captureModel) ? (0, external_model_parameters_js_namespaceObject.resolveModel)({
119
118
  params: {
120
- arguments: args
119
+ arguments: args,
120
+ _meta: options.requestMeta
121
121
  }
122
- }) : void 0;
122
+ }, ownsModel) : void 0;
123
123
  const strippedArgs = stripContext(args);
124
124
  return {
125
125
  intent,
126
126
  intentSource: intent ? 'context_parameter' : void 0,
127
- llmModel,
128
- llmModelSource: llmModel ? 'self_reported' : void 0,
127
+ llmModel: resolvedModel?.model,
128
+ llmModelSource: resolvedModel?.source,
129
129
  args: ownsModel ? (0, external_analytics_parameters_js_namespaceObject.stripOwnedAnalyticsArguments)(strippedArgs, {
130
130
  context: false,
131
131
  conversationId: false,
@@ -139,8 +139,7 @@ class PostHogMCP extends external_posthog_node_namespaceObject.PostHog {
139
139
  event.resourceName = this.#missingCapabilityToolName;
140
140
  event.parameters = data.parameters;
141
141
  applyIntent(event, data.context, 'context_parameter');
142
- (0, external_model_parameters_js_namespaceObject.setEventModel)(event, data.llmModel);
143
- if (event.llmModel && data.llmModelSource) event.llmModelSource = data.llmModelSource;
142
+ (0, external_model_parameters_js_namespaceObject.setEventModel)(event, data.llmModel, data.llmModelSource);
144
143
  this.#emit(event);
145
144
  }
146
145
  #emit(event) {
@@ -6,7 +6,7 @@ import { captureException } from "./exceptions.mjs";
6
6
  import { normalizeHeaderString } from "./headers.mjs";
7
7
  import { applyMcpLibIdentity } from "./lib-identity.mjs";
8
8
  import { log } from "./logger.mjs";
9
- import { addModelParameterToTool, getModelArgument, getModelDescription, isCaptureModelEnabled, setEventModel } from "./model-parameters.mjs";
9
+ import { addModelParameterToTool, getModelDescription, isCaptureModelEnabled, resolveModel, setEventModel } from "./model-parameters.mjs";
10
10
  import { McpEventSink } from "./sink.mjs";
11
11
  import { GET_MORE_TOOLS_NAME, getReportMissingToolDescriptor } from "./tools.mjs";
12
12
  class PostHogMCP extends PostHog {
@@ -31,8 +31,7 @@ class PostHogMCP extends PostHog {
31
31
  event.isError = data.isError;
32
32
  event.errorType = data.errorType;
33
33
  applyIntent(event, data.intent, data.intentSource);
34
- setEventModel(event, data.llmModel);
35
- if (event.llmModel && data.llmModelSource) event.llmModelSource = data.llmModelSource;
34
+ setEventModel(event, data.llmModel, data.llmModelSource);
36
35
  if (data.isError) event.error = captureException(data.error ?? `Tool ${data.toolName} returned an error`);
37
36
  this.#emit(event);
38
37
  }
@@ -83,17 +82,18 @@ class PostHogMCP extends PostHog {
83
82
  const rawContext = args?.context;
84
83
  const intent = 'string' == typeof rawContext && rawContext.trim() ? rawContext.trim() : void 0;
85
84
  const ownsModel = isCaptureModelEnabled(this.#captureModel) && (options.originalTool ? analyticsOwnsParameter(options.originalTool.inputSchema, 'llm_model') : true === this.#modelParameterOwnership.get(name));
86
- const llmModel = ownsModel ? getModelArgument({
85
+ const resolvedModel = isCaptureModelEnabled(this.#captureModel) ? resolveModel({
87
86
  params: {
88
- arguments: args
87
+ arguments: args,
88
+ _meta: options.requestMeta
89
89
  }
90
- }) : void 0;
90
+ }, ownsModel) : void 0;
91
91
  const strippedArgs = stripContext(args);
92
92
  return {
93
93
  intent,
94
94
  intentSource: intent ? 'context_parameter' : void 0,
95
- llmModel,
96
- llmModelSource: llmModel ? 'self_reported' : void 0,
95
+ llmModel: resolvedModel?.model,
96
+ llmModelSource: resolvedModel?.source,
97
97
  args: ownsModel ? stripOwnedAnalyticsArguments(strippedArgs, {
98
98
  context: false,
99
99
  conversationId: false,
@@ -107,8 +107,7 @@ class PostHogMCP extends PostHog {
107
107
  event.resourceName = this.#missingCapabilityToolName;
108
108
  event.parameters = data.parameters;
109
109
  applyIntent(event, data.context, 'context_parameter');
110
- setEventModel(event, data.llmModel);
111
- if (event.llmModel && data.llmModelSource) event.llmModelSource = data.llmModelSource;
110
+ setEventModel(event, data.llmModel, data.llmModelSource);
112
111
  this.#emit(event);
113
112
  }
114
113
  #emit(event) {
package/dist/types.d.ts CHANGED
@@ -58,6 +58,7 @@ export interface CompatibleTextToolResult {
58
58
  isError?: boolean;
59
59
  }
60
60
  export interface MCPRequestParamsLike {
61
+ _meta?: JsonRecord;
61
62
  arguments?: JsonRecord;
62
63
  name?: string;
63
64
  [key: string]: unknown;
@@ -118,17 +119,15 @@ export interface MCPAnalyticsOptions {
118
119
  /** Inject a required `context` parameter on every tool to capture user intent. */
119
120
  context?: boolean | MCPAnalyticsContextOptions;
120
121
  /**
121
- * Inject a required `llm_model` parameter on every tool so the calling agent
122
- * self-reports the model it runs as, captured as `$mcp_llm_model` with
123
- * `$mcp_llm_model_source = "self_reported"`. Off by default.
122
+ * Capture the calling model as `$mcp_llm_model`. Recognized client metadata
123
+ * takes precedence, with an injected `llm_model` parameter as the fallback.
124
+ * Off by default.
124
125
  *
125
- * The MCP wire deliberately carries no model identity, so self-report is the
126
- * only capture path — harnesses inject the model id into the agent's system
127
- * prompt, and agents restate it accurately. Like `clientInfo` in the MCP
128
- * spec, the value is unverified: use it for per-model quality analytics, not
129
- * billing or security. An honest `"unknown"` from the agent is dropped
130
- * rather than captured. Reasoning effort is intentionally not collected —
131
- * agents don't reliably know it, so it would only ever be noise.
126
+ * MCP does not standardize model identity. Some clients expose it through
127
+ * vendor metadata; other harnesses inject it into the agent's system prompt
128
+ * so the agent can restate it. `$mcp_llm_model_source` records which path won.
129
+ * Both paths are unverified: use them for quality analytics, not billing or
130
+ * security. Missing, blank, and `"unknown"` values are dropped.
132
131
  */
133
132
  captureModel?: boolean | MCPAnalyticsModelOptions;
134
133
  /**
@@ -168,7 +167,7 @@ export interface MCPAnalyticsModelOptions {
168
167
  }
169
168
  export type MaybePromise<T> = T | Promise<T>;
170
169
  export type MCPAnalyticsIntentSource = 'context_parameter' | 'inferred';
171
- export type MCPAnalyticsModelSource = 'self_reported';
170
+ export type MCPAnalyticsModelSource = 'client_metadata' | 'self_reported';
172
171
  export type ToolCallback = ((args: unknown, extra: CompatibleRequestHandlerExtra) => CompatibleToolResultLike | Promise<CompatibleToolResultLike>) | ((extra: CompatibleRequestHandlerExtra) => CompatibleToolResultLike | Promise<CompatibleToolResultLike>);
173
172
  export type RegisteredTool = {
174
173
  description?: string;
@@ -217,12 +216,11 @@ export interface Event {
217
216
  eventType: MCPAnalyticsEventType;
218
217
  groups?: Record<string, string>;
219
218
  /**
220
- * The calling agent's self-reported model id → `$mcp_llm_model`. Read off
221
- * the SDK-injected `llm_model` argument (`captureModel` option); unverified
222
- * by design, like the MCP spec's own `clientInfo`.
219
+ * The calling model id → `$mcp_llm_model`. Resolved from recognized client
220
+ * metadata first, then the SDK-injected `llm_model` argument; unverified.
223
221
  */
224
222
  llmModel?: string;
225
- /** How the model id was obtained → `$mcp_llm_model_source`. Always `self_reported` today. */
223
+ /** How the model id was obtained → `$mcp_llm_model_source`. */
226
224
  llmModelSource?: MCPAnalyticsModelSource;
227
225
  /**
228
226
  * Explicit PostHog event name. When set (via `capture(server, { event })`) it
@@ -476,8 +474,8 @@ export interface ToolCallCaptureData extends McpCaptureCommon {
476
474
  */
477
475
  intentSource?: MCPAnalyticsIntentSource;
478
476
  /**
479
- * The calling agent's self-reported model id -> `$mcp_llm_model`. On the
480
- * custom-dispatcher path, read it from {@link PostHogMCP.prepareToolCall}.
477
+ * The calling model id -> `$mcp_llm_model`. On the custom-dispatcher path,
478
+ * read it from {@link PostHogMCP.prepareToolCall}.
481
479
  */
482
480
  llmModel?: string;
483
481
  /** How the model id was obtained -> `$mcp_llm_model_source`. */
@@ -562,6 +560,8 @@ export interface PrepareToolCallOptions {
562
560
  originalTool?: {
563
561
  inputSchema?: unknown;
564
562
  };
563
+ /** The incoming `tools/call` request's `_meta`, used for recognized client model metadata. */
564
+ requestMeta?: JsonRecord;
565
565
  }
566
566
  /**
567
567
  * Result of {@link PostHogMCP.prepareToolCall}: the intent pulled off the
@@ -573,9 +573,9 @@ export interface PreparedToolCall {
573
573
  intent?: string;
574
574
  /** Where the intent came from. Always `context_parameter` here when set. */
575
575
  intentSource?: MCPAnalyticsIntentSource;
576
- /** The agent's self-reported model id, when `captureModel` is enabled and owned by the SDK. */
576
+ /** The calling model id, when `captureModel` is enabled and a supported source provides it. */
577
577
  llmModel?: string;
578
- /** How the model id was obtained. Always `self_reported` when present. */
578
+ /** How the model id was obtained. */
579
579
  llmModelSource?: MCPAnalyticsModelSource;
580
580
  /** The call arguments with SDK-owned `context` and `llm_model` keys removed. */
581
581
  args?: Record<string, unknown>;
@@ -589,7 +589,7 @@ export interface MissingCapabilityCaptureData extends McpCaptureCommon {
589
589
  * on the `get_more_tools` call) → `$mcp_intent`.
590
590
  */
591
591
  context?: string;
592
- /** The calling agent's self-reported model id -> `$mcp_llm_model`. */
592
+ /** The calling model id -> `$mcp_llm_model`. */
593
593
  llmModel?: string;
594
594
  /** How the model id was obtained -> `$mcp_llm_model_source`. */
595
595
  llmModelSource?: MCPAnalyticsModelSource;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAA;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAEnD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhD,+FAA+F;AAC/F,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC,eAAe,CAAA;AAC3D,qEAAqE;AACrE,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,CAAA;AAEjD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAA;IACnB,iBAAiB,CAAC,EAAE,UAAU,CAAA;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,2DAA2D;AAC3D,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oFAAoF;IACpF,WAAW,CAAC,E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E,OAAO,CAAA;IACf,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,sDAAsD;AACtD,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,0BAA0B,CAAA;IAC9C;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,sDAAsD;AACtD,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IACxC,8FAA8F;IAC9F,WAAW,CAAC,EAAE,UAAU,CAAA;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4EAA4E;IAC5E,YAAY,CAAC,EAAE,wBAAwB,CAAA;IACvC,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,qCAAqC;IACrC,cAAc,CAAC,EAAE,uBAAuB,CAAA;IACxC,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,6DAA6D;IAC7D,mBAAmB,EAAE,OAAO,CAAA;CAC7B;AAED,gGAAgG;AAChG,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;IACpE;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gEAAgE;IAChE,cAAc,CAAC,EAAE,uBAAuB,CAAA;IACxC,2EAA2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB"}
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const version = "0.13.1";
1
+ export declare const version = "0.14.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -27,7 +27,7 @@ var __webpack_require__ = {};
27
27
  })();
28
28
  var __webpack_exports__ = {};
29
29
  __webpack_require__.r(__webpack_exports__);
30
- const version = '0.13.1';
30
+ const version = '0.14.1';
31
31
  __webpack_require__.d(__webpack_exports__, {}, {
32
32
  version: version
33
33
  });
package/dist/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- const version = '0.13.1';
1
+ const version = '0.14.1';
2
2
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/mcp",
3
- "version": "0.13.1",
3
+ "version": "0.14.1",
4
4
  "bugs": {
5
5
  "url": "https://github.com/PostHog/posthog-js/issues"
6
6
  },
@@ -28,7 +28,7 @@
28
28
  "module": "dist/index.mjs",
29
29
  "types": "dist/index.d.ts",
30
30
  "dependencies": {
31
- "@posthog/core": "^1.50.6"
31
+ "@posthog/core": "^1.51.1"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@babel/preset-env": "^7.27.1",
@@ -52,8 +52,8 @@
52
52
  "zod4": "npm:zod@^4.4.3",
53
53
  "@vitest/coverage-v8": "^1.6.1",
54
54
  "vitest": "^1.6.1",
55
- "posthog-node": "^5.51.7",
56
- "@posthog-tooling/tsconfig-base": "1.1.1"
55
+ "@posthog-tooling/tsconfig-base": "1.1.1",
56
+ "posthog-node": "^5.51.8"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "@modelcontextprotocol/sdk": ">=1.26.0",
@@ -81,8 +81,8 @@ export function captureEvent(
81
81
  response: eventInput.response,
82
82
  userIntent: eventInput.userIntent,
83
83
  userIntentSource: eventInput.userIntentSource,
84
- // Self-reported per request (`captureModel`), so like the header-borne
85
- // fields above there is deliberately no sessionInfo fallback.
84
+ // Resolved per request (`captureModel`), so like the header-borne fields
85
+ // above there is deliberately no sessionInfo fallback.
86
86
  llmModel: eventInput.llmModel,
87
87
  llmModelSource: eventInput.llmModelSource,
88
88
  isError: eventInput.isError,
@@ -18,9 +18,9 @@ import { getAnalyticsParameterOwnership, stripOwnedAnalyticsArguments } from './
18
18
  import { addContextParameterToTools, getContextDescription, isContextEnabled } from './context-parameters'
19
19
  import {
20
20
  addModelParameterToTools,
21
- getModelArgument,
22
21
  getModelDescription,
23
22
  isCaptureModelEnabled,
23
+ resolveModel,
24
24
  setEventModel,
25
25
  } from './model-parameters'
26
26
  import {
@@ -271,12 +271,11 @@ async function prepareToolCallEvent(
271
271
 
272
272
  await applyResolvedMetadata(event, data, request, extra)
273
273
  setEventIntent(event, await resolveToolCallIntent(data, request, canCaptureContextIntent, extra))
274
- // Unlike intent, the model is only read under positive ownership: with
275
- // ownership unresolved, `llm_model` may be the application's own argument,
276
- // and recording a customer value as the calling agent's model is worse
277
- // than a gap in coverage.
278
- if (ownership.llmModel) {
279
- setEventModel(event, getModelArgument(request))
274
+ // Client metadata does not collide with an application's tool arguments.
275
+ // Self-report still requires positive ownership before we read `llm_model`.
276
+ if (isCaptureModelEnabled(data.options.captureModel)) {
277
+ const resolvedModel = resolveModel(request, ownership.llmModel)
278
+ setEventModel(event, resolvedModel?.model, resolvedModel?.source)
280
279
  }
281
280
  return { event, requestAttribution }
282
281
  } catch (error) {
@@ -1,24 +1,21 @@
1
- import type { MCPAnalyticsOptions, MCPRequestLike, McpEvent } from '../types'
1
+ import type { MCPAnalyticsModelSource, MCPAnalyticsOptions, MCPRequestLike, McpEvent } from '../types'
2
2
  import { addAnalyticsParameterToTool, type AnalyticsInjectableJsonSchema } from './analytics-parameters'
3
3
  import { DEFAULT_MODEL_PARAMETER_DESCRIPTION } from './constants'
4
4
  import { log, type LoggerFn } from './logger'
5
5
 
6
6
  /**
7
- * Self-reported model capture (`captureModel`).
7
+ * Model capture (`captureModel`).
8
8
  *
9
- * MCP keeps servers deliberately model-ignorant: the wire carries client
10
- * name/version and protocol version, never the LLM behind the client, and no
11
- * spec revision changes that. The one place the information exists on the
12
- * server side of the connection is the agent itself — harnesses inject the
13
- * model id into the system prompt, so the agent can state it the same way it
14
- * states its intent through the `context` parameter.
9
+ * MCP does not standardize model identity. Some clients expose it through
10
+ * vendor metadata, while other harnesses inject the model id into the system
11
+ * prompt so the agent can state it like intent through the `context` parameter.
15
12
  *
16
13
  * This module injects a required `llm_model` string parameter into every tool
17
14
  * (mirroring `context-parameters.ts`), strips it before the tool runs, and
18
- * captures it as `$mcp_llm_model` with `$mcp_llm_model_source = "self_reported"`.
19
- * The source property is deliberate: like `clientInfo` in the MCP spec, the
20
- * value is self-reported and unverified — right for degradation analytics
21
- * ("does our MCP get worse on model X?"), never for billing or security.
15
+ * captures the best available value as `$mcp_llm_model`. Client metadata wins
16
+ * over self-report, and `$mcp_llm_model_source` preserves that provenance.
17
+ * Both sources are unverified — right for degradation analytics ("does our MCP
18
+ * get worse on model X?"), never for billing or security.
22
19
  *
23
20
  * Reasoning effort is deliberately NOT captured: it never crosses the wire,
24
21
  * and models cannot reliably self-report it (harnesses apply it as a sampling
@@ -77,6 +74,41 @@ export function getModelArgument(request: MCPRequestLike): string | undefined {
77
74
  return normalizeModel(request.params?.arguments?.llm_model)
78
75
  }
79
76
 
77
+ const CODEX_TURN_METADATA_KEY = 'x-codex-turn-metadata'
78
+
79
+ export interface ResolvedModel {
80
+ model: string
81
+ source: MCPAnalyticsModelSource
82
+ }
83
+
84
+ /**
85
+ * Resolves model identity from sources visible to an MCP server. The Codex
86
+ * request metadata is host-generated and therefore more reliable than a model
87
+ * filling an injected argument, but remains unverified client input.
88
+ */
89
+ export function resolveModel(request: MCPRequestLike, allowSelfReported: boolean): ResolvedModel | undefined {
90
+ const codexMetadata = request.params?._meta?.[CODEX_TURN_METADATA_KEY]
91
+ if (isRecord(codexMetadata) && Object.prototype.hasOwnProperty.call(codexMetadata, 'model')) {
92
+ const model = normalizeModel(codexMetadata.model)
93
+ if (model) {
94
+ return { model, source: 'client_metadata' }
95
+ }
96
+ }
97
+
98
+ if (allowSelfReported) {
99
+ const model = getModelArgument(request)
100
+ if (model) {
101
+ return { model, source: 'self_reported' }
102
+ }
103
+ }
104
+
105
+ return undefined
106
+ }
107
+
108
+ function isRecord(value: unknown): value is Record<string, unknown> {
109
+ return typeof value === 'object' && value !== null && !Array.isArray(value)
110
+ }
111
+
80
112
  function normalizeModel(model: unknown): string | undefined {
81
113
  if (typeof model !== 'string') {
82
114
  return undefined
@@ -88,11 +120,15 @@ function normalizeModel(model: unknown): string | undefined {
88
120
  return trimmed
89
121
  }
90
122
 
91
- export function setEventModel(event: McpEvent, model: string | undefined): void {
123
+ export function setEventModel(
124
+ event: McpEvent,
125
+ model: string | undefined,
126
+ source: MCPAnalyticsModelSource = 'self_reported'
127
+ ): void {
92
128
  const normalizedModel = normalizeModel(model)
93
129
  if (!normalizedModel) {
94
130
  return
95
131
  }
96
132
  event.llmModel = normalizedModel
97
- event.llmModelSource = 'self_reported'
133
+ event.llmModelSource = source
98
134
  }
@@ -170,8 +170,8 @@ function addCommonEventProperties(event: Event, properties: Record<string, unkno
170
170
  if (event.userIntentSource) {
171
171
  properties[PostHogMCPAnalyticsProperty.IntentSource] = event.userIntentSource
172
172
  }
173
- // Self-reported by the calling agent (`captureModel`), so present only on the
174
- // requests where the agent supplied a definite value — never inferred.
173
+ // Supplied by recognized client metadata or the calling agent (`captureModel`),
174
+ // so it is present only on requests carrying a definite value.
175
175
  if (event.llmModel) {
176
176
  properties[PostHogMCPAnalyticsProperty.LlmModel] = event.llmModel
177
177
  }
@@ -27,9 +27,9 @@ import { applyMcpLibIdentity } from './lib-identity'
27
27
  import { log } from './logger'
28
28
  import {
29
29
  addModelParameterToTool,
30
- getModelArgument,
31
30
  getModelDescription,
32
31
  isCaptureModelEnabled,
32
+ resolveModel,
33
33
  setEventModel,
34
34
  } from './model-parameters'
35
35
  import { McpEventSink } from './sink'
@@ -48,8 +48,8 @@ export interface PostHogMCPOptions extends PostHogOptions {
48
48
  */
49
49
  missingCapabilityToolName?: string
50
50
  /**
51
- * Inject a required `llm_model` argument into advertised tools and capture
52
- * the agent's self-reported value. Off by default.
51
+ * Capture the calling model from recognized client metadata, with an injected
52
+ * `llm_model` argument as fallback. Off by default.
53
53
  */
54
54
  captureModel?: MCPAnalyticsOptions['captureModel']
55
55
  }
@@ -118,10 +118,7 @@ export class PostHogMCP extends PostHog {
118
118
  event.isError = data.isError
119
119
  event.errorType = data.errorType
120
120
  applyIntent(event, data.intent, data.intentSource)
121
- setEventModel(event, data.llmModel)
122
- if (event.llmModel && data.llmModelSource) {
123
- event.llmModelSource = data.llmModelSource
124
- }
121
+ setEventModel(event, data.llmModel, data.llmModelSource)
125
122
  if (data.isError) {
126
123
  event.error = captureException(data.error ?? `Tool ${data.toolName} returned an error`)
127
124
  }
@@ -234,7 +231,7 @@ export class PostHogMCP extends PostHog {
234
231
  * @example
235
232
  * ```ts
236
233
  * const { intent, intentSource, llmModel, llmModelSource, args, isMissingCapability } =
237
- * posthog.prepareToolCall(name, rawArgs)
234
+ * posthog.prepareToolCall(name, rawArgs, { requestMeta: request.params?._meta })
238
235
  * if (isMissingCapability) {
239
236
  * posthog.captureMissingCapability({ context: intent, llmModel, llmModelSource, ...identity })
240
237
  * return getMoreToolsResult()
@@ -255,13 +252,15 @@ export class PostHogMCP extends PostHog {
255
252
  (options.originalTool
256
253
  ? analyticsOwnsParameter(options.originalTool.inputSchema, 'llm_model')
257
254
  : this.#modelParameterOwnership.get(name) === true)
258
- const llmModel = ownsModel ? getModelArgument({ params: { arguments: args } }) : undefined
255
+ const resolvedModel = isCaptureModelEnabled(this.#captureModel)
256
+ ? resolveModel({ params: { arguments: args, _meta: options.requestMeta } }, ownsModel)
257
+ : undefined
259
258
  const strippedArgs = stripContext(args)
260
259
  return {
261
260
  intent,
262
261
  intentSource: intent ? 'context_parameter' : undefined,
263
- llmModel,
264
- llmModelSource: llmModel ? 'self_reported' : undefined,
262
+ llmModel: resolvedModel?.model,
263
+ llmModelSource: resolvedModel?.source,
265
264
  args: ownsModel
266
265
  ? (stripOwnedAnalyticsArguments(strippedArgs, {
267
266
  context: false,
@@ -283,10 +282,7 @@ export class PostHogMCP extends PostHog {
283
282
  event.resourceName = this.#missingCapabilityToolName
284
283
  event.parameters = data.parameters
285
284
  applyIntent(event, data.context, 'context_parameter')
286
- setEventModel(event, data.llmModel)
287
- if (event.llmModel && data.llmModelSource) {
288
- event.llmModelSource = data.llmModelSource
289
- }
285
+ setEventModel(event, data.llmModel, data.llmModelSource)
290
286
  this.#emit(event)
291
287
  }
292
288
 
package/src/types.ts CHANGED
@@ -67,6 +67,7 @@ export interface CompatibleTextToolResult {
67
67
  }
68
68
 
69
69
  export interface MCPRequestParamsLike {
70
+ _meta?: JsonRecord
70
71
  arguments?: JsonRecord
71
72
  name?: string
72
73
  [key: string]: unknown
@@ -130,17 +131,15 @@ export interface MCPAnalyticsOptions {
130
131
  /** Inject a required `context` parameter on every tool to capture user intent. */
131
132
  context?: boolean | MCPAnalyticsContextOptions
132
133
  /**
133
- * Inject a required `llm_model` parameter on every tool so the calling agent
134
- * self-reports the model it runs as, captured as `$mcp_llm_model` with
135
- * `$mcp_llm_model_source = "self_reported"`. Off by default.
134
+ * Capture the calling model as `$mcp_llm_model`. Recognized client metadata
135
+ * takes precedence, with an injected `llm_model` parameter as the fallback.
136
+ * Off by default.
136
137
  *
137
- * The MCP wire deliberately carries no model identity, so self-report is the
138
- * only capture path — harnesses inject the model id into the agent's system
139
- * prompt, and agents restate it accurately. Like `clientInfo` in the MCP
140
- * spec, the value is unverified: use it for per-model quality analytics, not
141
- * billing or security. An honest `"unknown"` from the agent is dropped
142
- * rather than captured. Reasoning effort is intentionally not collected —
143
- * agents don't reliably know it, so it would only ever be noise.
138
+ * MCP does not standardize model identity. Some clients expose it through
139
+ * vendor metadata; other harnesses inject it into the agent's system prompt
140
+ * so the agent can restate it. `$mcp_llm_model_source` records which path won.
141
+ * Both paths are unverified: use them for quality analytics, not billing or
142
+ * security. Missing, blank, and `"unknown"` values are dropped.
144
143
  */
145
144
  captureModel?: boolean | MCPAnalyticsModelOptions
146
145
  /**
@@ -192,7 +191,7 @@ export interface MCPAnalyticsModelOptions {
192
191
 
193
192
  export type MaybePromise<T> = T | Promise<T>
194
193
  export type MCPAnalyticsIntentSource = 'context_parameter' | 'inferred'
195
- export type MCPAnalyticsModelSource = 'self_reported'
194
+ export type MCPAnalyticsModelSource = 'client_metadata' | 'self_reported'
196
195
 
197
196
  export type ToolCallback =
198
197
  | ((
@@ -245,12 +244,11 @@ export interface Event {
245
244
  eventType: MCPAnalyticsEventType
246
245
  groups?: Record<string, string>
247
246
  /**
248
- * The calling agent's self-reported model id → `$mcp_llm_model`. Read off
249
- * the SDK-injected `llm_model` argument (`captureModel` option); unverified
250
- * by design, like the MCP spec's own `clientInfo`.
247
+ * The calling model id → `$mcp_llm_model`. Resolved from recognized client
248
+ * metadata first, then the SDK-injected `llm_model` argument; unverified.
251
249
  */
252
250
  llmModel?: string
253
- /** How the model id was obtained → `$mcp_llm_model_source`. Always `self_reported` today. */
251
+ /** How the model id was obtained → `$mcp_llm_model_source`. */
254
252
  llmModelSource?: MCPAnalyticsModelSource
255
253
  /**
256
254
  * Explicit PostHog event name. When set (via `capture(server, { event })`) it
@@ -512,8 +510,8 @@ export interface ToolCallCaptureData extends McpCaptureCommon {
512
510
  */
513
511
  intentSource?: MCPAnalyticsIntentSource
514
512
  /**
515
- * The calling agent's self-reported model id -> `$mcp_llm_model`. On the
516
- * custom-dispatcher path, read it from {@link PostHogMCP.prepareToolCall}.
513
+ * The calling model id -> `$mcp_llm_model`. On the custom-dispatcher path,
514
+ * read it from {@link PostHogMCP.prepareToolCall}.
517
515
  */
518
516
  llmModel?: string
519
517
  /** How the model id was obtained -> `$mcp_llm_model_source`. */
@@ -600,6 +598,8 @@ export interface PrepareToolCallOptions {
600
598
  * multi-replica servers so SDK argument ownership is resolved per request.
601
599
  */
602
600
  originalTool?: { inputSchema?: unknown }
601
+ /** The incoming `tools/call` request's `_meta`, used for recognized client model metadata. */
602
+ requestMeta?: JsonRecord
603
603
  }
604
604
 
605
605
  /**
@@ -612,9 +612,9 @@ export interface PreparedToolCall {
612
612
  intent?: string
613
613
  /** Where the intent came from. Always `context_parameter` here when set. */
614
614
  intentSource?: MCPAnalyticsIntentSource
615
- /** The agent's self-reported model id, when `captureModel` is enabled and owned by the SDK. */
615
+ /** The calling model id, when `captureModel` is enabled and a supported source provides it. */
616
616
  llmModel?: string
617
- /** How the model id was obtained. Always `self_reported` when present. */
617
+ /** How the model id was obtained. */
618
618
  llmModelSource?: MCPAnalyticsModelSource
619
619
  /** The call arguments with SDK-owned `context` and `llm_model` keys removed. */
620
620
  args?: Record<string, unknown>
@@ -629,7 +629,7 @@ export interface MissingCapabilityCaptureData extends McpCaptureCommon {
629
629
  * on the `get_more_tools` call) → `$mcp_intent`.
630
630
  */
631
631
  context?: string
632
- /** The calling agent's self-reported model id -> `$mcp_llm_model`. */
632
+ /** The calling model id -> `$mcp_llm_model`. */
633
633
  llmModel?: string
634
634
  /** How the model id was obtained -> `$mcp_llm_model_source`. */
635
635
  llmModelSource?: MCPAnalyticsModelSource
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '0.13.1'
1
+ export const version = '0.14.1'