@socialneuron/mcp-server 1.3.1 → 1.4.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to `@socialneuron/mcp-server` will be documented in this file.
4
4
 
5
+ ## [1.4.0] - 2026-03-13
6
+
7
+ ### Changed
8
+ - **Telemetry is now opt-IN**: No data is sent unless `SOCIALNEURON_TELEMETRY=1` is explicitly set. Previously telemetry was opt-out.
9
+ - **PostHog moved to optionalDependencies**: `posthog-node` is no longer a required runtime dependency. The package works fully without it installed. This reduces supply chain surface and resolves socket.dev security flags.
10
+ - **Dynamic import**: PostHog is loaded via `import()` at runtime, silently skipped if unavailable.
11
+ - `DO_NOT_TRACK=1` continues to override and disable telemetry in all cases.
12
+
13
+ ## [1.3.2] - 2026-03-13
14
+
15
+ ### Fixed
16
+ - **TypeScript strict mode**: Added `@types/express`, fixed `AuthenticatedRequest` type to extend express `Request`, corrected `StreamableHTTPServerTransport` constructor usage
17
+ - **Optional dependency stubs**: Added ambient declarations for `playwright`, `@remotion/bundler`, `@remotion/renderer` (dynamically imported, not required at runtime)
18
+ - **Removed unused directive**: Cleaned up stale `@ts-expect-error` in REPL module
19
+ - **Release CI**: Typecheck now passes in GitHub Actions release workflow
20
+
5
21
  ## [1.3.1] - 2026-03-13
6
22
 
7
23
  ### Fixed
package/README.md CHANGED
@@ -250,17 +250,26 @@ Each iteration produces smarter content as performance data feeds back into the
250
250
  - SSRF protection on all URL parameters with DNS rebinding prevention
251
251
  - Rate limiting per user with per-tool limits for expensive operations
252
252
  - Agent loop detection prevents runaway automation
253
- - Set `DO_NOT_TRACK=1` to disable anonymous usage telemetry
253
+ - Telemetry is off by default opt in with `SOCIALNEURON_TELEMETRY=1`
254
254
 
255
255
  See [SECURITY.md](./SECURITY.md) for our vulnerability disclosure policy and credential safety details.
256
256
 
257
257
  ## Telemetry
258
258
 
259
- This package collects anonymous usage metrics (tool name, duration, success/failure) to improve the product. Your user ID is hashed before transmission.
259
+ Telemetry is **off by default**. No data is collected unless you explicitly opt in.
260
260
 
261
- **To disable**: Set `DO_NOT_TRACK=1` or `SOCIALNEURON_NO_TELEMETRY=1` in your environment.
261
+ **To enable**: Set `SOCIALNEURON_TELEMETRY=1` in your environment.
262
262
 
263
- No personal content, API keys, or request payloads are ever collected.
263
+ **To disable**: `DO_NOT_TRACK=1` or `SOCIALNEURON_NO_TELEMETRY=1` always disables telemetry, even if `SOCIALNEURON_TELEMETRY=1` is set.
264
+
265
+ When enabled, the following anonymous metrics are collected via PostHog:
266
+ - Tool name invoked
267
+ - Success or failure status
268
+ - Invocation duration (ms)
269
+
270
+ No personal content, API keys, or request payloads are ever collected. Your user ID is hashed (SHA-256) before transmission.
271
+
272
+ `posthog-node` is an optional dependency — if it is not installed, telemetry is a silent no-op regardless of environment variables.
264
273
 
265
274
  ## Examples
266
275
 
package/dist/http.js CHANGED
@@ -10,16 +10,24 @@ var __export = (target, all) => {
10
10
 
11
11
  // src/lib/posthog.ts
12
12
  import { createHash } from "node:crypto";
13
- import { PostHog } from "posthog-node";
14
13
  function hashUserId(userId) {
15
14
  return createHash("sha256").update(`${POSTHOG_SALT}:${userId}`).digest("hex").substring(0, 32);
16
15
  }
16
+ function isTelemetryOptedIn() {
17
+ if (process.env.DO_NOT_TRACK === "1" || process.env.DO_NOT_TRACK === "true" || process.env.SOCIALNEURON_NO_TELEMETRY === "1") {
18
+ return false;
19
+ }
20
+ return process.env.SOCIALNEURON_TELEMETRY === "1";
21
+ }
17
22
  function initPostHog() {
18
- if (isTelemetryDisabled()) return;
23
+ if (!isTelemetryOptedIn()) return;
19
24
  const key = process.env.POSTHOG_KEY || process.env.VITE_POSTHOG_KEY;
20
25
  const host = process.env.POSTHOG_HOST || process.env.VITE_POSTHOG_HOST || "https://eu.i.posthog.com";
21
26
  if (!key) return;
22
- client = new PostHog(key, { host, flushAt: 5, flushInterval: 1e4 });
27
+ import("posthog-node").then(({ PostHog }) => {
28
+ client = new PostHog(key, { host, flushAt: 5, flushInterval: 1e4 });
29
+ }).catch(() => {
30
+ });
23
31
  }
24
32
  async function captureToolEvent(args) {
25
33
  if (!client) return;
@@ -6215,7 +6223,7 @@ init_supabase();
6215
6223
  import { z as z14 } from "zod";
6216
6224
 
6217
6225
  // src/lib/version.ts
6218
- var MCP_VERSION = "1.3.1";
6226
+ var MCP_VERSION = "1.4.0";
6219
6227
 
6220
6228
  // src/tools/usage.ts
6221
6229
  function asEnvelope10(data) {
@@ -8613,7 +8621,15 @@ app.post("/mcp", authenticateRequest, async (req, res) => {
8613
8621
  applyScopeEnforcement(server, () => getRequestScopes() ?? auth.scopes);
8614
8622
  registerAllTools(server, { skipScreenshots: true });
8615
8623
  const transport = new StreamableHTTPServerTransport({
8616
- sessionIdGenerator: () => randomUUID3()
8624
+ sessionIdGenerator: () => randomUUID3(),
8625
+ onsessioninitialized: (sessionId) => {
8626
+ sessions.set(sessionId, {
8627
+ transport,
8628
+ server,
8629
+ lastActivity: Date.now(),
8630
+ userId: auth.userId
8631
+ });
8632
+ }
8617
8633
  });
8618
8634
  transport.onclose = () => {
8619
8635
  if (transport.sessionId) {
@@ -8621,16 +8637,6 @@ app.post("/mcp", authenticateRequest, async (req, res) => {
8621
8637
  }
8622
8638
  };
8623
8639
  await server.connect(transport);
8624
- const originalOnSessionInit = transport.onsessioninitialized;
8625
- transport.onsessioninitialized = async (sessionId) => {
8626
- if (originalOnSessionInit) await originalOnSessionInit(sessionId);
8627
- sessions.set(sessionId, {
8628
- transport,
8629
- server,
8630
- lastActivity: Date.now(),
8631
- userId: auth.userId
8632
- });
8633
- };
8634
8640
  await requestContext.run(
8635
8641
  { userId: auth.userId, scopes: auth.scopes, creditsUsed: 0, assetsGenerated: 0 },
8636
8642
  () => transport.handleRequest(req, res, req.body)
package/dist/index.js CHANGED
@@ -14,22 +14,30 @@ var MCP_VERSION;
14
14
  var init_version = __esm({
15
15
  "src/lib/version.ts"() {
16
16
  "use strict";
17
- MCP_VERSION = "1.3.1";
17
+ MCP_VERSION = "1.4.0";
18
18
  }
19
19
  });
20
20
 
21
21
  // src/lib/posthog.ts
22
22
  import { createHash } from "node:crypto";
23
- import { PostHog } from "posthog-node";
24
23
  function hashUserId(userId) {
25
24
  return createHash("sha256").update(`${POSTHOG_SALT}:${userId}`).digest("hex").substring(0, 32);
26
25
  }
26
+ function isTelemetryOptedIn() {
27
+ if (process.env.DO_NOT_TRACK === "1" || process.env.DO_NOT_TRACK === "true" || process.env.SOCIALNEURON_NO_TELEMETRY === "1") {
28
+ return false;
29
+ }
30
+ return process.env.SOCIALNEURON_TELEMETRY === "1";
31
+ }
27
32
  function initPostHog() {
28
- if (isTelemetryDisabled()) return;
33
+ if (!isTelemetryOptedIn()) return;
29
34
  const key = process.env.POSTHOG_KEY || process.env.VITE_POSTHOG_KEY;
30
35
  const host = process.env.POSTHOG_HOST || process.env.VITE_POSTHOG_HOST || "https://eu.i.posthog.com";
31
36
  if (!key) return;
32
- client = new PostHog(key, { host, flushAt: 5, flushInterval: 1e4 });
37
+ import("posthog-node").then(({ PostHog }) => {
38
+ client = new PostHog(key, { host, flushAt: 5, flushInterval: 1e4 });
39
+ }).catch(() => {
40
+ });
33
41
  }
34
42
  async function captureToolEvent(args) {
35
43
  if (!client) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socialneuron/mcp-server",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "MCP server for Social Neuron - AI content creation platform",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -65,10 +65,13 @@
65
65
  "express": "^5.1.0",
66
66
  "jose": "^6.2.1",
67
67
  "open": "10.0.0",
68
- "posthog-node": "^5.28.0",
69
68
  "zod": "^4.0.0"
70
69
  },
70
+ "optionalDependencies": {
71
+ "posthog-node": "^5.28.0"
72
+ },
71
73
  "devDependencies": {
74
+ "@types/express": "^5.0.6",
72
75
  "@types/node": "^25.3.5",
73
76
  "esbuild": "^0.27.3",
74
77
  "typescript": "^5.9.3",