@mambalabsdev/mcp-meta-brand-presence-mapper 1.1.1 → 1.2.0

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/README.md CHANGED
@@ -52,6 +52,7 @@ Tool: `map_meta_brand_presence`
52
52
  | `platforms` | array | Which of the three Meta surfaces to map. Default is all three. Dropping Facebook is the common choice: it is the least reliable of the three and it costs a fetch to find that out. |
53
53
  | `includeFollowerCounts` | boolean | Default true: the profile page is fetched and the follower counts are extracted. Set false to resolve the profile URL only, which is cheaper and needs no proxy. |
54
54
  | `skipCache` | boolean | Default false: a successful lookup is cached for seven days and reused. Set true to force a fresh fetch. |
55
+ | `max_charge_usd` | number | Optional spending cap for this call, in USD. The actor stops before any charge that would take the run past this amount and keeps every row already charged. |
55
56
 
56
57
  ## Reading the output
57
58
 
@@ -71,6 +72,19 @@ first. The vocabulary is the same across the whole Mamba Labs social family:
71
72
  answer is no. `null` means we could not look. If you filter for companies with no
72
73
  presence, filter on `false`, because `null` rows are unknown rather than absent.
73
74
 
75
+ ## Pricing
76
+
77
+ You pay per event on Apify, billed to your own Apify account. Prices from the live pricing record, read 2026-10-16:
78
+
79
+ | Event | Price per event (USD) | Fires when |
80
+ | --- | --- | --- |
81
+ | `apify-actor-start` | $0.00005 | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). |
82
+ | `company-checked` | $0.005 on the Free plan, down to $0.0035 on higher Apify plans | Once per company for which the discovery cascade completed and a non degraded row was produced, whether or not any Meta platform resolved. Does not fire on a degraded row, because on a degraded row the company site was never read and no presence was measured. |
83
+ | `platform-resolved` | $0.003 on the Free plan, down to $0.0021 on higher Apify plans | Once per REQUESTED Meta platform whose candidate URL passed the identity gate. Fires on the validation work, not on a populated follower cell. A candidate dropped as an impersonator does not charge: the work was done and the answer is that there is no such profile. A platform the caller did not request never fires it. |
84
+ | `follower-count-extracted` | $0.0025 on the Free plan, down to $0.00175 on higher Apify plans | Once per Meta platform where a numeric follower count was read off the public Open Graph card. Does not fire on not_extractable, blocked, identity_mismatch or a URL only run. Facebook therefore often does not fire it, which is correct: it is the platform we most often cannot read. |
85
+
86
+ The [actor's Apify page](https://apify.com/mambalabs/meta-brand-presence-mapper) carries the current prices. Running this server consumes Apify credits.
87
+
74
88
  ## Full actor documentation
75
89
 
76
90
  [apify.com/mambalabs/meta-brand-presence-mapper](https://apify.com/mambalabs/meta-brand-presence-mapper)
package/build/index.js CHANGED
@@ -5,6 +5,13 @@ import { dirname, join } from "node:path";
5
5
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
6
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
7
  import { z } from "zod";
8
+ // Optional per call spending cap, passed through to the actor's own max_charge_usd
9
+ // input. The actor enforces it; this wrapper only forwards it when set.
10
+ const MAX_CHARGE_USD = z
11
+ .number()
12
+ .min(0)
13
+ .optional()
14
+ .describe("Optional spending cap for this call, in USD, passed to the actor as max_charge_usd. The run stops before any charge that would take it past this amount and keeps every row already charged. Leave empty to rely only on the maximum charge per run set on your Apify account.");
8
15
  const here = dirname(fileURLToPath(import.meta.url));
9
16
  const pkg = JSON.parse(readFileSync(join(here, "..", "package.json"), "utf8"));
10
17
  // Distinctive UA so Apify run meta.userAgent marks MCP-originated runs.
@@ -42,7 +49,9 @@ function boolToString(v) {
42
49
  }
43
50
  // actorPath is the actor's IMMUTABLE Apify actor id, not its slug, so a Store
44
51
  // rename never breaks these calls.
45
- async function runActor(actorPath, actorLabel, input) {
52
+ async function runActor(actorPath, actorLabel, input, maxChargeUsd) {
53
+ if (maxChargeUsd !== undefined)
54
+ input = { ...input, max_charge_usd: maxChargeUsd };
46
55
  if (!APIFY_TOKEN) {
47
56
  return { isError: true, content: [{ type: "text", text: "APIFY_TOKEN is not set. Create a token at https://console.apify.com/account/integrations and set it as the APIFY_TOKEN environment variable." }] };
48
57
  }
@@ -178,7 +187,7 @@ server.registerTool("map_meta_brand_presence", {
178
187
  description: "Resolve a company domain to its Instagram, Threads and Facebook accounts with follower and post counts, as one flat Clay ready row. The Threads handle is derived from the resolved Instagram handle at no extra discovery cost. Instagram and Threads counts are rounded by Meta and the row carries both the rounded integer and the platform's own display string. Facebook is best effort: Meta serves a login wall to anonymous clients, so blocked is a normal answer there and never a zero. Read only; requires an APIFY_TOKEN and consumes Apify credits per call.",
179
188
  annotations: {
180
189
  title: "Map Instagram Threads and Facebook Presence",
181
- readOnlyHint: true,
190
+ readOnlyHint: false,
182
191
  destructiveHint: false,
183
192
  idempotentHint: true,
184
193
  openWorldHint: true,
@@ -202,8 +211,9 @@ server.registerTool("map_meta_brand_presence", {
202
211
  skipCache: z.boolean()
203
212
  .optional()
204
213
  .describe("Default false: a successful lookup is cached for seven days and reused. Set true to force a fresh fetch."),
214
+ max_charge_usd: MAX_CHARGE_USD,
205
215
  },
206
- }, async ({ company_domain, company_name, handle, platforms, includeFollowerCounts, skipCache }) => {
216
+ }, async ({ company_domain, company_name, handle, platforms, includeFollowerCounts, skipCache, max_charge_usd }) => {
207
217
  return runActor("HXh65I0JBjPsunbY8", "Instagram Threads Facebook Brand Presence Mapper", compact({
208
218
  company_domain,
209
219
  company_name,
@@ -211,7 +221,7 @@ server.registerTool("map_meta_brand_presence", {
211
221
  platforms,
212
222
  includeFollowerCounts: boolToString(includeFollowerCounts),
213
223
  skipCache: boolToString(skipCache),
214
- }));
224
+ }), max_charge_usd);
215
225
  });
216
226
  const transport = new StdioServerTransport();
217
227
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mambalabsdev/mcp-meta-brand-presence-mapper",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "MCP server for the Mamba Labs Instagram Threads Facebook Brand Presence Mapper actor on Apify. Resolve a company domain to its Instagram, Threads and Facebook accounts with follower and post counts.",
5
5
  "type": "module",
6
6
  "bin": {