@mambalabsdev/mcp-partner-member-directory-extractor 0.0.0-stage → 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mamba Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,108 @@
1
- # Temporary Holding Version
1
+ # Partner and Member Directory Extractor MCP Server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![Smithery](https://smithery.ai/badge/mambabuilt/mcp-partner-member-directory-extractor)](https://smithery.ai/servers/mambabuilt/mcp-partner-member-directory-extractor) [![Glama score](https://glama.ai/mcp/servers/mambalabsdev/mcp-partner-member-directory-extractor/badges/score.svg)](https://glama.ai/mcp/servers/mambalabsdev/mcp-partner-member-directory-extractor) [![MCP Registry](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.modelcontextprotocol.io%2Fv0%2Fservers%3Fsearch%3Dcom.mambabuilt%252Fmcp-partner-member-directory-extractor%26limit%3D1&query=%24.servers%5B0%5D._meta%5B%22io.modelcontextprotocol.registry%2Fofficial%22%5D.status&label=mcp%20registry&color=blue)](https://registry.modelcontextprotocol.io/v0/servers?search=com.mambabuilt/mcp-partner-member-directory-extractor&limit=1) [![npm version](https://img.shields.io/npm/v/@mambalabsdev/mcp-partner-member-directory-extractor)](https://www.npmjs.com/package/@mambalabsdev/mcp-partner-member-directory-extractor) [![npm downloads](https://img.shields.io/npm/dm/@mambalabsdev/mcp-partner-member-directory-extractor)](https://www.npmjs.com/package/@mambalabsdev/mcp-partner-member-directory-extractor) [![license](https://img.shields.io/github/license/mambalabsdev/mcp-partner-member-directory-extractor)](https://github.com/mambalabsdev/mcp-partner-member-directory-extractor/blob/main/LICENSE) [![mcpservers.org](https://img.shields.io/badge/mcpservers.org-listed-blue)](https://mcpservers.org/servers/mambalabsdev/mcp-partner-member-directory-extractor)
4
+
5
+ An MCP server for the Mamba Labs Partner and Member Directory Extractor actor on Apify. Give it a partner directory or a member list URL. Each listed company comes back as one row with its website, domain, tier, tags, and location.
6
+
7
+ ## What's Inside
8
+
9
+ - [What it does](#what-it-does)
10
+ - [Quick start](#quick-start)
11
+ - [Prerequisites](#prerequisites)
12
+ - [Example prompts](#example-prompts)
13
+ - [Tool](#tool)
14
+ - [Inputs](#inputs)
15
+ - [Pricing](#pricing)
16
+ - [Your keys](#your-keys)
17
+ - [Full actor documentation](#full-actor-documentation)
18
+ - [License](#license)
19
+
20
+ ## What it does
21
+
22
+ The actor reads three directory families: directories built on PartnerPage (Clay's Solutions Partner Directory and the Zapier partner directory among them), read through PartnerPage's public listing API; the Shopify Partner Directory; and member lists that link to one profile page per member, such as a trade association directory. Each row carries `listing_name`, `company_domain`, `website`, `listing_url`, `tier`, `tags`, `location`, `rating`, `review_count`, `partner_since`, and the `listed_email` and `listed_phone` the directory publishes. robots.txt is checked before every request. A directory that builds its list in the browser returns one free row with `row_status` `unsupported`.
23
+
24
+ All of the work runs on Apify. This package is a thin client that starts the actor run, waits for it, and hands back the dataset rows.
25
+
26
+ ## Quick start
27
+
28
+ You need Node.js 18 or newer and an Apify account with an API token.
29
+
30
+ Add this to your Claude Desktop config (`claude_desktop_config.json`), Cursor, or any MCP client:
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "mamba-partner-member-directory-extractor": {
36
+ "command": "npx",
37
+ "args": [
38
+ "-y",
39
+ "@mambalabsdev/mcp-partner-member-directory-extractor"
40
+ ],
41
+ "env": {
42
+ "APIFY_TOKEN": "your-apify-token"
43
+ }
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ Restart the client. The `extract_directory_companies` tool appears.
50
+
51
+ ## Prerequisites
52
+
53
+ - Node.js 18 or newer.
54
+ - An Apify API token from [console.apify.com/account/integrations](https://console.apify.com/account/integrations), set as `APIFY_TOKEN`. The server lists its tool without a token; a call needs one.
55
+
56
+ ## Example prompts
57
+
58
+ - "List every agency in the Clay experts directory with its website and tier."
59
+ - "Pull 100 Shopify partners that do store migrations, with their rating and location."
60
+ - "Turn the IAB UK member directory into a list of company domains."
61
+
62
+ ## Tool
63
+
64
+ `extract_directory_companies`. One tool. Example arguments:
65
+
66
+ ```json
67
+ {
68
+ "directory_url": "https://www.clay.com/en/experts",
69
+ "max_listings": "200"
70
+ }
71
+ ```
72
+
73
+ ## Inputs
74
+
75
+ Every buyer facing input of the actor. Omitted inputs take the actor's own defaults. Numbers and yes or no inputs are sent as text.
76
+
77
+ | Input | Type | Description |
78
+ |---|---|---|
79
+ | `directory_url` | string | One directory page |
80
+ | `directory_urls` | array | Up to 20 directory pages |
81
+ | `max_listings` | string | Listings per directory, 1 to 5000. Default 100 |
82
+ | `max_pages` | string | Shopify and member lists: listing pages to read. Default 10 |
83
+ | `include_details` | string | PartnerPage: tags, location, and email. Default true |
84
+ | `dedupe_domains` | string | Return a repeated company once. Default true |
85
+ | `max_charge_usd` | string | Optional cost cap for the run |
86
+
87
+ ## Pricing
88
+
89
+ Pay per event on Apify, billed to your Apify account. Prices in USD.
90
+
91
+ | Event | Free plan | Bronze | Silver | Gold |
92
+ |---|---|---|---|---|
93
+ | `company-listed`, per company row | $0.004 | $0.0038 | $0.0036 | $0.0034 |
94
+ | `apify-actor-start`, per run start (one per GB of run memory) | $0.0015 | $0.0015 | $0.0015 | $0.0015 |
95
+
96
+ Skipped repeats, and no listings, robots disallowed, blocked, unsupported, and error rows are free.
97
+
98
+ ## Your keys
99
+
100
+ The actor needs no key. Proxy traffic adds nothing to your price: Mamba Labs pays the platform costs of the run.
101
+
102
+ ## Full actor documentation
103
+
104
+ [apify.com/mambalabs/partner-member-directory-extractor](https://apify.com/mambalabs/partner-member-directory-extractor)
105
+
106
+ ## License
107
+
108
+ MIT. See [LICENSE](LICENSE).
package/SECURITY.md ADDED
@@ -0,0 +1,31 @@
1
+ # Security Policy
2
+
3
+ ## Supported versions
4
+
5
+ The latest published `1.x` release of
6
+ `@mambalabsdev/mcp-partner-member-directory-extractor` receives security updates.
7
+
8
+ | Version | Supported |
9
+ | ------- | ------------------ |
10
+ | 1.x | :white_check_mark: |
11
+ | < 1.0 | :x: |
12
+
13
+ ## Reporting a vulnerability
14
+
15
+ Please do not open a public GitHub issue for security reports.
16
+
17
+ Email security reports to **labs@mambamindsetgrowth.com** with:
18
+
19
+ - a description of the issue and its impact,
20
+ - steps to reproduce, and
21
+ - any relevant logs or proof of concept.
22
+
23
+ We aim to acknowledge reports within 3 business days and to provide a remediation
24
+ timeline after triage. Coordinated disclosure is appreciated.
25
+
26
+ ## Handling of credentials
27
+
28
+ This server reads an `APIFY_TOKEN` from the environment and uses it only to call
29
+ the Apify API on your behalf. The token is never logged or written to disk by this
30
+ package. Treat your `APIFY_TOKEN` as a secret and rotate it at
31
+ https://console.apify.com/account/integrations if you believe it has been exposed.
package/build/index.js ADDED
@@ -0,0 +1,197 @@
1
+ #!/usr/bin/env node
2
+ import { readFileSync } from "node:fs";
3
+ import { fileURLToPath } from "node:url";
4
+ import { dirname, join } from "node:path";
5
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
6
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
7
+ import { z } from "zod";
8
+ const here = dirname(fileURLToPath(import.meta.url));
9
+ const pkg = JSON.parse(readFileSync(join(here, "..", "package.json"), "utf8"));
10
+ // Distinctive UA so Apify run meta.userAgent marks MCP-originated runs.
11
+ const USER_AGENT = `mambalabs-mcp ${pkg.name}@${pkg.version}`;
12
+ // Drop undefined values so optional inputs are not sent to the actor.
13
+ function compact(obj) {
14
+ const out = {};
15
+ for (const [k, v] of Object.entries(obj)) {
16
+ if (v !== undefined)
17
+ out[k] = v;
18
+ }
19
+ return out;
20
+ }
21
+ // How long the actor run itself is allowed to take, in seconds. The suite's
22
+ // slowest measured run on 2026-09-22 was 152 s on a seven platform search, so
23
+ // 1800 s is roughly twelve times that: headroom for a slow day without letting a
24
+ // hung run bill indefinitely.
25
+ const ACTOR_RUN_TIMEOUT_SECS = 1800;
26
+ // How long this wrapper waits for that run, in milliseconds. The actor's own
27
+ // timeout plus two minutes, so the run's own TIMED-OUT status is what the
28
+ // caller sees rather than the wrapper giving up first and reporting nothing.
29
+ const WRAPPER_WAIT_MS = (ACTOR_RUN_TIMEOUT_SECS + 120) * 1000;
30
+ const POLL_INTERVAL_MS = 3000;
31
+ const TERMINAL = new Set(["SUCCEEDED", "FAILED", "TIMED-OUT", "ABORTED", "ABORTING"]);
32
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
33
+ // Shared caller. actorPath is the actor's immutable Apify actor ID (a stable key
34
+ // that survives Store renames). The /v2/acts/{id} endpoint accepts it directly,
35
+ // so a Store rename never breaks these calls.
36
+ //
37
+ // START AND POLL, NOT RUN-SYNC. Apify's synchronous endpoints carry a platform
38
+ // ceiling of 300 seconds on the HTTP wait itself and answer 408 past it whatever
39
+ // the timeout parameter says, so a long run reads as a timeout even though the
40
+ // actor goes on to finish. Starting the run, polling it to a terminal status and
41
+ // then reading the dataset is the only way to wait as long as the actor needs.
42
+ //
43
+ // The token is read here rather than at module load, so the tool registers
44
+ // unconditionally and a server started without APIFY_TOKEN still advertises its
45
+ // capabilities instead of reporting none.
46
+ async function runActor(actorPath, actorLabel, input) {
47
+ const APIFY_TOKEN = process.env.APIFY_TOKEN;
48
+ if (!APIFY_TOKEN) {
49
+ 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." }] };
50
+ }
51
+ const headers = {
52
+ Authorization: `Bearer ${APIFY_TOKEN}`,
53
+ "Content-Type": "application/json",
54
+ "User-Agent": USER_AGENT,
55
+ };
56
+ const httpError = async (response) => {
57
+ let detail = "";
58
+ try {
59
+ const body = (await response.json());
60
+ if (body?.error?.message)
61
+ detail = ` ${body.error.message}`;
62
+ }
63
+ catch {
64
+ detail = "";
65
+ }
66
+ switch (response.status) {
67
+ case 400:
68
+ return `The ${actorLabel} run was rejected as invalid input.${detail}`;
69
+ case 401:
70
+ return "Invalid Apify token. Check your APIFY_TOKEN environment variable.";
71
+ case 402:
72
+ return "Insufficient Apify credits. Check your account balance at https://console.apify.com/billing";
73
+ default:
74
+ return `Apify request to ${actorLabel} failed with status ${response.status}.${detail}`;
75
+ }
76
+ };
77
+ // 1. Start the run.
78
+ let started;
79
+ try {
80
+ started = await fetch(`https://api.apify.com/v2/acts/${actorPath}/runs?timeout=${ACTOR_RUN_TIMEOUT_SECS}`, { method: "POST", headers, body: JSON.stringify(input) });
81
+ }
82
+ catch (err) {
83
+ const message = err instanceof Error ? err.message : String(err);
84
+ return { isError: true, content: [{ type: "text", text: `Could not reach the Apify API: ${message}` }] };
85
+ }
86
+ if (!started.ok) {
87
+ return { isError: true, content: [{ type: "text", text: await httpError(started) }] };
88
+ }
89
+ let run;
90
+ try {
91
+ run = (await started.json()).data ?? {};
92
+ }
93
+ catch (err) {
94
+ const message = err instanceof Error ? err.message : String(err);
95
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run start returned a response that could not be parsed: ${message}` }] };
96
+ }
97
+ const runId = run.id;
98
+ if (!runId) {
99
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run start returned no run id, so there is nothing to wait for.` }] };
100
+ }
101
+ // 2. Poll to a terminal status.
102
+ const deadline = Date.now() + WRAPPER_WAIT_MS;
103
+ let status = run.status ?? "READY";
104
+ let datasetId = run.defaultDatasetId;
105
+ while (!TERMINAL.has(status)) {
106
+ if (Date.now() >= deadline) {
107
+ return {
108
+ isError: true,
109
+ content: [{ type: "text", text: `The ${actorLabel} run ${runId} was still ${status} after ${Math.round(WRAPPER_WAIT_MS / 1000)} seconds and this call stopped waiting. The run itself is still on Apify: read it at https://console.apify.com/actors/runs/${runId}` }],
110
+ };
111
+ }
112
+ await sleep(POLL_INTERVAL_MS);
113
+ let poll;
114
+ try {
115
+ poll = await fetch(`https://api.apify.com/v2/actor-runs/${runId}`, { headers });
116
+ }
117
+ catch (err) {
118
+ const message = err instanceof Error ? err.message : String(err);
119
+ return { isError: true, content: [{ type: "text", text: `Lost contact with the Apify API while waiting for ${actorLabel} run ${runId}: ${message}` }] };
120
+ }
121
+ if (!poll.ok) {
122
+ return { isError: true, content: [{ type: "text", text: await httpError(poll) }] };
123
+ }
124
+ const body = (await poll.json());
125
+ status = body.data?.status ?? status;
126
+ datasetId = body.data?.defaultDatasetId ?? datasetId;
127
+ }
128
+ // 3. A run that did not succeed is a failure the caller must see, never an
129
+ // empty success. Surfacing it here is what keeps a crashed run from reading
130
+ // as "no results found".
131
+ if (status !== "SUCCEEDED") {
132
+ return {
133
+ isError: true,
134
+ content: [{ type: "text", text: `The ${actorLabel} run did not succeed (run ID: ${runId}, status: ${status}).` }],
135
+ };
136
+ }
137
+ if (!datasetId) {
138
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run ${runId} succeeded but reported no dataset, so there is nothing to return.` }] };
139
+ }
140
+ // 4. Read the dataset.
141
+ let ds;
142
+ try {
143
+ ds = await fetch(`https://api.apify.com/v2/datasets/${datasetId}/items?format=json`, { headers });
144
+ }
145
+ catch (err) {
146
+ const message = err instanceof Error ? err.message : String(err);
147
+ return { isError: true, content: [{ type: "text", text: `Could not read the ${actorLabel} dataset: ${message}` }] };
148
+ }
149
+ if (!ds.ok) {
150
+ return { isError: true, content: [{ type: "text", text: await httpError(ds) }] };
151
+ }
152
+ let items;
153
+ try {
154
+ items = await ds.json();
155
+ }
156
+ catch (err) {
157
+ const message = err instanceof Error ? err.message : String(err);
158
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run returned a response that could not be parsed: ${message}` }] };
159
+ }
160
+ if (!Array.isArray(items)) {
161
+ const asObj = items;
162
+ const detail = asObj?.error?.message
163
+ ? `${asObj.error.message}`
164
+ : JSON.stringify(items);
165
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run did not return a dataset. ${detail}` }] };
166
+ }
167
+ return { content: [{ type: "text", text: JSON.stringify(items, null, 2) }] };
168
+ }
169
+ const server = new McpServer({
170
+ name: "mamba-partner-member-directory-extractor",
171
+ version: pkg.version,
172
+ });
173
+ // Partner and Member Directory Extractor (immutable actor ID ZX0XJPPUvnFJxeC1a). Every buyer facing input of
174
+ // the actor is exposed. Numbers and yes or no inputs are text, as the actor's input schema types them.
175
+ const bool = () => z.enum(["true", "false"]).optional();
176
+ server.registerTool("extract_directory_companies", {
177
+ title: "Extract companies from a partner or member directory",
178
+ description: "Turn a vendor partner directory or a trade body member list into one company row per listing. Give directory_url or directory_urls (up to 20). Reads directories built on PartnerPage (for example https://www.clay.com/en/experts or the Zapier partner directory) through PartnerPage's public listing API, the Shopify Partner Directory (any https://www.shopify.com/partners/directory/... page), and member lists that link to one profile page per member. Each row: listing_name, company_domain, website, listing_url, tier, tags, location, rating, review_count, partner_since, and the email and phone the directory itself publishes. robots.txt is checked before every request. A directory that cannot be read (it builds its list in the browser) returns one free row with row_status unsupported. A run that does not succeed is returned as an error with its run ID. Read-only; requires an APIFY_TOKEN; Apify charges per company row.",
179
+ annotations: {
180
+ title: "Extract companies from a partner or member directory",
181
+ readOnlyHint: true,
182
+ destructiveHint: false,
183
+ idempotentHint: true,
184
+ openWorldHint: true,
185
+ },
186
+ inputSchema: {
187
+ directory_url: z.string().optional().describe("One directory page URL."),
188
+ directory_urls: z.array(z.string()).optional().describe("Up to 20 directory page URLs."),
189
+ max_listings: z.string().optional().describe("Listings per directory, 1 to 5000. Each company row is billed. Default 100."),
190
+ max_pages: z.string().optional().describe("Shopify and member list directories: listing pages to read, 1 to 100. Default 10."),
191
+ include_details: bool().describe("PartnerPage directories: true adds tags, location, and the listed email with one more request per listing. Default true."),
192
+ dedupe_domains: bool().describe("Return a company listed more than once only once; skipped repeats are free. Default true."),
193
+ max_charge_usd: z.string().optional().describe("Optional. The run stops before any row that would take its charges over this amount."),
194
+ },
195
+ }, async (args) => runActor("ZX0XJPPUvnFJxeC1a", "Partner and Member Directory Extractor", compact(args)));
196
+ const transport = new StdioServerTransport();
197
+ await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@mambalabsdev/mcp-partner-member-directory-extractor",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "MCP server for Partner and Member Directory Extractor. Turn a vendor partner directory (PartnerPage, Shopify Partner Directory) or a trade body member list into one company row per listing with website, domain, tier, tags, and location. Runs on Apify. Clay-ready output.",
5
+ "type": "module",
6
+ "bin": {
7
+ "mcp-partner-member-directory-extractor": "./build/index.js"
8
+ },
9
+ "files": [
10
+ "build",
11
+ "README.md",
12
+ "LICENSE",
13
+ "SECURITY.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsc && chmod +x build/index.js",
17
+ "test": "npm run build && node --test test/*.test.js",
18
+ "prepublishOnly": "npm run build"
19
+ },
20
+ "keywords": [
21
+ "mcp",
22
+ "model-context-protocol",
23
+ "partner-directory",
24
+ "member-directory",
25
+ "lead-generation",
26
+ "list-building",
27
+ "b2b",
28
+ "apify",
29
+ "clay"
30
+ ],
31
+ "author": "Mamba Labs <labs@mambamindsetgrowth.com>",
32
+ "license": "MIT",
33
+ "homepage": "https://apify.com/mambalabs/partner-member-directory-extractor",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/mambalabsdev/mcp-partner-member-directory-extractor"
37
+ },
38
+ "engines": {
39
+ "node": ">=18"
40
+ },
41
+ "dependencies": {
42
+ "@modelcontextprotocol/sdk": "^1.32.0",
43
+ "zod": "^4.4.3"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^26.2.0",
47
+ "typescript": "5.9.3"
48
+ },
49
+ "mcpName": "com.mambabuilt/mcp-partner-member-directory-extractor"
50
+ }