mcp-google-ads 1.0.7 → 1.0.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.
@@ -1 +1 @@
1
- {"sha":"3490598","builtAt":"2026-04-09T21:18:29.192Z"}
1
+ {"sha":"bdd46f2","builtAt":"2026-04-09T21:28:07.536Z"}
package/dist/index.js CHANGED
@@ -8,29 +8,30 @@ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextpro
8
8
  import { tools } from "./tools.js";
9
9
  import { GoogleAdsApi, enums } from "google-ads-api";
10
10
  import { readFileSync, existsSync } from "fs";
11
+ // CLI package info
12
+ const __cliPkg = JSON.parse(readFileSync(join(dirname(new URL(import.meta.url).pathname), "..", "package.json"), "utf-8"));
11
13
  // Log build fingerprint at startup
12
14
  try {
13
15
  const __buildInfoDir = dirname(new URL(import.meta.url).pathname);
14
16
  const buildInfo = JSON.parse(readFileSync(join(__buildInfoDir, "build-info.json"), "utf-8"));
15
- logger.info({ sha: buildInfo.sha, builtAt: buildInfo.builtAt }, "Build fingerprint");
17
+ console.error(`[build] SHA: ${buildInfo.sha} (${buildInfo.builtAt})`);
16
18
  }
17
19
  catch {
18
- // build-info.json not present (dev mode)
20
+ console.error(`[build] ${__cliPkg.name}@${__cliPkg.version} (dev mode)`);
19
21
  }
20
22
  // CLI flags
21
- const __cliPkg = JSON.parse(readFileSync(join(dirname(new URL(import.meta.url).pathname), "..", "package.json"), "utf-8"));
22
23
  if (process.argv.includes("--help") || process.argv.includes("-h")) {
23
- console.log(`${__cliPkg.name} v${__cliPkg.version}\n`);
24
- console.log(`Usage: ${__cliPkg.name} [options]\n`);
25
- console.log("MCP server communicating via stdio. Configure in your .mcp.json.\n");
26
- console.log("Options:");
27
- console.log(" --help, -h Show this help message");
28
- console.log(" --version, -v Show version number");
29
- console.log(`\nDocumentation: https://github.com/mharnett/mcp-google-ads`);
24
+ console.error(`${__cliPkg.name} v${__cliPkg.version}\n`);
25
+ console.error(`Usage: ${__cliPkg.name} [options]\n`);
26
+ console.error("MCP server communicating via stdio. Configure in your .mcp.json.\n");
27
+ console.error("Options:");
28
+ console.error(" --help, -h Show this help message");
29
+ console.error(" --version, -v Show version number");
30
+ console.error(`\nDocumentation: https://github.com/mharnett/mcp-google-ads`);
30
31
  process.exit(0);
31
32
  }
32
33
  if (process.argv.includes("--version") || process.argv.includes("-v")) {
33
- console.log(__cliPkg.version);
34
+ console.error(__cliPkg.version);
34
35
  process.exit(0);
35
36
  }
36
37
  function loadConfig() {
@@ -1814,4 +1815,7 @@ process.on("SIGINT", () => {
1814
1815
  console.error("[shutdown] SIGINT received, exiting");
1815
1816
  process.exit(0);
1816
1817
  });
1818
+ process.on("SIGPIPE", () => {
1819
+ // Client disconnected -- expected during shutdown
1820
+ });
1817
1821
  main().catch((err) => logger.error({ error: err.message, stack: err.stack }, "Fatal startup error"));
@@ -12,10 +12,13 @@ export const logger = pino({
12
12
  colorize: true,
13
13
  singleLine: true,
14
14
  translateTime: "SYS:standard",
15
+ destination: 2, // stderr -- stdout is reserved for MCP JSON-RPC
15
16
  },
16
17
  },
17
18
  }),
18
- });
19
+ },
20
+ // When no transport (test mode), write to stderr directly
21
+ process.env.NODE_ENV === "test" ? pino.destination(2) : undefined);
19
22
  // ============================================
20
23
  // SAFE RESPONSE (Response Size Limiting)
21
24
  // ============================================
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-google-ads",
3
3
  "mcpName": "io.github.mharnett/google-ads",
4
- "version": "1.0.7",
4
+ "version": "1.0.8",
5
5
  "description": "MCP server for Google Ads API with MCC support, 35 tools for campaign management, reporting, and optimization. Safe by default — all changes created PAUSED.",
6
6
  "main": "dist/index.js",
7
7
  "bin": {