mcp-google-ads 1.0.0 → 1.0.2
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 +34 -3
- package/package.json +2 -1
package/dist/build-info.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"sha":"
|
|
1
|
+
{"sha":"92fc1a4","builtAt":"2026-04-09T18:51:08.850Z"}
|
package/dist/index.js
CHANGED
|
@@ -18,11 +18,42 @@ catch {
|
|
|
18
18
|
// build-info.json not present (dev mode)
|
|
19
19
|
}
|
|
20
20
|
function loadConfig() {
|
|
21
|
+
// Try config.json first (for multi-client setups)
|
|
21
22
|
const configPath = join(dirname(new URL(import.meta.url).pathname), "..", "config.json");
|
|
22
|
-
if (
|
|
23
|
-
|
|
23
|
+
if (existsSync(configPath)) {
|
|
24
|
+
return JSON.parse(readFileSync(configPath, "utf-8"));
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
// Fall back to env vars (single-client mode)
|
|
27
|
+
const clientId = process.env.GOOGLE_ADS_CLIENT_ID;
|
|
28
|
+
const clientSecret = process.env.GOOGLE_ADS_CLIENT_SECRET;
|
|
29
|
+
const developerToken = process.env.GOOGLE_ADS_DEVELOPER_TOKEN;
|
|
30
|
+
const refreshToken = process.env.GOOGLE_ADS_REFRESH_TOKEN;
|
|
31
|
+
const customerId = process.env.GOOGLE_ADS_CUSTOMER_ID;
|
|
32
|
+
const mccId = process.env.GOOGLE_ADS_MCC_CUSTOMER_ID;
|
|
33
|
+
if (!clientId || !clientSecret || !developerToken || !refreshToken) {
|
|
34
|
+
throw new Error("No configuration found. Either:\n" +
|
|
35
|
+
" 1. Set env vars: GOOGLE_ADS_CLIENT_ID, GOOGLE_ADS_CLIENT_SECRET, GOOGLE_ADS_DEVELOPER_TOKEN, GOOGLE_ADS_REFRESH_TOKEN, GOOGLE_ADS_CUSTOMER_ID\n" +
|
|
36
|
+
" 2. Create a config.json next to the dist/ folder (see config.example.json)");
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
google_ads: {
|
|
40
|
+
mcc_customer_id: mccId || "",
|
|
41
|
+
},
|
|
42
|
+
clients: customerId ? {
|
|
43
|
+
default: {
|
|
44
|
+
customer_id: customerId,
|
|
45
|
+
name: process.env.GOOGLE_ADS_ACCOUNT_NAME || "My Account",
|
|
46
|
+
folder: "",
|
|
47
|
+
mcc_customer_id: mccId,
|
|
48
|
+
direct_access: !mccId,
|
|
49
|
+
},
|
|
50
|
+
} : {},
|
|
51
|
+
defaults: {
|
|
52
|
+
create_paused: true,
|
|
53
|
+
label_prefix: "claude:",
|
|
54
|
+
require_approval_for_enable: true,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
26
57
|
}
|
|
27
58
|
function getClientFromWorkingDir(config, cwd) {
|
|
28
59
|
for (const [key, client] of Object.entries(config.clients)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-google-ads",
|
|
3
|
-
"
|
|
3
|
+
"mcpName": "io.github.mharnett/google-ads",
|
|
4
|
+
"version": "1.0.2",
|
|
4
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.",
|
|
5
6
|
"main": "dist/index.js",
|
|
6
7
|
"types": "dist/index.d.ts",
|