mcp-google-ads 1.0.15 → 1.0.16
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 +17 -11
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"sha":"
|
|
1
|
+
{"sha":"9b25077","builtAt":"2026-04-09T23:18:47.469Z"}
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,13 @@ catch {
|
|
|
22
22
|
}
|
|
23
23
|
// Version safety: warn if running a deprecated or dangerously old version
|
|
24
24
|
const __minimumSafeVersion = "1.0.5"; // minimum version with GAQL sanitization
|
|
25
|
-
|
|
25
|
+
const __semverLt = (a, b) => { const pa = a.split(".").map(Number), pb = b.split(".").map(Number); for (let i = 0; i < 3; i++) {
|
|
26
|
+
if ((pa[i] || 0) < (pb[i] || 0))
|
|
27
|
+
return true;
|
|
28
|
+
if ((pa[i] || 0) > (pb[i] || 0))
|
|
29
|
+
return false;
|
|
30
|
+
} return false; };
|
|
31
|
+
if (__semverLt(__cliPkg.version, __minimumSafeVersion)) {
|
|
26
32
|
console.error(`[WARNING] Running deprecated version ${__cliPkg.version}. Minimum safe version is ${__minimumSafeVersion}. Please upgrade.`);
|
|
27
33
|
}
|
|
28
34
|
// CLI flags
|
|
@@ -733,13 +739,13 @@ class GoogleAdsManager {
|
|
|
733
739
|
AND ad_group_criterion.status != 'REMOVED'
|
|
734
740
|
`;
|
|
735
741
|
if (options.keywordTextContains) {
|
|
736
|
-
query += ` AND ad_group_criterion.keyword.text LIKE '%${options.keywordTextContains}%'`;
|
|
742
|
+
query += ` AND ad_group_criterion.keyword.text LIKE '%${escapeGaqlString(options.keywordTextContains)}%'`;
|
|
737
743
|
}
|
|
738
744
|
if (options.campaignIds && options.campaignIds.length > 0) {
|
|
739
745
|
query += ` AND campaign.id IN (${options.campaignIds.map(sanitizeNumericId).join(",")})`;
|
|
740
746
|
}
|
|
741
747
|
if (options.adGroupIds && options.adGroupIds.length > 0) {
|
|
742
|
-
query += ` AND ad_group.id IN (${options.adGroupIds.join(",")})`;
|
|
748
|
+
query += ` AND ad_group.id IN (${options.adGroupIds.map(sanitizeNumericId).join(",")})`;
|
|
743
749
|
}
|
|
744
750
|
query += ` ORDER BY metrics.cost_micros DESC`;
|
|
745
751
|
const result = await withResilience(() => customer.query(query), "getKeywordPerformance");
|
|
@@ -773,13 +779,13 @@ class GoogleAdsManager {
|
|
|
773
779
|
AND ad_group_criterion.status != 'REMOVED'
|
|
774
780
|
`;
|
|
775
781
|
if (options.keywordTextContains) {
|
|
776
|
-
query += ` AND ad_group_criterion.keyword.text LIKE '%${options.keywordTextContains}%'`;
|
|
782
|
+
query += ` AND ad_group_criterion.keyword.text LIKE '%${escapeGaqlString(options.keywordTextContains)}%'`;
|
|
777
783
|
}
|
|
778
784
|
if (options.campaignIds && options.campaignIds.length > 0) {
|
|
779
785
|
query += ` AND campaign.id IN (${options.campaignIds.map(sanitizeNumericId).join(",")})`;
|
|
780
786
|
}
|
|
781
787
|
if (options.adGroupIds && options.adGroupIds.length > 0) {
|
|
782
|
-
query += ` AND ad_group.id IN (${options.adGroupIds.join(",")})`;
|
|
788
|
+
query += ` AND ad_group.id IN (${options.adGroupIds.map(sanitizeNumericId).join(",")})`;
|
|
783
789
|
}
|
|
784
790
|
query += ` ORDER BY ad_group_criterion.keyword.text, segments.conversion_action_name`;
|
|
785
791
|
const result = await withResilience(() => customer.query(query), "getKeywordPerformanceWithConversions");
|
|
@@ -811,13 +817,13 @@ class GoogleAdsManager {
|
|
|
811
817
|
WHERE segments.date BETWEEN '${options.startDate}' AND '${options.endDate}'
|
|
812
818
|
`;
|
|
813
819
|
if (options.searchTermContains) {
|
|
814
|
-
query += ` AND search_term_view.search_term LIKE '%${options.searchTermContains}%'`;
|
|
820
|
+
query += ` AND search_term_view.search_term LIKE '%${escapeGaqlString(options.searchTermContains)}%'`;
|
|
815
821
|
}
|
|
816
822
|
if (options.campaignIds && options.campaignIds.length > 0) {
|
|
817
823
|
query += ` AND campaign.id IN (${options.campaignIds.map(sanitizeNumericId).join(",")})`;
|
|
818
824
|
}
|
|
819
825
|
if (options.adGroupIds && options.adGroupIds.length > 0) {
|
|
820
|
-
query += ` AND ad_group.id IN (${options.adGroupIds.join(",")})`;
|
|
826
|
+
query += ` AND ad_group.id IN (${options.adGroupIds.map(sanitizeNumericId).join(",")})`;
|
|
821
827
|
}
|
|
822
828
|
query += ` ORDER BY metrics.impressions DESC`;
|
|
823
829
|
const result = await withResilience(() => customer.query(query), "getSearchTermReport");
|
|
@@ -847,13 +853,13 @@ class GoogleAdsManager {
|
|
|
847
853
|
WHERE segments.date BETWEEN '${options.startDate}' AND '${options.endDate}'
|
|
848
854
|
`;
|
|
849
855
|
if (options.searchTermContains) {
|
|
850
|
-
query += ` AND search_term_view.search_term LIKE '%${options.searchTermContains}%'`;
|
|
856
|
+
query += ` AND search_term_view.search_term LIKE '%${escapeGaqlString(options.searchTermContains)}%'`;
|
|
851
857
|
}
|
|
852
858
|
if (options.campaignIds && options.campaignIds.length > 0) {
|
|
853
859
|
query += ` AND campaign.id IN (${options.campaignIds.map(sanitizeNumericId).join(",")})`;
|
|
854
860
|
}
|
|
855
861
|
if (options.adGroupIds && options.adGroupIds.length > 0) {
|
|
856
|
-
query += ` AND ad_group.id IN (${options.adGroupIds.join(",")})`;
|
|
862
|
+
query += ` AND ad_group.id IN (${options.adGroupIds.map(sanitizeNumericId).join(",")})`;
|
|
857
863
|
}
|
|
858
864
|
query += ` ORDER BY search_term_view.search_term, segments.conversion_action_name`;
|
|
859
865
|
const result = await withResilience(() => customer.query(query), "getSearchTermReportWithConversions");
|
|
@@ -898,7 +904,7 @@ class GoogleAdsManager {
|
|
|
898
904
|
query += ` AND campaign.id IN (${options.campaignIds.map(sanitizeNumericId).join(",")})`;
|
|
899
905
|
}
|
|
900
906
|
if (options.adGroupIds && options.adGroupIds.length > 0) {
|
|
901
|
-
query += ` AND ad_group.id IN (${options.adGroupIds.join(",")})`;
|
|
907
|
+
query += ` AND ad_group.id IN (${options.adGroupIds.map(sanitizeNumericId).join(",")})`;
|
|
902
908
|
}
|
|
903
909
|
query += ` ORDER BY metrics.impressions DESC`;
|
|
904
910
|
const result = await withResilience(() => customer.query(query), "getAdPerformance");
|
|
@@ -941,7 +947,7 @@ class GoogleAdsManager {
|
|
|
941
947
|
query += ` AND campaign.id IN (${options.campaignIds.map(sanitizeNumericId).join(",")})`;
|
|
942
948
|
}
|
|
943
949
|
if (options.adGroupIds && options.adGroupIds.length > 0) {
|
|
944
|
-
query += ` AND ad_group.id IN (${options.adGroupIds.join(",")})`;
|
|
950
|
+
query += ` AND ad_group.id IN (${options.adGroupIds.map(sanitizeNumericId).join(",")})`;
|
|
945
951
|
}
|
|
946
952
|
query += ` ORDER BY ad_group_ad.ad.id, segments.conversion_action_name`;
|
|
947
953
|
const result = await withResilience(() => customer.query(query), "getAdPerformanceWithConversions");
|
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.
|
|
4
|
+
"version": "1.0.16",
|
|
5
5
|
"description": "MCP server for Google Ads API with MCC support, 34 tools for campaign management, reporting, and optimization. Safe by default -- all changes created PAUSED.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|