mcp-ga4 2.0.4 → 2.0.5
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/dist/build-info.json +1 -1
- package/dist/index.js +14 -10
- package/dist/resilience.js +4 -1
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"sha":"
|
|
1
|
+
{"sha":"29cbd4f","builtAt":"2026-04-09T21:28:40.127Z"}
|
package/dist/index.js
CHANGED
|
@@ -11,6 +11,8 @@ import { GoogleAuth } from "google-auth-library";
|
|
|
11
11
|
import { Ga4AuthError, Ga4RateLimitError, Ga4ServiceError, classifyError, } from "./errors.js";
|
|
12
12
|
import { tools } from "./tools.js";
|
|
13
13
|
import { withResilience, safeResponse, logger } from "./resilience.js";
|
|
14
|
+
// CLI package info
|
|
15
|
+
const __cliPkg = JSON.parse(readFileSync(join(dirname(new URL(import.meta.url).pathname), "..", "package.json"), "utf-8"));
|
|
14
16
|
// Log build fingerprint at startup
|
|
15
17
|
try {
|
|
16
18
|
const __buildInfoDir = dirname(new URL(import.meta.url).pathname);
|
|
@@ -18,22 +20,21 @@ try {
|
|
|
18
20
|
console.error(`[build] SHA: ${buildInfo.sha} (${buildInfo.builtAt})`);
|
|
19
21
|
}
|
|
20
22
|
catch {
|
|
21
|
-
|
|
23
|
+
console.error(`[build] ${__cliPkg.name}@${__cliPkg.version} (dev mode)`);
|
|
22
24
|
}
|
|
23
25
|
// CLI flags
|
|
24
|
-
const __cliPkg = JSON.parse(readFileSync(join(dirname(new URL(import.meta.url).pathname), "..", "package.json"), "utf-8"));
|
|
25
26
|
if (process.argv.includes("--help") || process.argv.includes("-h")) {
|
|
26
|
-
console.
|
|
27
|
-
console.
|
|
28
|
-
console.
|
|
29
|
-
console.
|
|
30
|
-
console.
|
|
31
|
-
console.
|
|
32
|
-
console.
|
|
27
|
+
console.error(`${__cliPkg.name} v${__cliPkg.version}\n`);
|
|
28
|
+
console.error(`Usage: ${__cliPkg.name} [options]\n`);
|
|
29
|
+
console.error("MCP server communicating via stdio. Configure in your .mcp.json.\n");
|
|
30
|
+
console.error("Options:");
|
|
31
|
+
console.error(" --help, -h Show this help message");
|
|
32
|
+
console.error(" --version, -v Show version number");
|
|
33
|
+
console.error(`\nDocumentation: https://github.com/mharnett/mcp-ga4`);
|
|
33
34
|
process.exit(0);
|
|
34
35
|
}
|
|
35
36
|
if (process.argv.includes("--version") || process.argv.includes("-v")) {
|
|
36
|
-
console.
|
|
37
|
+
console.error(__cliPkg.version);
|
|
37
38
|
process.exit(0);
|
|
38
39
|
}
|
|
39
40
|
function loadConfig() {
|
|
@@ -451,4 +452,7 @@ process.on("SIGINT", () => {
|
|
|
451
452
|
console.error("[shutdown] SIGINT received, exiting");
|
|
452
453
|
process.exit(0);
|
|
453
454
|
});
|
|
455
|
+
process.on("SIGPIPE", () => {
|
|
456
|
+
// Client disconnected -- expected during shutdown
|
|
457
|
+
});
|
|
454
458
|
main().catch(console.error);
|
package/dist/resilience.js
CHANGED
|
@@ -9,10 +9,13 @@ export const logger = pino({
|
|
|
9
9
|
colorize: true,
|
|
10
10
|
singleLine: true,
|
|
11
11
|
translateTime: "SYS:standard",
|
|
12
|
+
destination: 2, // stderr -- stdout is reserved for MCP JSON-RPC
|
|
12
13
|
},
|
|
13
14
|
},
|
|
14
15
|
}),
|
|
15
|
-
}
|
|
16
|
+
},
|
|
17
|
+
// When no transport (test mode), write to stderr directly
|
|
18
|
+
process.env.NODE_ENV === "test" ? pino.destination(2) : undefined);
|
|
16
19
|
const MAX_RESPONSE_SIZE = 200_000;
|
|
17
20
|
export function safeResponse(data, context) {
|
|
18
21
|
let current = data;
|
package/package.json
CHANGED