@clipform/mcp-server 2.5.1 → 2.10.2

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.
@@ -4,7 +4,7 @@ import {
4
4
  FORM_TYPE_KEYS,
5
5
  callApi,
6
6
  getSessionContext
7
- } from "./chunk-3BYQLPTT.js";
7
+ } from "./chunk-IL26A4IN.js";
8
8
 
9
9
  // src/lib/guides.ts
10
10
  var guidesPromise = null;
@@ -133,4 +133,4 @@ export {
133
133
  getGuideUri,
134
134
  registerResources
135
135
  };
136
- //# sourceMappingURL=chunk-6EHOUAPE.js.map
136
+ //# sourceMappingURL=chunk-UBJ7CZL2.js.map
package/dist/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  JSONRPCMessageSchema,
4
4
  createServer
5
- } from "./chunk-3GBZFAEM.js";
6
- import "./chunk-NYMC63ZK.js";
7
- import "./chunk-6EHOUAPE.js";
8
- import "./chunk-3BYQLPTT.js";
5
+ } from "./chunk-NCWQ42GI.js";
6
+ import "./chunk-4QF4KGPE.js";
7
+ import "./chunk-UBJ7CZL2.js";
8
+ import "./chunk-IL26A4IN.js";
9
9
  import "./chunk-ENHVQDSI.js";
10
10
  import {
11
11
  setMcpVersion
@@ -0,0 +1,30 @@
1
+ import { MCPAnalyticsOptions, instrument } from '@posthog/mcp';
2
+
3
+ /** The PostHog client shape `instrument()` itself expects. */
4
+ type McpAnalyticsClient = Parameters<typeof instrument>[1];
5
+ declare function setMcpAnalyticsClient(client: McpAnalyticsClient | null): void;
6
+ declare function getMcpAnalyticsClient(): McpAnalyticsClient | null;
7
+ /**
8
+ * #3408: options for the `@posthog/mcp` `instrument()` wrap around the
9
+ * per-request server. Additive alongside (never a replacement for) the
10
+ * hand-rolled `mcp_request`/`$exception` capture in apps/api's mcp/handler.ts -
11
+ * see the mcp-miner skill for why both stay live during the parity window.
12
+ * Pulled out so the options object is unit-testable without standing up the
13
+ * raw-HTTP handler.
14
+ */
15
+ declare function buildInstrumentOptions(mcpAuth: {
16
+ user_id?: string;
17
+ } | null): MCPAnalyticsOptions;
18
+ /**
19
+ * Wraps the per-request/per-connection server with PostHog MCP analytics
20
+ * (#3408, extended in-process #3432), additively - `mcp_request`/`$exception`
21
+ * in apps/api's mcp/handler.ts are untouched. Never throws into the request
22
+ * path: no-ops when `posthogClient` is unset (dev, or no client installed via
23
+ * `setMcpAnalyticsClient`) and swallows any wrapper failure so a PostHog-side
24
+ * bug can never break a tool call.
25
+ */
26
+ declare function instrumentServer(server: unknown, posthogClient: McpAnalyticsClient | null, mcpAuth: {
27
+ user_id?: string;
28
+ } | null): void;
29
+
30
+ export { buildInstrumentOptions, getMcpAnalyticsClient, instrumentServer, setMcpAnalyticsClient };