mobile-growth-mcp 2.3.6 → 2.3.7

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.
Files changed (2) hide show
  1. package/dist/index.js +14 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ async function jsonRpcRequest(apiKey2, method, params) {
26
26
  headers: {
27
27
  "Content-Type": "application/json",
28
28
  "x-api-key": apiKey2,
29
- Accept: "application/json"
29
+ Accept: "application/json, text/event-stream"
30
30
  },
31
31
  body: JSON.stringify(body),
32
32
  signal: AbortSignal.timeout(15e3)
@@ -39,9 +39,20 @@ async function jsonRpcRequest(apiKey2, method, params) {
39
39
  );
40
40
  throw new Error(`Edge Function error (${res.status}): ${text}`);
41
41
  }
42
- const json = await res.json();
42
+ const contentType = res.headers.get("content-type") ?? "";
43
+ let json;
44
+ if (contentType.includes("text/event-stream")) {
45
+ const text = await res.text();
46
+ const match = text.match(/^data:\s*(.+)$/m);
47
+ if (!match) {
48
+ throw new Error(`SSE response had no data line: ${text.slice(0, 200)}`);
49
+ }
50
+ json = JSON.parse(match[1]);
51
+ } else {
52
+ json = await res.json();
53
+ }
43
54
  console.error(
44
- `[proxy] \u2190 #${id} ${label} ok in ${Date.now() - t0}ms (headers ${headersMs}ms)`
55
+ `[proxy] \u2190 #${id} ${label} ok in ${Date.now() - t0}ms (headers ${headersMs}ms, ct=${contentType.split(";")[0] || "?"})`
45
56
  );
46
57
  return json;
47
58
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobile-growth-mcp",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
4
4
  "description": "MCP server for mobile growth & UA knowledge base — campaign optimization, creative strategy, and subscription app insights",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",