consulti-mcp 1.1.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 Consulti, Inc.
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,295 @@
1
+ # Consulti MCP Server
2
+
3
+ [![npm version](https://img.shields.io/npm/v/consulti-mcp.svg)](https://www.npmjs.com/package/consulti-mcp)
4
+ [![license](https://img.shields.io/npm/l/consulti-mcp.svg)](./LICENSE)
5
+
6
+ MCP server for the Consulti lead intelligence API — 11 tools to search 500M+ B2B leads, local businesses, and creators; verify emails; find and enrich leads; manage saved lists; and check your credit balance.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npx consulti-mcp
12
+ ```
13
+
14
+ ## Configuration
15
+
16
+ ### Claude Desktop
17
+
18
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
19
+
20
+ ```json
21
+ {
22
+ "mcpServers": {
23
+ "consulti": {
24
+ "command": "npx",
25
+ "args": ["-y", "consulti-mcp"],
26
+ "env": {
27
+ "CONSULTI_API_KEY": "your-api-key-here"
28
+ }
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ### Cursor
35
+
36
+ Add to `.cursor/mcp.json`:
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "consulti": {
42
+ "command": "npx",
43
+ "args": ["-y", "consulti-mcp"],
44
+ "env": {
45
+ "CONSULTI_API_KEY": "your-api-key-here"
46
+ }
47
+ }
48
+ }
49
+ }
50
+ ```
51
+
52
+ ## Tools
53
+
54
+ ### verify_email
55
+
56
+ Verify if an email address is valid and deliverable.
57
+
58
+ | Input | Type | Description |
59
+ | ------- | ------ | --------------------------- |
60
+ | `email` | string | The email address to verify |
61
+
62
+ **Example:**
63
+ ```json
64
+ { "email": "john@example.com" }
65
+ ```
66
+
67
+ ### find_lead_by_linkedin
68
+
69
+ Find and enrich a lead by their LinkedIn profile URL.
70
+
71
+ | Input | Type | Description |
72
+ | -------------- | ------ | ------------------------------------ |
73
+ | `linkedin_url` | string | The LinkedIn profile URL of the lead |
74
+
75
+ **Example:**
76
+ ```json
77
+ { "linkedin_url": "https://linkedin.com/in/johndoe" }
78
+ ```
79
+
80
+ ### find_lead_by_name
81
+
82
+ Find a lead's email by their name and company domain.
83
+
84
+ | Input | Type | Description |
85
+ | ------------ | ------ | ------------------------------------- |
86
+ | `first_name` | string | The lead's first name |
87
+ | `last_name` | string | The lead's last name |
88
+ | `domain` | string | The company domain (e.g. example.com) |
89
+
90
+ **Example:**
91
+ ```json
92
+ { "first_name": "John", "last_name": "Doe", "domain": "example.com" }
93
+ ```
94
+
95
+ ### enrich_lead
96
+
97
+ Enrich a lead's full profile using their email address.
98
+
99
+ | Input | Type | Description |
100
+ | ------- | ------ | --------------------------------------- |
101
+ | `email` | string | The email address of the lead to enrich |
102
+
103
+ **Example:**
104
+ ```json
105
+ { "email": "john@example.com" }
106
+ ```
107
+
108
+ ### search_b2b_leads
109
+
110
+ Search a database of 500M+ B2B leads with filters like job title, industry, location, and company size. All inputs are optional.
111
+
112
+ | Input | Type | Description |
113
+ | ---------------- | -------- | ------------------------------------------------------------------ |
114
+ | `q` | string | Free text search across name, title, company, and industry |
115
+ | `titles` | string[] | Job titles to filter by (e.g. ["CEO", "VP Marketing"]) |
116
+ | `industries` | string[] | Industries to filter by (e.g. ["Technology", "Finance"]) |
117
+ | `countries` | string[] | Countries to filter by (e.g. ["United States"]) |
118
+ | `states` | string[] | States/regions to filter by (e.g. ["California"]) |
119
+ | `cities` | string[] | Cities to filter by (e.g. ["San Francisco"]) |
120
+ | `company` | string | Company name to search for |
121
+ | `empMin` | number | Minimum employee count |
122
+ | `empMax` | number | Maximum employee count |
123
+ | `emailStatus` | string | One of `good`, `valid`, `risky`, `bad`, `invalid`, `unknown`, `verified`, `all` (default: `all`). `verified` is a legacy alias retained for backward compatibility. Canonical list: `GET https://www.consulti.ai/api/v1/meta/email-statuses` |
124
+ | `excludeListId` | string | UUID of a saved list owned by the API key holder — leads in this list will be excluded from results. Canonical singular field name; `exclude_list_id` and other variants return HTTP 400. |
125
+ | `page` | number | Page number (default: 1) |
126
+ | `size` | number | Results per page (default: 25, max: 100) |
127
+
128
+ > **Strict validation:** unknown fields in the request body return HTTP 400 with the offending field name. Send only the inputs documented above.
129
+ >
130
+ > **Response shape:** the response includes both `total` (size of the addressable set before `excludeListId` is applied) and `total_after_exclusion` (size after). When `excludeListId` is omitted, both values are equal. Clients can sanity-check exclusion by asserting `total_after_exclusion < total` whenever a non-empty list is supplied.
131
+
132
+ **Example:**
133
+ ```json
134
+ {
135
+ "titles": ["CEO", "CTO"],
136
+ "industries": ["Technology"],
137
+ "countries": ["United States"],
138
+ "empMin": 50,
139
+ "empMax": 500,
140
+ "emailStatus": "verified",
141
+ "excludeListId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
142
+ "size": 25
143
+ }
144
+ ```
145
+
146
+ ### search_local_leads
147
+
148
+ Search a database of local businesses scraped from Google Maps, with owner emails, ratings, and reviews. All inputs are optional.
149
+
150
+ | Input | Type | Description |
151
+ | ------------ | -------- | --------------------------------------------------------------- |
152
+ | `q` | string | Free text search across business name and category |
153
+ | `name` | string | Business name to search for |
154
+ | `keywords` | string[] | Keywords to match in name or category |
155
+ | `states` | string[] | US states (full name or abbreviation, e.g. ["California"] or ["CA"]) |
156
+ | `cities` | string[] | Cities to filter by |
157
+ | `zips` | string[] | ZIP codes to filter by |
158
+ | `ratingMin` | number | Minimum Google rating (0-5) |
159
+ | `ratingMax` | number | Maximum Google rating (0-5) |
160
+ | `reviewsMin` | number | Minimum number of Google reviews |
161
+ | `reviewsMax` | number | Maximum number of Google reviews |
162
+ | `hasEmail` | boolean | Only return businesses with a verified email |
163
+ | `hasPhone` | boolean | Only return businesses with a phone number |
164
+ | `hasWeb` | boolean | Only return businesses with a website |
165
+ | `page` | number | Page number (default: 1) |
166
+ | `size` | number | Results per page (default: 25, max: 100) |
167
+
168
+ **Example:**
169
+ ```json
170
+ {
171
+ "keywords": ["plumber"],
172
+ "states": ["California"],
173
+ "cities": ["Los Angeles"],
174
+ "ratingMin": 4.0,
175
+ "hasEmail": true,
176
+ "size": 25
177
+ }
178
+ ```
179
+
180
+ ### search_creator_leads
181
+
182
+ Search a database of 2.6M+ podcasts and 62K+ YouTube channels with contact emails.
183
+
184
+ | Input | Type | Description |
185
+ | ---------------- | -------- | -------------------------------------------------- |
186
+ | `source` | string | **Required.** Creator source: "youtube" or "podcast" |
187
+ | `q` | string | Free text search across creator name/description |
188
+ | `hasEmail` | boolean | Only return creators with an email |
189
+ | `categories` | string[] | Podcast categories to filter by |
190
+ | `niches` | string[] | YouTube niches to filter by |
191
+ | `country` | string | Country code (e.g. "US") |
192
+ | `language` | string | Podcast language code (e.g. "en") |
193
+ | `minSubscribers` | number | Minimum YouTube subscriber count |
194
+ | `maxSubscribers` | number | Maximum YouTube subscriber count |
195
+ | `minEpisodes` | number | Minimum podcast episode count |
196
+ | `page` | number | Page number (default: 1) |
197
+ | `size` | number | Results per page (default: 25, max: 100) |
198
+
199
+ **Example:**
200
+ ```json
201
+ {
202
+ "source": "youtube",
203
+ "niches": ["Technology"],
204
+ "hasEmail": true,
205
+ "minSubscribers": 10000,
206
+ "size": 25
207
+ }
208
+ ```
209
+
210
+ ### get_lists
211
+
212
+ Get all saved lead lists for the authenticated user, with member counts. No inputs required.
213
+
214
+ **Example:**
215
+ ```json
216
+ {}
217
+ ```
218
+
219
+ ### create_list
220
+
221
+ Create a new saved lead list.
222
+
223
+ | Input | Type | Description |
224
+ | ------------- | ------ | ---------------------------------- |
225
+ | `name` | string | **Required.** Name of the list |
226
+ | `description` | string | Optional description of the list |
227
+
228
+ **Example:**
229
+ ```json
230
+ { "name": "Tech CEOs", "description": "CEOs at tech companies with 50-500 employees" }
231
+ ```
232
+
233
+ ### add_leads_to_list
234
+
235
+ Add leads to a saved list by email addresses (B2B leads) or business IDs (local leads).
236
+
237
+ | Input | Type | Description |
238
+ | ------------- | -------- | -------------------------------------- |
239
+ | `listId` | string | **Required.** UUID of the target list |
240
+ | `emails` | string[] | Email addresses of B2B leads to add |
241
+ | `businessIds` | number[] | Business IDs of local leads to add |
242
+
243
+ **Example:**
244
+ ```json
245
+ {
246
+ "listId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
247
+ "emails": ["john@example.com", "jane@example.com"]
248
+ }
249
+ ```
250
+
251
+ ### get_credits
252
+
253
+ Check the authenticated user's current lead and verification credit balance. Free — no credits deducted. Use before bulk operations to avoid running out mid-task. No inputs required.
254
+
255
+ **Example:**
256
+ ```json
257
+ {}
258
+ ```
259
+
260
+ **Response shape:**
261
+ ```json
262
+ {
263
+ "success": true,
264
+ "data": {
265
+ "lead_credits": 1000,
266
+ "lead_rollover_credits": 0,
267
+ "verification_credits": 5000,
268
+ "total_lead_credits": 1000
269
+ }
270
+ }
271
+ ```
272
+
273
+ ## Get your API key
274
+
275
+ Sign up at [www.consulti.ai](https://www.consulti.ai) and generate an API key under **Settings → Integrations → API Keys**.
276
+
277
+ ## Environment variables
278
+
279
+ | Variable | Required | Default | Description |
280
+ | ------------------ | -------- | ----------------------------------- | --------------------------------------------------------------------------------- |
281
+ | `CONSULTI_API_KEY` | **Yes** | — | Your Consulti API key (starts with `capi_`). |
282
+ | `MCP_BASE_URL` | No | `https://www.consulti.ai/api/v1` | Override the API base URL. Only set this for staging / local dev — never in prod. |
283
+
284
+ The server enforces a 30-second timeout on every API request; timed-out calls return a structured `{"error": "Request timed out after 30s"}` so MCP clients can parse and retry.
285
+
286
+ ## Versioning
287
+
288
+ Print the installed version:
289
+
290
+ ```bash
291
+ npx -y consulti-mcp --version
292
+ # → 1.1.0
293
+ ```
294
+
295
+ Releases are published to npm via [GitHub Actions trusted publishing](https://docs.npmjs.com/trusted-publishers) on tags matching `mcp-v*` — each release carries an [npm provenance attestation](https://docs.npmjs.com/generating-provenance-statements).
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,277 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod";
5
+ const VERSION = "1.1.0";
6
+ if (process.argv.includes("--version") || process.argv.includes("-v")) {
7
+ console.log(VERSION);
8
+ process.exit(0);
9
+ }
10
+ const CONSULTI_API_KEY = process.env.CONSULTI_API_KEY;
11
+ if (!CONSULTI_API_KEY) {
12
+ console.error("Error: CONSULTI_API_KEY environment variable is required.");
13
+ process.exit(1);
14
+ }
15
+ const BASE_URL = process.env.MCP_BASE_URL || "https://www.consulti.ai/api/v1";
16
+ const USER_AGENT = `consulti-mcp/${VERSION}`;
17
+ const REQUEST_TIMEOUT_MS = 30_000;
18
+ async function apiPost(path, body) {
19
+ const controller = new AbortController();
20
+ const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
21
+ try {
22
+ const response = await fetch(`${BASE_URL}${path}`, {
23
+ method: "POST",
24
+ headers: {
25
+ "Authorization": `Bearer ${CONSULTI_API_KEY}`,
26
+ "Content-Type": "application/json",
27
+ "User-Agent": USER_AGENT,
28
+ },
29
+ body: JSON.stringify(body),
30
+ signal: controller.signal,
31
+ });
32
+ const data = await response.json();
33
+ if (!response.ok) {
34
+ const message = data?.error || data?.message || `API returned ${response.status}`;
35
+ return JSON.stringify({ error: message }, null, 2);
36
+ }
37
+ return JSON.stringify(data, null, 2);
38
+ }
39
+ catch (error) {
40
+ if (error instanceof Error && error.name === "AbortError") {
41
+ return JSON.stringify({ error: `Request timed out after ${REQUEST_TIMEOUT_MS / 1000}s` }, null, 2);
42
+ }
43
+ const message = error instanceof Error ? error.message : "Unknown error";
44
+ return JSON.stringify({ error: `Request failed: ${message}` }, null, 2);
45
+ }
46
+ finally {
47
+ clearTimeout(timer);
48
+ }
49
+ }
50
+ async function apiGet(path) {
51
+ const controller = new AbortController();
52
+ const timer = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
53
+ try {
54
+ const response = await fetch(`${BASE_URL}${path}`, {
55
+ method: "GET",
56
+ headers: {
57
+ "Authorization": `Bearer ${CONSULTI_API_KEY}`,
58
+ "User-Agent": USER_AGENT,
59
+ },
60
+ signal: controller.signal,
61
+ });
62
+ const data = await response.json();
63
+ if (!response.ok) {
64
+ const message = data?.error || data?.message || `API returned ${response.status}`;
65
+ return JSON.stringify({ error: message }, null, 2);
66
+ }
67
+ return JSON.stringify(data, null, 2);
68
+ }
69
+ catch (error) {
70
+ if (error instanceof Error && error.name === "AbortError") {
71
+ return JSON.stringify({ error: `Request timed out after ${REQUEST_TIMEOUT_MS / 1000}s` }, null, 2);
72
+ }
73
+ const message = error instanceof Error ? error.message : "Unknown error";
74
+ return JSON.stringify({ error: `Request failed: ${message}` }, null, 2);
75
+ }
76
+ finally {
77
+ clearTimeout(timer);
78
+ }
79
+ }
80
+ const server = new McpServer({
81
+ name: "consulti-mcp",
82
+ version: VERSION,
83
+ });
84
+ server.tool("verify_email", "Verify if an email address is valid and deliverable", { email: z.string().describe("The email address to verify") }, async ({ email }) => ({
85
+ content: [{ type: "text", text: await apiPost("/verify", { email }) }],
86
+ }));
87
+ server.tool("find_lead_by_linkedin", "Find and enrich a lead by their LinkedIn profile URL", { linkedin_url: z.string().describe("The LinkedIn profile URL of the lead") }, async ({ linkedin_url }) => ({
88
+ content: [{ type: "text", text: await apiPost("/leads/find-by-linkedin", { linkedin_url }) }],
89
+ }));
90
+ server.tool("find_lead_by_name", "Find a lead's email by their name and company domain", {
91
+ first_name: z.string().describe("The lead's first name"),
92
+ last_name: z.string().describe("The lead's last name"),
93
+ domain: z.string().describe("The company domain (e.g. example.com)"),
94
+ }, async ({ first_name, last_name, domain }) => ({
95
+ content: [{ type: "text", text: await apiPost("/leads/find-by-name", { first_name, last_name, domain }) }],
96
+ }));
97
+ server.tool("enrich_lead", "Enrich a lead's full profile using their email address", { email: z.string().describe("The email address of the lead to enrich") }, async ({ email }) => ({
98
+ content: [{ type: "text", text: await apiPost("/leads/enrich", { email }) }],
99
+ }));
100
+ server.tool("search_b2b_leads", "Search a database of 500M+ B2B leads with filters like job title, industry, location, and company size", {
101
+ q: z.string().optional().describe("Free text search across name, title, company, and industry"),
102
+ titles: z.array(z.string()).optional().describe("Job titles to filter by (e.g. [\"CEO\", \"VP Marketing\"])"),
103
+ industries: z.array(z.string()).optional().describe("Industries to filter by (case-sensitive exact match). Get the canonical list: GET https://www.consulti.ai/api/v1/meta/industries"),
104
+ countries: z.array(z.string()).optional().describe("Countries to filter by (exact match). Canonical list: GET https://www.consulti.ai/api/v1/meta/countries"),
105
+ states: z.array(z.string()).optional().describe("States/regions to filter by (exact match). Canonical list: GET https://www.consulti.ai/api/v1/meta/states"),
106
+ cities: z.array(z.string()).optional().describe("Cities to filter by (e.g. [\"San Francisco\", \"London\"])"),
107
+ company: z.string().optional().describe("Company name to search for"),
108
+ empMin: z.number().optional().describe("Minimum employee count"),
109
+ empMax: z.number().optional().describe("Maximum employee count"),
110
+ emailStatus: z.enum(["good", "valid", "risky", "bad", "invalid", "unknown", "verified", "all"]).optional().describe("Filter by email verification status. 'all' (default) returns every status. 'verified' is a legacy alias retained for backward compatibility. Canonical list: GET https://www.consulti.ai/api/v1/meta/email-statuses"),
111
+ excludeListId: z.string().optional().describe("UUID of a saved list owned by the API key holder — leads in this list will be excluded from results. Response includes both `total` (pre-exclusion) and `total_after_exclusion` (post) so the caller can verify exclusion fired."),
112
+ page: z.number().optional().describe("Page number (default: 1)"),
113
+ size: z.number().optional().describe("Results per page (default: 25, max: 100)"),
114
+ }, async (params) => {
115
+ const body = {};
116
+ if (params.q)
117
+ body.q = params.q;
118
+ if (params.titles)
119
+ body.titles = params.titles;
120
+ if (params.industries)
121
+ body.industries = params.industries;
122
+ if (params.countries)
123
+ body.countries = params.countries;
124
+ if (params.states)
125
+ body.states = params.states;
126
+ if (params.cities)
127
+ body.cities = params.cities;
128
+ if (params.company)
129
+ body.company = params.company;
130
+ if (params.empMin !== undefined)
131
+ body.empMin = params.empMin;
132
+ if (params.empMax !== undefined)
133
+ body.empMax = params.empMax;
134
+ if (params.emailStatus)
135
+ body.emailStatus = params.emailStatus;
136
+ if (params.excludeListId)
137
+ body.excludeListId = params.excludeListId;
138
+ if (params.page !== undefined)
139
+ body.page = params.page;
140
+ if (params.size !== undefined)
141
+ body.size = params.size;
142
+ return {
143
+ content: [{ type: "text", text: await apiPost("/leads/search", body) }],
144
+ };
145
+ });
146
+ server.tool("search_local_leads", "Search a database of local businesses scraped from Google Maps, with owner emails, ratings, and reviews", {
147
+ q: z.string().optional().describe("Free text search across business name and category"),
148
+ name: z.string().optional().describe("Business name to search for"),
149
+ keywords: z.array(z.string()).optional().describe("Keywords to match in name or category"),
150
+ states: z.array(z.string()).optional().describe("US states. Accepts full names (e.g. [\"California\"]) or 2-letter abbreviations (e.g. [\"CA\"]). Canonical 2-letter list: GET https://www.consulti.ai/api/v1/meta/local-states"),
151
+ cities: z.array(z.string()).optional().describe("Cities to filter by"),
152
+ zips: z.array(z.string()).optional().describe("ZIP codes to filter by"),
153
+ ratingMin: z.number().optional().describe("Minimum Google rating (0-5)"),
154
+ ratingMax: z.number().optional().describe("Maximum Google rating (0-5)"),
155
+ reviewsMin: z.number().optional().describe("Minimum number of Google reviews"),
156
+ reviewsMax: z.number().optional().describe("Maximum number of Google reviews"),
157
+ hasEmail: z.boolean().optional().describe("Only return businesses with a verified email"),
158
+ hasPhone: z.boolean().optional().describe("Only return businesses with a phone number"),
159
+ hasWeb: z.boolean().optional().describe("Only return businesses with a website"),
160
+ page: z.number().optional().describe("Page number (default: 1)"),
161
+ size: z.number().optional().describe("Results per page (default: 25, max: 100)"),
162
+ }, async (params) => {
163
+ const body = {};
164
+ if (params.q)
165
+ body.q = params.q;
166
+ if (params.name)
167
+ body.name = params.name;
168
+ if (params.keywords)
169
+ body.keywords = params.keywords;
170
+ if (params.states)
171
+ body.states = params.states;
172
+ if (params.cities)
173
+ body.cities = params.cities;
174
+ if (params.zips)
175
+ body.zips = params.zips;
176
+ if (params.ratingMin !== undefined)
177
+ body.ratingMin = params.ratingMin;
178
+ if (params.ratingMax !== undefined)
179
+ body.ratingMax = params.ratingMax;
180
+ if (params.reviewsMin !== undefined)
181
+ body.reviewsMin = params.reviewsMin;
182
+ if (params.reviewsMax !== undefined)
183
+ body.reviewsMax = params.reviewsMax;
184
+ if (params.hasEmail !== undefined)
185
+ body.hasEmail = params.hasEmail;
186
+ if (params.hasPhone !== undefined)
187
+ body.hasPhone = params.hasPhone;
188
+ if (params.hasWeb !== undefined)
189
+ body.hasWeb = params.hasWeb;
190
+ if (params.page !== undefined)
191
+ body.page = params.page;
192
+ if (params.size !== undefined)
193
+ body.size = params.size;
194
+ return {
195
+ content: [{ type: "text", text: await apiPost("/local-leads/search", body) }],
196
+ };
197
+ });
198
+ server.tool("search_creator_leads", "Search a database of 2.6M+ podcasts and 62K+ YouTube channels with contact emails", {
199
+ source: z.enum(["youtube", "podcast"]).describe("Creator source: 'youtube' or 'podcast'"),
200
+ q: z.string().optional().describe("Free text search across creator name/description"),
201
+ hasEmail: z.boolean().optional().describe("Only return creators with an email"),
202
+ categories: z.array(z.string()).optional().describe("Podcast categories to filter by (exact match against the categories[] array). Canonical list: GET https://www.consulti.ai/api/v1/meta/creator-podcast-categories"),
203
+ niches: z.array(z.string()).optional().describe("YouTube niches to filter by (fuzzy ILIKE match). Common values: GET https://www.consulti.ai/api/v1/meta/creator-youtube-niches"),
204
+ country: z.string().optional().describe("YouTube country — comma-separated ISO codes (e.g. 'US' or 'US,GB'). Canonical list: GET https://www.consulti.ai/api/v1/meta/creator-countries"),
205
+ language: z.string().optional().describe("Podcast language code (e.g. 'en'). Canonical list: GET https://www.consulti.ai/api/v1/meta/creator-languages"),
206
+ minSubscribers: z.number().optional().describe("Minimum YouTube subscriber count"),
207
+ maxSubscribers: z.number().optional().describe("Maximum YouTube subscriber count"),
208
+ minEpisodes: z.number().optional().describe("Minimum podcast episode count"),
209
+ page: z.number().optional().describe("Page number (default: 1)"),
210
+ size: z.number().optional().describe("Results per page (default: 25, max: 100)"),
211
+ }, async (params) => {
212
+ const body = { source: params.source };
213
+ if (params.q)
214
+ body.q = params.q;
215
+ if (params.hasEmail !== undefined)
216
+ body.hasEmail = params.hasEmail;
217
+ if (params.categories)
218
+ body.categories = params.categories;
219
+ if (params.niches)
220
+ body.niches = params.niches;
221
+ if (params.country)
222
+ body.country = params.country;
223
+ if (params.language)
224
+ body.language = params.language;
225
+ if (params.minSubscribers !== undefined)
226
+ body.minSubscribers = params.minSubscribers;
227
+ if (params.maxSubscribers !== undefined)
228
+ body.maxSubscribers = params.maxSubscribers;
229
+ if (params.minEpisodes !== undefined)
230
+ body.minEpisodes = params.minEpisodes;
231
+ if (params.page !== undefined)
232
+ body.page = params.page;
233
+ if (params.size !== undefined)
234
+ body.size = params.size;
235
+ return {
236
+ content: [{ type: "text", text: await apiPost("/creator-leads/search", body) }],
237
+ };
238
+ });
239
+ server.tool("get_lists", "Get all saved lead lists for the authenticated user, with member counts", {}, async () => ({
240
+ content: [{ type: "text", text: await apiGet("/lists") }],
241
+ }));
242
+ server.tool("create_list", "Create a new saved lead list", {
243
+ name: z.string().describe("Name of the list"),
244
+ description: z.string().optional().describe("Optional description of the list"),
245
+ }, async ({ name, description }) => {
246
+ const body = { name };
247
+ if (description)
248
+ body.description = description;
249
+ return {
250
+ content: [{ type: "text", text: await apiPost("/lists", body) }],
251
+ };
252
+ });
253
+ server.tool("add_leads_to_list", "Add leads to a saved list by email addresses (B2B leads) or business IDs (local leads)", {
254
+ listId: z.string().describe("UUID of the target list"),
255
+ emails: z.array(z.string()).optional().describe("Email addresses of B2B leads to add"),
256
+ businessIds: z.array(z.number()).optional().describe("Business IDs of local leads to add"),
257
+ }, async ({ listId, emails, businessIds }) => {
258
+ const body = {};
259
+ if (emails)
260
+ body.emails = emails;
261
+ if (businessIds)
262
+ body.businessIds = businessIds;
263
+ return {
264
+ content: [{ type: "text", text: await apiPost(`/lists/${listId}/add-leads`, body) }],
265
+ };
266
+ });
267
+ server.tool("get_credits", "Check the authenticated user's current lead and verification credit balance. Free — no credits deducted. Use before bulk operations to avoid running out mid-task.", {}, async () => ({
268
+ content: [{ type: "text", text: await apiGet("/credits") }],
269
+ }));
270
+ async function main() {
271
+ const transport = new StdioServerTransport();
272
+ await server.connect(transport);
273
+ }
274
+ main().catch((error) => {
275
+ console.error("Fatal error:", error);
276
+ process.exit(1);
277
+ });
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "consulti-mcp",
3
+ "version": "1.1.0",
4
+ "description": "Consulti.ai MCP server — 11 tools for lead enrichment, email verification, credit-balance checks, and B2B/local/creator database search across Claude Desktop, Cursor, and any MCP-compatible client.",
5
+ "type": "module",
6
+ "bin": {
7
+ "consulti-mcp": "dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "dev": "tsx src/index.ts",
17
+ "prepublishOnly": "npm run build"
18
+ },
19
+ "keywords": [
20
+ "mcp",
21
+ "model-context-protocol",
22
+ "consulti",
23
+ "lead-enrichment",
24
+ "email-verification",
25
+ "b2b"
26
+ ],
27
+ "homepage": "https://www.consulti.ai/api-docs",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/leadgenjay/consulti.git",
31
+ "directory": "mcp"
32
+ },
33
+ "bugs": {
34
+ "url": "https://github.com/leadgenjay/consulti/issues"
35
+ },
36
+ "license": "MIT",
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^1.12.1",
39
+ "zod": "^3.24.1"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^22.15.2",
43
+ "tsx": "^4.19.4",
44
+ "typescript": "^5.8.3"
45
+ }
46
+ }