mobile-growth-mcp 2.3.6 → 2.3.8

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 +23 -5
  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) {
@@ -1704,13 +1715,19 @@ Assets exist in the account and can be linked manually.`;
1704
1715
  }
1705
1716
 
1706
1717
  // src/tools/connection-status.ts
1718
+ var SERVER_VERSION = true ? "2.3.8" : "dev";
1707
1719
  function registerConnectionStatus(server2, status2) {
1708
1720
  server2.tool(
1709
1721
  "connection_status",
1710
1722
  "Check the connection status of the knowledge base and Google Ads API. Call this if tools seem missing or you get unexpected errors.",
1711
1723
  {},
1712
1724
  async () => {
1713
- const lines = ["# Connection Status", ""];
1725
+ const lines = [
1726
+ "# Connection Status",
1727
+ "",
1728
+ `**Server version:** mobile-growth-mcp@${SERVER_VERSION}`,
1729
+ ""
1730
+ ];
1714
1731
  if (status2.kb.connected) {
1715
1732
  lines.push(
1716
1733
  `## Knowledge Base: Connected`,
@@ -2491,6 +2508,7 @@ if (googleAdsResult.refreshToken)
2491
2508
  process.env.GOOGLE_ADS_REFRESH_TOKEN = googleAdsResult.refreshToken;
2492
2509
  if (googleAdsResult.loginCustomerId)
2493
2510
  process.env.GOOGLE_ADS_LOGIN_CUSTOMER_ID = googleAdsResult.loginCustomerId;
2511
+ console.error(`mobile-growth-mcp@${SERVER_VERSION} starting`);
2494
2512
  var apiKey = apiKeyResult.value;
2495
2513
  console.error(
2496
2514
  apiKey ? `API key: ${apiKeyResult.source}` : "API key: not configured \u2014 KB tools will not be available"
@@ -2500,7 +2518,7 @@ console.error(
2500
2518
  );
2501
2519
  var server = new McpServer({
2502
2520
  name: "mobile-growth-mcp",
2503
- version: "2.0.0"
2521
+ version: SERVER_VERSION
2504
2522
  });
2505
2523
  var status = {
2506
2524
  kb: { connected: false, toolCount: 0, promptCount: 0 },
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.8",
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",