@mambalabsdev/mcp-email-waterfall-orchestrator 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.
@@ -0,0 +1,13 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "npm"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ open-pull-requests-limit: 5
8
+ commit-message:
9
+ prefix: "deps"
10
+ - package-ecosystem: "github-actions"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
@@ -0,0 +1,14 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v4
10
+ - uses: actions/setup-node@v4
11
+ with:
12
+ node-version: '20'
13
+ - run: npm ci
14
+ - run: npm run build
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 ADDED
@@ -0,0 +1,68 @@
1
+ # Work Email Waterfall MCP Server
2
+
3
+ [![npm](https://img.shields.io/npm/v/@mambalabsdev/mcp-email-waterfall-orchestrator)](https://www.npmjs.com/package/@mambalabsdev/mcp-email-waterfall-orchestrator)
4
+ [![MCP](https://img.shields.io/badge/MCP-server-blue)](https://modelcontextprotocol.io)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
6
+
7
+ MCP server for the Mamba Labs [Work Email Waterfall](https://apify.com/mambalabs/email-waterfall-orchestrator) actor on Apify.
8
+
9
+ Give it contacts and your own provider API keys. It finds a work email for each, verifies it, and tells you exactly what each provider cost you.
10
+
11
+ ## Tool
12
+
13
+ `find_work_email`
14
+
15
+ Returns one flat row per contact, misses included, plus a summary row carrying the run totals: the address found, which provider found it, its position in the chain, every provider attempted, the verification verdict and its source, and the provider units spent.
16
+
17
+ ## Bring your own keys
18
+
19
+ This is the part that makes it different from a credit-based enrichment tool. Mamba Labs supplies no provider keys, never sees your credits, and never resells them. The run spends from your accounts at your negotiated rates, which is why `maxProviderUnits` exists and why you should set it.
20
+
21
+ The tradeoff is honest in both directions: you keep your own pricing and your own provider relationships, and you carry your own spend. What you get back is real attribution rather than a credit count, so you can see which provider actually earned its keep.
22
+
23
+ Give it `providerRates` and the run reports dollars at **your** rate. Leave it empty and it reports units only, because your plan tier is not knowable from here and guessing it would produce a confident wrong number.
24
+
25
+ ## What happens to a bad key
26
+
27
+ Nothing dramatic. Every key is validated for free before any paid call. A provider with no usable key is dropped from the chain and reported, rather than failing the run or silently burning attempts. With no keys at all the run still completes, explains which capabilities were unavailable, and charges nothing.
28
+
29
+ ## Verification is not an afterthought
30
+
31
+ Verification runs after **each** finder that returns an address, not once at the end, because providers do not agree on what "found" means. An address that one provider calls a hit and a verifier calls undeliverable is a miss, and you want to know that before it reaches a sequencer.
32
+
33
+ ## `find_work_email`
34
+
35
+ | Input | Type | Notes |
36
+ |---|---|---|
37
+ | `contacts` | object[] | One object per person. Any of `full_name`, `first_name`, `last_name`, `company_domain`, `company_name`, `linkedin_url`, `email`. A single contact is an array of one. |
38
+ | `providerKeys` | object | Your own keys, by provider name. Validated for free before any paid call. |
39
+ | `providerOrder` | string[] | Registry entry ids in call order. Empty means the actor's default chain. |
40
+ | `verificationOrder` | string[] | Verifier entry ids in order. Empty means the actor's default. |
41
+ | `maxContacts` | integer | Hard ceiling on contacts processed. |
42
+ | `maxProviderUnits` | integer | Run-level cap on provider credits spent from your accounts. Strongly recommended. |
43
+ | `providerRates` | object | Map of provider or provider.endpoint to your cost per unit, so spend is reported in dollars. |
44
+ | `concurrencyHint` | integer | Advisory. Real pacing comes from each endpoint's own multi-window rate limits. |
45
+
46
+ More identifiers means a better chance of a hit. Keyed on a LinkedIn URL the top provider measured 13.7 percent against 9.3 percent on name plus domain, on the same 300 contacts in the same hour.
47
+
48
+ ## Setup
49
+
50
+ ```json
51
+ {
52
+ "mcpServers": {
53
+ "mamba-email-waterfall-orchestrator": {
54
+ "command": "npx",
55
+ "args": ["-y", "@mambalabsdev/mcp-email-waterfall-orchestrator"],
56
+ "env": { "APIFY_TOKEN": "your-apify-token" }
57
+ }
58
+ }
59
+ }
60
+ ```
61
+
62
+ Get a token at [console.apify.com/account/integrations](https://console.apify.com/account/integrations). Read-only. Consumes Apify credits per contact submitted and per address found, on top of whatever your own provider keys spend.
63
+
64
+ ## Also available
65
+
66
+ This tool is also exposed by the [GTM Suite](https://www.npmjs.com/package/@mambalabsdev/mcp-gtm-suite) umbrella server, alongside the rest of the Mamba Labs GTM actors, if you would rather run one server than many.
67
+
68
+ Built by [Mamba Labs](https://apify.com/mambalabs).
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-ai-tooling-detector` 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,173 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * THIN APIFY API CLIENT. Nothing else belongs in this file.
4
+ *
5
+ * This wrapper carries exactly three things: the tool name, the input schema
6
+ * that mirrors the actor's own public input schema, and the HTTP call to the
7
+ * Apify API. It holds NO waterfall logic, NO chain order, NO parsing rules and
8
+ * NO provider knowledge beyond the provider names the actor's public input
9
+ * schema already exposes to every Store visitor.
10
+ *
11
+ * That logic lives in a private package vendored into the actor. This
12
+ * repository is public. Nothing from it may be copied here in any form.
13
+ */
14
+ import { readFileSync } from "node:fs";
15
+ import { fileURLToPath } from "node:url";
16
+ import { dirname, join } from "node:path";
17
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
18
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
19
+ import { z } from "zod";
20
+ const here = dirname(fileURLToPath(import.meta.url));
21
+ const pkg = JSON.parse(readFileSync(join(here, "..", "package.json"), "utf8"));
22
+ // Distinctive UA so Apify run meta.userAgent marks MCP-originated runs.
23
+ const USER_AGENT = `mambalabs-mcp ${pkg.name}@${pkg.version}`;
24
+ const APIFY_TOKEN = process.env.APIFY_TOKEN;
25
+ // Drop undefined values so optional inputs are not sent to the actor.
26
+ function compact(obj) {
27
+ const out = {};
28
+ for (const [k, v] of Object.entries(obj)) {
29
+ if (v !== undefined)
30
+ out[k] = v;
31
+ }
32
+ return out;
33
+ }
34
+ // Shared caller. actorPath is the actor's immutable Apify actor ID (a stable key
35
+ // that survives Store renames). The /v2/acts/{id} endpoint accepts it directly,
36
+ // so a Store rename never breaks these calls.
37
+ async function runActor(actorPath, actorLabel, input) {
38
+ if (!APIFY_TOKEN) {
39
+ 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." }] };
40
+ }
41
+ const url = `https://api.apify.com/v2/acts/${actorPath}/run-sync-get-dataset-items?timeout=300`;
42
+ let response;
43
+ try {
44
+ response = await fetch(url, {
45
+ method: "POST",
46
+ headers: {
47
+ Authorization: `Bearer ${APIFY_TOKEN}`,
48
+ "Content-Type": "application/json",
49
+ "User-Agent": USER_AGENT,
50
+ },
51
+ body: JSON.stringify(input),
52
+ });
53
+ }
54
+ catch (err) {
55
+ const message = err instanceof Error ? err.message : String(err);
56
+ return { isError: true, content: [{ type: "text", text: `Could not reach the Apify API: ${message}` }] };
57
+ }
58
+ if (!response.ok) {
59
+ let detail = "";
60
+ try {
61
+ const body = (await response.json());
62
+ if (body?.error?.message)
63
+ detail = ` ${body.error.message}`;
64
+ }
65
+ catch {
66
+ detail = "";
67
+ }
68
+ let message;
69
+ switch (response.status) {
70
+ case 401:
71
+ message = "Invalid Apify token. Check your APIFY_TOKEN environment variable.";
72
+ break;
73
+ case 402:
74
+ message =
75
+ "Insufficient Apify credits. Check your account balance at https://console.apify.com/billing";
76
+ break;
77
+ case 408:
78
+ message = `The ${actorLabel} run timed out after 300 seconds. Try a smaller batch, or run the actor on Apify directly for longer jobs.`;
79
+ break;
80
+ default:
81
+ message = `Apify request to ${actorLabel} failed with status ${response.status}.${detail}`;
82
+ }
83
+ return { isError: true, content: [{ type: "text", text: message }] };
84
+ }
85
+ const items = await response.json();
86
+ return { content: [{ type: "text", text: JSON.stringify(items, null, 2) }] };
87
+ }
88
+ const server = new McpServer({
89
+ name: "mamba-email-waterfall-orchestrator",
90
+ version: pkg.version,
91
+ });
92
+ const contactShape = z
93
+ .object({
94
+ full_name: z.string().optional(),
95
+ first_name: z.string().optional(),
96
+ last_name: z.string().optional(),
97
+ company_domain: z.string().optional(),
98
+ company_name: z.string().optional(),
99
+ linkedin_url: z.string().optional(),
100
+ email: z.string().optional(),
101
+ })
102
+ .passthrough();
103
+ // Work Email Waterfall (immutable actor ID OT6xqTFThC0Rjf7Zj)
104
+ server.registerTool("find_work_email", {
105
+ title: "Find Work Email",
106
+ description: "Find a work email address for each contact by running a chain of finder providers on YOUR OWN provider API keys, verify each result, and return real per-provider spend attribution instead of an opaque credit count. This is bring your own key: Mamba Labs supplies no provider keys, never sees your credits, and the run spends from your accounts, so set maxProviderUnits. Supply contacts as an array of objects, each carrying any of full_name, first_name, last_name, company_domain, company_name, linkedin_url and email. More identifiers means a better chance of a hit. Supply your keys in providerKeys by provider name. Every key is validated for free before any paid call, and a provider with no usable key is dropped from the chain and reported rather than failing the run; with no keys at all the run still completes, explains what was unavailable and charges nothing. Verification runs after each finder that returns an address, not once at the end. Every contact gets a row including misses, so you can see what was attempted, and a final summary row carries the run totals and spend. Returns flat Clay-ready JSON. Requires an APIFY_TOKEN and consumes Apify credits per contact submitted and per address found, on top of whatever your own provider keys spend.",
107
+ annotations: {
108
+ title: "Find Work Email",
109
+ readOnlyHint: true,
110
+ destructiveHint: false,
111
+ idempotentHint: false,
112
+ openWorldHint: true,
113
+ },
114
+ inputSchema: {
115
+ contacts: z
116
+ .array(contactShape)
117
+ .describe("One object per person. Each may carry full_name, first_name, last_name, company_domain, company_name, linkedin_url and email. A single contact is an array of one."),
118
+ providerKeys: z
119
+ .record(z.string())
120
+ .optional()
121
+ .describe("YOUR own provider API keys, keyed by provider name. Validated for free before any paid call. A provider with no usable key is dropped and reported rather than failing the run."),
122
+ providerOrder: z
123
+ .array(z.string())
124
+ .optional()
125
+ .describe("Registry entry ids in the order you want them called. Leave empty for the actor's default order."),
126
+ verificationOrder: z
127
+ .array(z.string())
128
+ .optional()
129
+ .describe("Verifier entry ids in order. Leave empty for the actor's default order."),
130
+ maxContacts: z
131
+ .number()
132
+ .int()
133
+ .min(1)
134
+ .optional()
135
+ .describe("Hard ceiling on how many contacts are processed. Leave empty for no ceiling."),
136
+ maxProviderUnits: z
137
+ .number()
138
+ .int()
139
+ .min(1)
140
+ .optional()
141
+ .describe("Run-level cap on the provider credits this run may consume from YOUR accounts. When it is reached the remaining contacts are skipped with a reason rather than spent on. Strongly recommended."),
142
+ providerRates: z
143
+ .record(z.number())
144
+ .optional()
145
+ .describe("Optional map of provider or provider.endpoint to YOUR cost per unit, for example {\"findymail.search_name\": 0.0198}. Supply it and the run reports dollars at your rate; leave it empty and it reports units only, because your plan tier is not knowable from here."),
146
+ concurrencyHint: z
147
+ .number()
148
+ .int()
149
+ .min(1)
150
+ .max(20)
151
+ .optional()
152
+ .describe("Advisory only. Real pacing comes from each endpoint's own documented rate limits, which are multi-window and per endpoint, so this cannot exceed them."),
153
+ },
154
+ }, async ({ contacts, providerKeys, providerOrder, verificationOrder, maxContacts, maxProviderUnits, providerRates, concurrencyHint }) => {
155
+ if (!Array.isArray(contacts) || contacts.length === 0) {
156
+ return {
157
+ isError: true,
158
+ content: [{ type: "text", text: "Provide contacts: an array of one or more contact objects." }],
159
+ };
160
+ }
161
+ return runActor("OT6xqTFThC0Rjf7Zj", "Work Email Waterfall", compact({
162
+ contacts,
163
+ providerKeys,
164
+ providerOrder,
165
+ verificationOrder,
166
+ maxContacts,
167
+ maxProviderUnits,
168
+ providerRates,
169
+ concurrencyHint,
170
+ }));
171
+ });
172
+ const transport = new StdioServerTransport();
173
+ await server.connect(transport);
package/glama.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://glama.ai/mcp/schemas/server.json",
3
+ "maintainers": [
4
+ "mambabuilt"
5
+ ]
6
+ }
package/logo.png ADDED
Binary file
package/manifest.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "manifest_version": "0.3",
3
+ "name": "mcp-email-waterfall-orchestrator",
4
+ "version": "1.0.0",
5
+ "description": "MCP server for the Mamba Labs Work Email Waterfall actor on Apify. Give it contacts and your own provider API keys and it finds a work email for each, verifies it, and returns real per-provider spend attribution as flat Clay-ready JSON.",
6
+ "author": {
7
+ "name": "Mamba Labs"
8
+ },
9
+ "license": "MIT",
10
+ "homepage": "https://github.com/mambalabsdev/mcp-email-waterfall-orchestrator",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/mambalabsdev/mcp-email-waterfall-orchestrator"
14
+ },
15
+ "server": {
16
+ "type": "node",
17
+ "entry_point": "build/index.js",
18
+ "mcp_config": {
19
+ "command": "node",
20
+ "args": [
21
+ "${__dirname}/build/index.js"
22
+ ],
23
+ "env": {
24
+ "APIFY_TOKEN": "${user_config.apify_token}"
25
+ }
26
+ }
27
+ },
28
+ "user_config": {
29
+ "apify_token": {
30
+ "type": "string",
31
+ "title": "Apify API Token",
32
+ "description": "Apify API token for running the actor",
33
+ "sensitive": true,
34
+ "required": false
35
+ }
36
+ }
37
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@mambalabsdev/mcp-email-waterfall-orchestrator",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for the Mamba Labs Work Email Waterfall actor on Apify. Give it contacts and your own provider API keys and it finds a work email for each, verifies it, and returns real per-provider spend attribution as flat Clay-ready JSON.",
5
+ "type": "module",
6
+ "bin": {
7
+ "mcp-email-waterfall-orchestrator": "./build/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc && chmod +x build/index.js",
11
+ "prepublishOnly": "npm run build"
12
+ },
13
+ "keywords": [
14
+ "mcp",
15
+ "model-context-protocol",
16
+ "email-finder",
17
+ "email-verification",
18
+ "waterfall",
19
+ "byok",
20
+ "lead-generation",
21
+ "enrichment",
22
+ "apify",
23
+ "clay"
24
+ ],
25
+ "author": "Mamba Labs <labs@mambamindsetgrowth.com>",
26
+ "license": "MIT",
27
+ "homepage": "https://apify.com/mambalabs",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/mambalabsdev/mcp-email-waterfall-orchestrator"
31
+ },
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
+ "dependencies": {
36
+ "@modelcontextprotocol/sdk": "^1.12.0",
37
+ "zod": "^3.23.8"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^20.14.0",
41
+ "typescript": "^5.6.0"
42
+ },
43
+ "mcpName": "com.mambabuilt/mcp-email-waterfall-orchestrator"
44
+ }
package/server.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "com.mambabuilt/mcp-email-waterfall-orchestrator",
4
+ "description": "Finds and verifies work emails on your own provider keys, with real per-provider spend.",
5
+ "version": "1.0.0",
6
+ "repository": {
7
+ "url": "https://github.com/mambalabsdev/mcp-email-waterfall-orchestrator",
8
+ "source": "github"
9
+ },
10
+ "packages": [
11
+ {
12
+ "registryType": "npm",
13
+ "identifier": "@mambalabsdev/mcp-email-waterfall-orchestrator",
14
+ "version": "1.0.0",
15
+ "transport": {
16
+ "type": "stdio"
17
+ },
18
+ "environmentVariables": [
19
+ {
20
+ "name": "APIFY_TOKEN",
21
+ "description": "Apify API token from https://console.apify.com/account/integrations",
22
+ "isRequired": true,
23
+ "isSecret": true,
24
+ "format": "string"
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ }