openads-ai 0.2.9 → 0.2.10
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/mcp-extension.js +12 -12
- package/package.json +1 -1
package/dist/mcp-extension.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
2
2
|
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
3
|
-
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
4
3
|
import { hasGlobalRtk } from "./token-optimizer.js";
|
|
5
4
|
import fs from "fs";
|
|
6
5
|
import path from "path";
|
|
@@ -29,7 +28,7 @@ export default async function (pi) {
|
|
|
29
28
|
command,
|
|
30
29
|
args,
|
|
31
30
|
});
|
|
32
|
-
const googleClient = new Client({ name: "openads-google-ads-client", version: "0.2.
|
|
31
|
+
const googleClient = new Client({ name: "openads-google-ads-client", version: "0.2.9" }, { capabilities: {} });
|
|
33
32
|
await googleClient.connect(googleTransport);
|
|
34
33
|
clients.push({ name: "google-ads", client: googleClient });
|
|
35
34
|
}
|
|
@@ -37,20 +36,21 @@ export default async function (pi) {
|
|
|
37
36
|
console.error(`[OpenAds MCP] Failed to connect to Google Ads: ${err.message}`);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
|
-
// ─── Meta Ads MCP
|
|
39
|
+
// ─── Meta Ads MCP (Local Stdio Server via meta-ads-mcp) ───────────
|
|
41
40
|
if (config.metaToken) {
|
|
42
41
|
try {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
const useRtk = hasGlobalRtk();
|
|
43
|
+
const command = useRtk ? 'rtk' : 'npx';
|
|
44
|
+
const args = useRtk ? ['npx', '-y', 'meta-ads-mcp'] : ['-y', 'meta-ads-mcp'];
|
|
45
|
+
const metaTransport = new StdioClientTransport({
|
|
46
|
+
command,
|
|
47
|
+
args,
|
|
48
|
+
env: {
|
|
49
|
+
...process.env,
|
|
50
|
+
"META_ACCESS_TOKEN": config.metaToken
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
const metaClient = new Client({ name: "openads-meta-ads-client", version: "0.2.
|
|
53
|
+
const metaClient = new Client({ name: "openads-meta-ads-client", version: "0.2.9" }, { capabilities: {} });
|
|
54
54
|
await metaClient.connect(metaTransport);
|
|
55
55
|
clients.push({ name: "meta-ads", client: metaClient });
|
|
56
56
|
}
|
package/package.json
CHANGED