@mambalabsdev/mcp-gtm-suite 1.8.0 → 1.10.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
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Smithery](https://smithery.ai/badge/mambabuilt/mcp-gtm-suite)](https://smithery.ai/servers/mambabuilt/mcp-gtm-suite) [![Glama score](https://glama.ai/mcp/servers/mambalabsdev/mcp-gtm-suite/badges/score.svg)](https://glama.ai/mcp/servers/mambalabsdev/mcp-gtm-suite) [![MCP Registry](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.modelcontextprotocol.io%2Fv0%2Fservers%3Fsearch%3Dcom.mambabuilt%252Fmcp-gtm-suite%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-gtm-suite&limit=1) [![npm version](https://img.shields.io/npm/v/@mambalabsdev/mcp-gtm-suite)](https://www.npmjs.com/package/@mambalabsdev/mcp-gtm-suite) [![npm downloads](https://img.shields.io/npm/dm/@mambalabsdev/mcp-gtm-suite)](https://www.npmjs.com/package/@mambalabsdev/mcp-gtm-suite) [![license](https://img.shields.io/github/license/mambalabsdev/mcp-gtm-suite)](https://github.com/mambalabsdev/mcp-gtm-suite/blob/main/LICENSE) [![mcpservers.org](https://img.shields.io/badge/mcpservers.org-listed-blue)](https://mcpservers.org/servers/mambalabsdev/mcp-gtm-suite)
4
4
 
5
- One MCP server that exposes the entire Mamba Labs GTM Suite. Install a single package and get all twenty one account-intelligence tools in your MCP client, each wrapping a Mamba Labs actor on Apify and returning Clay-ready flat JSON.
5
+ One MCP server that exposes the Mamba Labs GTM Suite. Install a single package and get all twenty one account-intelligence tools in your MCP client, each wrapping a Mamba Labs actor on Apify and returning Clay-ready flat JSON.
6
6
 
7
7
  ## What's Inside
8
8
 
@@ -11,6 +11,7 @@ One MCP server that exposes the entire Mamba Labs GTM Suite. Install a single pa
11
11
  - [Prerequisites](#prerequisites)
12
12
  - [Example prompts](#example-prompts)
13
13
  - [Tools and inputs](#tools-and-inputs)
14
+ - [How each call runs](#how-each-call-runs)
14
15
  - [Full actor documentation](#full-actor-documentation)
15
16
  - [Mamba Labs GTM Suite](#mamba-labs-gtm-suite)
16
17
  - [License](#license)
@@ -93,23 +94,35 @@ Get your token at https://console.apify.com/account/integrations, paste it in, a
93
94
 
94
95
  ## Tools and inputs
95
96
 
96
- Each tool maps to one Apify actor. Inputs mirror the actor, minus deprecated and batch-only fields:
97
-
98
- - `resolve_company_identity`: at least one of `company_name`, `domain`, or `linkedin_url`, plus `skipCache`
99
- - `enrich_company_firmographics`: at least one of `domain` or `domains`, plus `company_name`, `batchSize`, `skipCache`
100
- - `map_company_social_presence`: `company_domain` or `company_name` (at least one), plus `platforms`, `includeFollowerCounts`, `skipCache`
101
- - `resolve_linkedin_url`: `company_domain` or `company_name` (at least one)
102
- - `scan_gtm_hiring_signals`: `domain` (required), `role_filter`, `ats_slug`
103
- - `detect_gtm_tech_stack`: `domain` (required), `crawl_additional_pages`
104
- - `scan_job_board_keywords`: `company_domain` (required), `role_categories` (required), `custom_keywords`, `enable_fallback`, `previous_roles_detected`, `previous_run_date`
105
- - `get_funding_press_signals`: `domain` (required), `company_name`
106
- - `get_company_changes`: `domain` (required), `company_name`
107
- - `aggregate_gtm_signals`: `company_domain` (required), `include_summary`, `explain_mode`
108
- - `score_icp_fit`: `company_domain` (required), plus `template`, `scoring_config`, `icp_description` (+ `llm_api_key`, `llm_provider`), `fetch_signals`, `include_explanation`
109
- - `detect_ai_tooling`: at least one of `domain` or `domains`, plus `check_pricing`
110
- - `fingerprint_outbound_infrastructure`: at least one of `domain` or `domains`, plus `scan_sending_domains`, `sending_domain_depth`, `check_deliverability`
111
- - `track_publication_cadence`: at least one of `domain` or `domains`, plus `max_pages_to_date`, `domain_time_budget_ms`
112
- - `push_leads_to_sequencer`: `sequencer` and `campaign_id` (required), one of `leads` or `dataset_id`, plus `api_key`, `min_icp_score`, `deduplicate`, `dry_run`, `field_mapping`, `custom_variables`. **The only tool here that writes**: it adds leads to your campaign unless `dry_run` is true.
97
+ Each tool maps to one Apify actor. Every input each tool accepts is listed below, generated from the server's own tool list. Where a tool marks nothing required, it still needs one identifier: the tool says which when you call it without one.
98
+
99
+ - `scan_gtm_hiring_signals` (7 inputs): required `domain`; optional `role_filter`, `ats_slug`, `mode`, `include_role_details`, `previous_gtm_role_count`, `previous_run_date`
100
+ - `detect_gtm_tech_stack` (5 inputs): optional `domain`, `company_domain`, `url`, `crawl_additional_pages`, `skipCache`
101
+ - `aggregate_gtm_signals` (3 inputs): required `company_domain`; optional `include_summary`, `explain_mode`
102
+ - `scan_job_board_keywords` (6 inputs): required `company_domain`, `role_categories`; optional `custom_keywords`, `enable_fallback`, `previous_roles_detected`, `previous_run_date`
103
+ - `resolve_linkedin_url` (4 inputs): optional `company_domain`, `company_name`, `includeFirmographics`, `skipCache`
104
+ - `score_icp_fit` (43 inputs): required `company_domain`; optional `company_name`, `template`, `scoring_config`, `icp_description`, `llm_api_key`, `llm_provider`, `fetch_signals`, `include_explanation`, `tier_thresholds`, `funded_within_days`, `min_score_to_output`, `previous_score`, `gtm_hiring_signal`, `gtm_role_count`, `uses_hubspot`, `uses_salesforce`, `uses_clay`, `crm_detected`, `seq_tool_detected`, `tech_stack`, `headcount`, `headcount_min`, `headcount_max`, `headcount_in_range`, `employee_band`, `revenue_estimate`, `hq_location`, `founded_year`, `recently_funded`, `last_funding_date`, `latest_funding_date`, `latest_funding_amount`, `funding_stage`, `industry`, `industry_match`, `target_industries`, `social_platforms_found`, `total_followers`, `has_linkedin`, `has_twitter`, `job_count`, `keyword_match_count`
105
+ - `resolve_company_identity` (4 inputs): optional `company_name`, `domain`, `linkedin_url`, `skipCache`
106
+ - `enrich_company_firmographics` (5 inputs): optional `domain`, `company_name`, `domains`, `batchSize`, `skipCache`
107
+ - `map_company_social_presence` (5 inputs): optional `company_domain`, `company_name`, `platforms`, `includeFollowerCounts`, `skipCache`
108
+ - `get_funding_press_signals` (2 inputs): required `domain`; optional `company_name`
109
+ - `get_company_changes` (4 inputs): required `domain`; optional `company_name`, `previous_snapshot`, `sub_actor_timeout_secs`
110
+ - `detect_ai_tooling` (5 inputs): optional `domain`, `domains`, `check_pricing`, `skipCache`, `request_timeout_ms`
111
+ - `fingerprint_outbound_infrastructure` (9 inputs): optional `domain`, `domains`, `scan_sending_domains`, `sending_domain_depth`, `check_deliverability`, `skipCache`, `max_sending_domain_probes`, `request_timeout_ms`, `dns_timeout_ms`
112
+ - `track_publication_cadence` (8 inputs): optional `domain`, `domains`, `max_pages_to_date`, `domain_time_budget_ms`, `skipCache`, `page_concurrency`, `max_sitemap_fetches`, `request_timeout_ms`
113
+ - `push_leads_to_sequencer` (10 inputs): required `sequencer`, `campaign_id`; optional `api_key`, `leads`, `dataset_id`, `min_icp_score`, `deduplicate`, `dry_run`, `field_mapping`, `custom_variables`
114
+ - `audit_agent_accessibility` (4 inputs): required `domain`; optional `check_endpoints`, `check_structured_data`, `skipCache`
115
+ - `classify_contact` (8 inputs): required `job_title`; optional `full_name`, `company_domain`, `verify_position`, `use_llm_fallback`, `llm_provider`, `llm_model`, `skipCache`
116
+ - `map_company_event_presence` (6 inputs): required `domain`; optional `company_name`, `years`, `include_own_events`, `max_queries`, `skipCache`
117
+ - `resolve_legal_entity` (6 inputs): required `domain`; optional `legal_name_hint`, `jurisdiction_hint`, `match_strictness`, `validate_vat`, `skipCache`
118
+ - `monitor_public_awards` (7 inputs): required `register`; optional `window_days`, `min_award_value`, `max_entities`, `exclude_government_recipients`, `resolve_domains`, `domain_confidence_floor`
119
+ - `capture_linkedin_posts_and_commenters` (7 inputs): optional `profile_urls`, `company_urls`, `posted_since`, `collect_commenters`, `collect_reactors`, `max_engagers_per_post`, `use_residential_proxy`
120
+
121
+ `push_leads_to_sequencer` is the only tool here that writes: it adds leads to your campaign unless `dry_run` is true.
122
+
123
+ ## How each call runs
124
+
125
+ Each call starts the actor run, polls it until it finishes, then reads the dataset. A run is allowed 1,800 seconds. If the run is still going when this call stops waiting, the call returns the run id and a console link instead of a timeout, so the result is never lost.
113
126
 
114
127
  ## Full actor documentation
115
128
 
@@ -121,32 +134,35 @@ https://apify.com/mambalabs
121
134
 
122
135
  ## Mamba Labs GTM Suite
123
136
 
124
- This is the umbrella server for the **Mamba Labs GTM Suite**, an account-intelligence fleet of twenty one tools for go-to-market signal intelligence, each backed by a dedicated Apify actor and also published as its own standalone MCP server.
137
+ This is the umbrella server for the **Mamba Labs GTM Suite**: twenty one account-intelligence tools for go-to-market signal intelligence, each backed by a dedicated Apify actor and also published as its own standalone MCP server. The Mamba Labs fleet has 53 public actors; the brand presence mappers, the influencer suite, Expert Witness Directory, and the other actors outside this list are available as their own servers under [@mambalabsdev on npm](https://www.npmjs.com/org/mambalabsdev).
125
138
 
126
139
  | Tool | Actor | Immutable Actor ID |
127
140
  |---|---|---|
128
- | `resolve_company_identity` | [Company Identity Resolver](https://console.apify.com/actors/lr8fTRAmZCBZmuwwh) | `lr8fTRAmZCBZmuwwh` |
129
- | `enrich_company_firmographics` | [Company Firmographic Enricher](https://console.apify.com/actors/YlUtLWjfPpqykmB8g) | `YlUtLWjfPpqykmB8g` |
130
- | `map_company_social_presence` | [Company Social Presence Mapper](https://console.apify.com/actors/4k6CCemkgBDz18m2h) | `4k6CCemkgBDz18m2h` |
131
- | `resolve_linkedin_url` | [Domain to LinkedIn URL Resolver](https://console.apify.com/actors/3HtnSaqPHOg1Qg5gx) | `3HtnSaqPHOg1Qg5gx` |
132
- | `scan_gtm_hiring_signals` | [GTM Hiring Signal Scraper](https://console.apify.com/actors/D7O1SA2EqwHGsGr1P) | `D7O1SA2EqwHGsGr1P` |
133
- | `detect_gtm_tech_stack` | [GTM Tech Stack Signal Enrichment](https://console.apify.com/actors/qyd7nNyqFPelQViBx) | `qyd7nNyqFPelQViBx` |
134
- | `scan_job_board_keywords` | [Job Board Keyword Signal Scanner](https://console.apify.com/actors/4DvqpvhMR74NLcDDY) | `4DvqpvhMR74NLcDDY` |
135
- | `get_funding_press_signals` | [Funding & Press Signal Scanner](https://console.apify.com/actors/FS13X6dhQVgX3XOM6) | `FS13X6dhQVgX3XOM6` |
136
- | `get_company_changes` | [Company Change-Event Feed](https://console.apify.com/actors/oX44rS0fkEJ3rXLWe) | `oX44rS0fkEJ3rXLWe` |
137
- | `aggregate_gtm_signals` | [GTM Signals Aggregator](https://console.apify.com/actors/xKdRfnfFNkdMpFuNs) | `xKdRfnfFNkdMpFuNs` |
138
- | `score_icp_fit` | [ICP Fit Scorer](https://console.apify.com/actors/W161DT8W4kW55dMFh) | `W161DT8W4kW55dMFh` |
139
- | `push_leads_to_sequencer` | [Sequencer Lead Push](https://console.apify.com/actors/0Jv27VeWM5tSZQs9x) | `0Jv27VeWM5tSZQs9x` |
140
- | `audit_agent_accessibility` | [Agent Accessibility Auditor](https://console.apify.com/actors/anxbRv0lKrpQ1pnua) | `anxbRv0lKrpQ1pnua` |
141
- | `classify_contact` | [Contact Classifier](https://console.apify.com/actors/0lGSeYJmniXhGANnO) | `0lGSeYJmniXhGANnO` |
142
- | `map_company_event_presence` | [Event Presence Index](https://console.apify.com/actors/WLhMy8fMDgsxdYxv5) | `WLhMy8fMDgsxdYxv5` |
143
- | `resolve_legal_entity` | [Legal Entity Resolver](https://console.apify.com/actors/KHFyPCDIx7CyqULYm) | `KHFyPCDIx7CyqULYm` |
144
- | `monitor_public_awards` | [Government Contract Award Monitor](https://console.apify.com/actors/zhEtllASykOcx9hJ8) | `zhEtllASykOcx9hJ8` |
145
- | `capture_linkedin_posts_and_commenters` | [LinkedIn Post Tracker and Comment Capture](https://console.apify.com/actors/oiGLNPuaf5BRaz9K5) | `oiGLNPuaf5BRaz9K5` |
146
-
147
- > The [Domain Deliverability Checker](https://console.apify.com/actors/0tVgxI7A6o9jMlxmc) actor is published as a standalone MCP server but is intentionally not bundled here: it audits email-sending infrastructure (SPF, DKIM, DMARC, blacklists) rather than account intelligence, so it sits outside this suite's scope.
148
-
149
- > Built by [Mamba Labs](https://github.com/mambalabsdev) | [npm](https://www.npmjs.com/org/mambalabsdev) | [Apify Store](https://apify.com/mambabuilt)
141
+ | `scan_gtm_hiring_signals` | [GTM Hiring Signal Scraper](https://apify.com/mambalabs/gtm-hiring-signal-scraper) | `D7O1SA2EqwHGsGr1P` |
142
+ | `detect_gtm_tech_stack` | [Tech Stack Signal Detector](https://apify.com/mambalabs/gtm-tech-stack-signal-scraper) | `qyd7nNyqFPelQViBx` |
143
+ | `aggregate_gtm_signals` | [GTM Signals Aggregator](https://apify.com/mambalabs/b2b-buying-signals-hiring-tech-stack-intent-for-clay) | `xKdRfnfFNkdMpFuNs` |
144
+ | `scan_job_board_keywords` | [Job Board Keyword Signal Scanner](https://apify.com/mambalabs/job-board-keyword-signal-scanner) | `4DvqpvhMR74NLcDDY` |
145
+ | `resolve_linkedin_url` | [Domain to LinkedIn URL Resolver](https://apify.com/mambalabs/domain-to-linkedin-url-resolver) | `3HtnSaqPHOg1Qg5gx` |
146
+ | `score_icp_fit` | [ICP Fit Scorer](https://apify.com/mambalabs/icp-account-lead-scoring-fit-scorer-0-100-for-clay) | `W161DT8W4kW55dMFh` |
147
+ | `resolve_company_identity` | [Company Identity Resolver](https://apify.com/mambalabs/company-identity-resolver) | `lr8fTRAmZCBZmuwwh` |
148
+ | `enrich_company_firmographics` | [Company Firmographic Enricher](https://apify.com/mambalabs/company-firmographic-enricher) | `YlUtLWjfPpqykmB8g` |
149
+ | `map_company_social_presence` | [Company Social Presence Mapper](https://apify.com/mambalabs/company-social-presence-mapper) | `4k6CCemkgBDz18m2h` |
150
+ | `get_funding_press_signals` | [Funding and Press Signal Scanner](https://apify.com/mambalabs/funding-press-signal-scanner) | `FS13X6dhQVgX3XOM6` |
151
+ | `get_company_changes` | [Company Change Event Feed](https://apify.com/mambalabs/company-change-event-feed) | `oX44rS0fkEJ3rXLWe` |
152
+ | `detect_ai_tooling` | [AI Tooling Detector](https://apify.com/mambalabs/ai-tooling-detector) | `EwkHhmqiuJgRoVEbE` |
153
+ | `fingerprint_outbound_infrastructure` | [Outbound Stack Detector](https://apify.com/mambalabs/outbound-infrastructure-fingerprint) | `v43UJC8r7qW7cBSTG` |
154
+ | `track_publication_cadence` | [Publishing Frequency Tracker](https://apify.com/mambalabs/blog-publishing-frequency) | `TbLwaUUATdYb6wp4N` |
155
+ | `push_leads_to_sequencer` | [Sequencer Lead Push](https://apify.com/mambalabs/clay-to-instantly-smartlead-push) | `0Jv27VeWM5tSZQs9x` |
156
+ | `audit_agent_accessibility` | [Agent Accessibility Auditor](https://apify.com/mambalabs/agent-accessibility-auditor) | `anxbRv0lKrpQ1pnua` |
157
+ | `classify_contact` | [Contact Classifier](https://apify.com/mambalabs/contact-classifier) | `0lGSeYJmniXhGANnO` |
158
+ | `map_company_event_presence` | [Event Presence Index](https://apify.com/mambalabs/event-presence-index) | `WLhMy8fMDgsxdYxv5` |
159
+ | `resolve_legal_entity` | [Legal Entity Resolver](https://apify.com/mambalabs/legal-entity-resolver) | `KHFyPCDIx7CyqULYm` |
160
+ | `monitor_public_awards` | [Government Contract Award Monitor](https://apify.com/mambalabs/public-award-monitor) | `zhEtllASykOcx9hJ8` |
161
+ | `capture_linkedin_posts_and_commenters` | [LinkedIn Post Tracker](https://apify.com/mambalabs/linkedin-post-engager-capture) | `oiGLNPuaf5BRaz9K5` |
162
+
163
+ > The [Domain Deliverability Checker](https://apify.com/mambalabs/domain-deliverability-checker) actor is published as a standalone MCP server but is intentionally not bundled here: it audits email-sending infrastructure (SPF, DKIM, DMARC, blacklists) rather than account intelligence, so it sits outside this suite's scope.
164
+
165
+ > Built by [Mamba Labs](https://github.com/mambalabsdev) | [npm](https://www.npmjs.com/org/mambalabsdev) | [Apify Store](https://apify.com/mambalabs) | [mambabuilt.com](https://mambabuilt.com)
150
166
 
151
167
  ## License
152
168
 
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-gtm-suite` 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 CHANGED
@@ -24,32 +24,60 @@ function compact(obj) {
24
24
  function boolToString(v) {
25
25
  return v === undefined ? undefined : v ? "true" : "false";
26
26
  }
27
- // Shared caller. actorPath is the actor's immutable Apify actor ID (a stable
28
- // 17-char key that survives Store renames). The /v2/acts/{id} endpoint accepts
29
- // it directly. We use IDs rather than the mambalabs~slug path so a Store rename
30
- // never breaks these calls.
27
+ // How long the actor run itself is allowed to take, in seconds.
28
+ //
29
+ // MEASURED across the whole fleet, because this one caller fronts 21 actors
30
+ // and a per-actor number would be 21 constants that drift. Over every SUCCEEDED
31
+ // run in actor_runs on 2026-09-08, 5,088 of them carrying a duration: P95
32
+ // 38.5 s, P99 171.3 s, slowest ever 1,010.7 s.
33
+ //
34
+ // The suite was calling run-sync-get-dataset-items?timeout=300, so every tool
35
+ // it exposes was cut off at five minutes while the slowest run any of these
36
+ // actors has completed takes nearly seventeen. 1800 s is 1.8 times that slowest
37
+ // run and more than ten times the fleet P99, which is headroom for the slow
38
+ // tools without letting a hung run bill indefinitely.
39
+ //
40
+ // The standalone job discovery wrapper moved to start-and-poll first and the
41
+ // suite's copy of that tool did not, which is finding M-B4. This closes it for
42
+ // all 21.
43
+ const ACTOR_RUN_TIMEOUT_SECS = 1800;
44
+ // How long this wrapper waits for that run, in milliseconds. The actor's own
45
+ // timeout plus two minutes, so the run's own TIMED-OUT status is what the
46
+ // caller sees rather than the wrapper giving up first and reporting nothing.
47
+ const WRAPPER_WAIT_MS = (ACTOR_RUN_TIMEOUT_SECS + 120) * 1000;
48
+ // MAMBA_MCP_POLL_INTERVAL_MS exists for the test suite, which drives the poll
49
+ // loop against a mocked Apify API. Callers never need to set it.
50
+ const POLL_INTERVAL_MS = Number(process.env.MAMBA_MCP_POLL_INTERVAL_MS) || 3000;
51
+ const TERMINAL = new Set(["SUCCEEDED", "FAILED", "TIMED-OUT", "ABORTED", "ABORTING"]);
52
+ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
53
+ // Shared caller. actorPath is the actor's immutable Apify actor ID (a stable key
54
+ // that survives Store renames). The /v2/acts/{id} endpoint accepts it directly,
55
+ // so a Store rename never breaks these calls.
56
+ //
57
+ // START AND POLL, NOT RUN-SYNC. This wrapper used
58
+ // run-sync-get-dataset-items?timeout=300 and cut off runs the actor completes:
59
+ // runs that the actors complete. Raising that query parameter does not fix it,
60
+ // which is worth stating
61
+ // because it is the obvious fix and it is wrong. Apify's synchronous endpoints
62
+ // carry a platform ceiling of 300 seconds on the HTTP wait itself and answer
63
+ // 408 past it regardless of what `timeout` says. The only way for the wrapper
64
+ // to wait as long as the actor needs is to start the run, poll it to a terminal
65
+ // status, and then read the dataset.
66
+ //
67
+ // The token is read here rather than at module load, so the tool registers
68
+ // unconditionally and a server started without APIFY_TOKEN still advertises its
69
+ // capabilities instead of reporting none.
31
70
  async function runActor(actorPath, actorLabel, input) {
71
+ const APIFY_TOKEN = process.env.APIFY_TOKEN;
32
72
  if (!APIFY_TOKEN) {
33
73
  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." }] };
34
74
  }
35
- const url = `https://api.apify.com/v2/acts/${actorPath}/run-sync-get-dataset-items?timeout=300`;
36
- let response;
37
- try {
38
- response = await fetch(url, {
39
- method: "POST",
40
- headers: {
41
- Authorization: `Bearer ${APIFY_TOKEN}`,
42
- "Content-Type": "application/json",
43
- "User-Agent": USER_AGENT,
44
- },
45
- body: JSON.stringify(input),
46
- });
47
- }
48
- catch (err) {
49
- const message = err instanceof Error ? err.message : String(err);
50
- return { isError: true, content: [{ type: "text", text: `Could not reach the Apify API: ${message}` }] };
51
- }
52
- if (!response.ok) {
75
+ const headers = {
76
+ Authorization: `Bearer ${APIFY_TOKEN}`,
77
+ "Content-Type": "application/json",
78
+ "User-Agent": USER_AGENT,
79
+ };
80
+ const httpError = async (response) => {
53
81
  let detail = "";
54
82
  try {
55
83
  const body = (await response.json());
@@ -59,24 +87,107 @@ async function runActor(actorPath, actorLabel, input) {
59
87
  catch {
60
88
  detail = "";
61
89
  }
62
- let message;
63
90
  switch (response.status) {
91
+ case 400:
92
+ return `The ${actorLabel} run was rejected as invalid input.${detail}`;
64
93
  case 401:
65
- message = "Invalid Apify token. Check your APIFY_TOKEN environment variable.";
66
- break;
94
+ return "Invalid Apify token. Check your APIFY_TOKEN environment variable.";
67
95
  case 402:
68
- message =
69
- "Insufficient Apify credits. Check your account balance at https://console.apify.com/billing";
70
- break;
71
- case 408:
72
- message = `The ${actorLabel} run timed out after 300 seconds. Try again, or run the actor on Apify directly for longer jobs.`;
73
- break;
96
+ return "Insufficient Apify credits. Check your account balance at https://console.apify.com/billing";
74
97
  default:
75
- message = `Apify request to ${actorLabel} failed with status ${response.status}.${detail}`;
98
+ return `Apify request to ${actorLabel} failed with status ${response.status}.${detail}`;
76
99
  }
77
- return { isError: true, content: [{ type: "text", text: message }] };
100
+ };
101
+ // 1. Start the run.
102
+ let started;
103
+ try {
104
+ started = await fetch(`https://api.apify.com/v2/acts/${actorPath}/runs?timeout=${ACTOR_RUN_TIMEOUT_SECS}`, { method: "POST", headers, body: JSON.stringify(input) });
105
+ }
106
+ catch (err) {
107
+ const message = err instanceof Error ? err.message : String(err);
108
+ return { isError: true, content: [{ type: "text", text: `Could not reach the Apify API: ${message}` }] };
109
+ }
110
+ if (!started.ok) {
111
+ return { isError: true, content: [{ type: "text", text: await httpError(started) }] };
112
+ }
113
+ let run;
114
+ try {
115
+ run = (await started.json()).data ?? {};
116
+ }
117
+ catch (err) {
118
+ const message = err instanceof Error ? err.message : String(err);
119
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run start returned a response that could not be parsed: ${message}` }] };
120
+ }
121
+ const runId = run.id;
122
+ if (!runId) {
123
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run start returned no run id, so there is nothing to wait for.` }] };
124
+ }
125
+ // 2. Poll to a terminal status.
126
+ const deadline = Date.now() + WRAPPER_WAIT_MS;
127
+ let status = run.status ?? "READY";
128
+ let datasetId = run.defaultDatasetId;
129
+ while (!TERMINAL.has(status)) {
130
+ if (Date.now() >= deadline) {
131
+ return {
132
+ isError: true,
133
+ 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}` }],
134
+ };
135
+ }
136
+ await sleep(POLL_INTERVAL_MS);
137
+ let poll;
138
+ try {
139
+ poll = await fetch(`https://api.apify.com/v2/actor-runs/${runId}`, { headers });
140
+ }
141
+ catch (err) {
142
+ const message = err instanceof Error ? err.message : String(err);
143
+ return { isError: true, content: [{ type: "text", text: `Lost contact with the Apify API while waiting for ${actorLabel} run ${runId}: ${message}` }] };
144
+ }
145
+ if (!poll.ok) {
146
+ return { isError: true, content: [{ type: "text", text: await httpError(poll) }] };
147
+ }
148
+ const body = (await poll.json());
149
+ status = body.data?.status ?? status;
150
+ datasetId = body.data?.defaultDatasetId ?? datasetId;
151
+ }
152
+ // 3. A run that did not succeed is a failure the caller must see, never an
153
+ // empty success. Surfacing it here is what keeps a crashed run from reading
154
+ // as "no results found".
155
+ if (status !== "SUCCEEDED") {
156
+ return {
157
+ isError: true,
158
+ content: [{ type: "text", text: `The ${actorLabel} run did not succeed (run ID: ${runId}, status: ${status}).` }],
159
+ };
160
+ }
161
+ if (!datasetId) {
162
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run ${runId} succeeded but reported no dataset, so there is nothing to return.` }] };
163
+ }
164
+ // 4. Read the dataset.
165
+ let ds;
166
+ try {
167
+ ds = await fetch(`https://api.apify.com/v2/datasets/${datasetId}/items?format=json`, { headers });
168
+ }
169
+ catch (err) {
170
+ const message = err instanceof Error ? err.message : String(err);
171
+ return { isError: true, content: [{ type: "text", text: `Could not read the ${actorLabel} dataset: ${message}` }] };
172
+ }
173
+ if (!ds.ok) {
174
+ return { isError: true, content: [{ type: "text", text: await httpError(ds) }] };
175
+ }
176
+ let items;
177
+ try {
178
+ items = await ds.json();
179
+ }
180
+ catch (err) {
181
+ const message = err instanceof Error ? err.message : String(err);
182
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run returned a response that could not be parsed: ${message}` }] };
183
+ }
184
+ if (!Array.isArray(items)) {
185
+ const asObj = items;
186
+ const detail = asObj?.error?.message
187
+ ? `${asObj.error.message}`
188
+ : JSON.stringify(items);
189
+ return { isError: true, content: [{ type: "text", text: `The ${actorLabel} run did not return a dataset. ${detail}` }] };
78
190
  }
79
- const items = await response.json();
80
191
  return { content: [{ type: "text", text: JSON.stringify(items, null, 2) }] };
81
192
  }
82
193
  const server = new McpServer({
@@ -86,7 +197,7 @@ const server = new McpServer({
86
197
  // 1. GTM Hiring Signal Scraper
87
198
  server.registerTool("scan_gtm_hiring_signals", {
88
199
  title: "Scan GTM Hiring Signals",
89
- description: "Scan company career pages to detect GTM hiring activity. Returns sales, marketing, and revenue operations job postings across Greenhouse, Lever, and Ashby as a flat, Clay-ready JSON row. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
200
+ description: "Scan company career pages to detect GTM hiring activity. Returns sales, marketing, and revenue operations job postings across Greenhouse, Lever, and Ashby as a flat, Clay-ready JSON row. Use this for a go-to-market hiring verdict (is the company building its sales and marketing team, and how fast); use scan_job_board_keywords instead to count open roles in categories or keywords you choose, including non-GTM roles. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
90
201
  annotations: {
91
202
  title: "Scan GTM Hiring Signals",
92
203
  readOnlyHint: true,
@@ -191,7 +302,7 @@ server.registerTool("aggregate_gtm_signals", {
191
302
  // 4. Job Board Keyword Signal Scanner
192
303
  server.registerTool("scan_job_board_keywords", {
193
304
  title: "Scan Job Board Keywords",
194
- description: "Scan a company's job board for roles in chosen categories across Greenhouse, Lever, Ashby, Workday, and Rippling. Returns matched role counts and titles per category as a flat, Clay-ready JSON row. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
305
+ description: "Scan a company's job board for roles in chosen categories across Greenhouse, Lever, Ashby, Workday, and Rippling. Returns matched role counts and titles per category as a flat, Clay-ready JSON row. Use this when you choose the role categories or keywords (engineering, finance, a product name in a job ad); use scan_gtm_hiring_signals instead for the fixed sales and marketing hiring verdict. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
195
306
  annotations: {
196
307
  title: "Scan Job Board Keywords",
197
308
  readOnlyHint: true,
@@ -229,7 +340,7 @@ server.registerTool("scan_job_board_keywords", {
229
340
  // 5. Domain to LinkedIn URL Resolver
230
341
  server.registerTool("resolve_linkedin_url", {
231
342
  title: "Resolve LinkedIn URL",
232
- description: "Resolve a company domain or name to its LinkedIn company URL with a confidence score, firmographics, and social links as a flat, Clay-ready JSON row. Provide at least one of company_domain or company_name. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
343
+ description: "Resolve a company domain or name to its LinkedIn company URL with a confidence score, firmographics, and social links as a flat, Clay-ready JSON row. Provide at least one of company_domain or company_name. Use this when the LinkedIn company URL is the answer you need; use resolve_company_identity instead to cross-check a name, domain, and LinkedIn URL you already hold and get a canonical identity with conflicts flagged. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
233
344
  annotations: {
234
345
  title: "Resolve LinkedIn URL",
235
346
  readOnlyHint: true,
@@ -375,7 +486,7 @@ server.registerTool("score_icp_fit", {
375
486
  // 7. Company Identity Resolver
376
487
  server.registerTool("resolve_company_identity", {
377
488
  title: "Resolve Company Identity",
378
- description: "Resolve any combination of company name, domain, or LinkedIn URL into one canonical company identity: the name, primary domain, and LinkedIn company URL, each with a 0-100 confidence score plus an overall score and a match method. Cross-checks the inputs you give it, resolves the ones you do not, and flags conflicts (a domain and a LinkedIn slug that disagree) instead of merging them. Provide at least one of company_name, domain, or linkedin_url. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
489
+ description: "Resolve any combination of company name, domain, or LinkedIn URL into one canonical company identity: the name, primary domain, and LinkedIn company URL, each with a 0-100 confidence score plus an overall score and a match method. Cross-checks the inputs you give it, resolves the ones you do not, and flags conflicts (a domain and a LinkedIn slug that disagree) instead of merging them. Provide at least one of company_name, domain, or linkedin_url. Use this to reconcile or deduplicate records you already hold; use resolve_linkedin_url instead when you only need the LinkedIn company URL for a domain or name. Read-only; requires an APIFY_TOKEN and consumes Apify credits per call.",
379
490
  annotations: {
380
491
  title: "Resolve Company Identity",
381
492
  readOnlyHint: true,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mambalabsdev/mcp-gtm-suite",
3
- "version": "1.8.0",
4
- "description": "MCP server for the full Mamba Labs GTM Suite. One server exposing eleven account-intelligence actors on Apify as tools: identity, firmographics, social presence, hiring, tech stack, job boards, funding, change feed, LinkedIn, signals and ICP scoring.",
3
+ "version": "1.10.0",
4
+ "description": "MCP server for the Mamba Labs GTM Suite. One server exposing twenty one account-intelligence actors on Apify as tools: identity, firmographics, social presence, hiring, tech stack, job boards, funding, change feed, LinkedIn, signals, ICP scoring, and more.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "mcp-gtm-suite": "./build/index.js"
@@ -9,10 +9,12 @@
9
9
  "files": [
10
10
  "build",
11
11
  "README.md",
12
- "LICENSE"
12
+ "LICENSE",
13
+ "SECURITY.md"
13
14
  ],
14
15
  "scripts": {
15
16
  "build": "tsc && chmod +x build/index.js",
17
+ "test": "npm run build && node --test test/*.test.js",
16
18
  "prepublishOnly": "npm run build"
17
19
  },
18
20
  "keywords": [
@@ -36,12 +38,12 @@
36
38
  "node": ">=18"
37
39
  },
38
40
  "dependencies": {
39
- "@modelcontextprotocol/sdk": "^1.12.0",
40
- "zod": "^3.23.8"
41
+ "@modelcontextprotocol/sdk": "^1.31.0",
42
+ "zod": "3.25.76"
41
43
  },
42
44
  "devDependencies": {
43
- "@types/node": "^20.14.0",
44
- "typescript": "^5.6.0"
45
+ "@types/node": "^26.6.4",
46
+ "typescript": "5.9.3"
45
47
  },
46
48
  "mcpName": "com.mambabuilt/mcp-gtm-suite"
47
49
  }