@clipform/mcp-server 5.9.0 → 5.10.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/dist/index.js CHANGED
@@ -4,11 +4,11 @@ import {
4
4
  createServer,
5
5
  process as process2,
6
6
  serializeMessage
7
- } from "./chunk-EQPYULVM.js";
8
- import "./chunk-YFOTTAGR.js";
9
- import "./chunk-5AODH5TC.js";
10
- import "./chunk-HHRUYPFP.js";
11
- import "./chunk-7PJHCRSD.js";
7
+ } from "./chunk-LCTBXXYI.js";
8
+ import "./chunk-IMRQG5GI.js";
9
+ import "./chunk-QHIVMOLB.js";
10
+ import "./chunk-4RHYPCK5.js";
11
+ import "./chunk-Z2DXO3RN.js";
12
12
  import "./chunk-ENVV65JX.js";
13
13
  import {
14
14
  setMcpVersion
@@ -41,6 +41,13 @@ interface McpTelemetryContext {
41
41
  /** ChatGPT `_meta["openai/locale"]` (BCP 47). Language hint only - never location. */
42
42
  clientLocale?: string;
43
43
  }
44
+ /**
45
+ * #6058: PostHog's bot detection (`$virt_is_bot`, `$virt_traffic_type`, custom
46
+ * bot rules) reads `$raw_user_agent`, and our server-side events carry the
47
+ * caller's UA only as the SDK's `$mcp_client_user_agent`. Copy it across so
48
+ * directory crawlers and liveness probes classify. Same string, no new data.
49
+ */
50
+ declare function stampRawUserAgent(properties: Record<string, unknown>): void;
44
51
  declare function buildInstrumentOptions(mcpAuth: {
45
52
  user_id?: string;
46
53
  } | null, opts?: InstrumentServerOptions, telemetry?: McpTelemetryContext): MCPAnalyticsOptions;
@@ -56,4 +63,4 @@ declare function instrumentServer(server: unknown, posthogClient: McpAnalyticsCl
56
63
  user_id?: string;
57
64
  } | null, opts?: InstrumentServerOptions, telemetry?: McpTelemetryContext): void;
58
65
 
59
- export { type InstrumentServerOptions, type McpTelemetryContext, buildInstrumentOptions, getMcpAnalyticsClient, instrumentServer, setMcpAnalyticsClient };
66
+ export { type InstrumentServerOptions, type McpTelemetryContext, buildInstrumentOptions, getMcpAnalyticsClient, instrumentServer, setMcpAnalyticsClient, stampRawUserAgent };
@@ -5239,6 +5239,12 @@ function setMcpAnalyticsClient(client) {
5239
5239
  function getMcpAnalyticsClient() {
5240
5240
  return installedClient;
5241
5241
  }
5242
+ function stampRawUserAgent(properties) {
5243
+ const ua = properties[PostHogMCPAnalyticsProperty.ClientUserAgent];
5244
+ if (typeof ua === "string" && ua && properties.$raw_user_agent === void 0) {
5245
+ properties.$raw_user_agent = ua;
5246
+ }
5247
+ }
5242
5248
  function buildInstrumentOptions(mcpAuth, opts = {}, telemetry) {
5243
5249
  return {
5244
5250
  context: {
@@ -5261,6 +5267,7 @@ function buildInstrumentOptions(mcpAuth, opts = {}, telemetry) {
5261
5267
  }
5262
5268
  delete event.properties[PostHogMCPAnalyticsProperty.Parameters];
5263
5269
  delete event.properties[PostHogMCPAnalyticsProperty.Response];
5270
+ stampRawUserAgent(event.properties);
5264
5271
  if (telemetry) {
5265
5272
  if (telemetry.clientOrigin) event.properties.client_origin = telemetry.clientOrigin;
5266
5273
  if (telemetry.authMode) event.properties.auth_mode = telemetry.authMode;
@@ -5293,7 +5300,8 @@ export {
5293
5300
  buildInstrumentOptions,
5294
5301
  getMcpAnalyticsClient,
5295
5302
  instrumentServer,
5296
- setMcpAnalyticsClient
5303
+ setMcpAnalyticsClient,
5304
+ stampRawUserAgent
5297
5305
  };
5298
5306
  /*! Bundled license information:
5299
5307