mcp-bing-ads 1.0.3 → 1.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.
@@ -1 +1 @@
1
- {"sha":"931c255","builtAt":"2026-04-09T18:53:18.023Z"}
1
+ {"sha":"3e93179","builtAt":"2026-04-09T19:59:31.071Z"}
package/dist/index.js CHANGED
@@ -16,6 +16,22 @@ try {
16
16
  catch {
17
17
  // build-info.json not present (dev mode)
18
18
  }
19
+ // CLI flags
20
+ const __cliPkg = JSON.parse(readFileSync(join(dirname(new URL(import.meta.url).pathname), "..", "package.json"), "utf-8"));
21
+ if (process.argv.includes("--help") || process.argv.includes("-h")) {
22
+ console.log(`${__cliPkg.name} v${__cliPkg.version}\n`);
23
+ console.log(`Usage: ${__cliPkg.name} [options]\n`);
24
+ console.log("MCP server communicating via stdio. Configure in your .mcp.json.\n");
25
+ console.log("Options:");
26
+ console.log(" --help, -h Show this help message");
27
+ console.log(" --version, -v Show version number");
28
+ console.log(`\nDocumentation: https://github.com/mharnett/mcp-bing-ads`);
29
+ process.exit(0);
30
+ }
31
+ if (process.argv.includes("--version") || process.argv.includes("-v")) {
32
+ console.log(__cliPkg.version);
33
+ process.exit(0);
34
+ }
19
35
  function loadConfig() {
20
36
  const configPath = join(dirname(new URL(import.meta.url).pathname), "..", "config.json");
21
37
  if (!existsSync(configPath)) {
@@ -93,9 +109,12 @@ class BingAdsManager {
93
109
  if (data.refresh_token && data.refresh_token !== this.refreshToken) {
94
110
  this.refreshToken = data.refresh_token;
95
111
  try {
96
- const { execSync } = await import("child_process");
97
- execSync(`security delete-generic-password -a bing-ads-mcp -s BING_ADS_REFRESH_TOKEN 2>/dev/null; ` +
98
- `security add-generic-password -a bing-ads-mcp -s BING_ADS_REFRESH_TOKEN -w "${data.refresh_token}"`);
112
+ const { execFileSync } = await import("child_process");
113
+ try {
114
+ execFileSync("security", ["delete-generic-password", "-a", "bing-ads-mcp", "-s", "BING_ADS_REFRESH_TOKEN"], { stdio: "ignore" });
115
+ }
116
+ catch { /* may not exist yet */ }
117
+ execFileSync("security", ["add-generic-password", "-a", "bing-ads-mcp", "-s", "BING_ADS_REFRESH_TOKEN", "-w", data.refresh_token]);
99
118
  console.error("[token] Rotated refresh token persisted to Keychain");
100
119
  }
101
120
  catch (err) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-bing-ads",
3
3
  "mcpName": "io.github.mharnett/bing-ads",
4
- "version": "1.0.3",
4
+ "version": "1.0.5",
5
5
  "description": "MCP server for Microsoft Advertising (Bing Ads) API with campaign, ad group, keyword, and performance reporting. First comprehensive open-source Bing Ads MCP.",
6
6
  "main": "dist/index.js",
7
7
  "bin": {