findymail-mcp 0.1.11 → 0.1.13
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 +4 -1
- package/package.json +2 -2
- package/src/http.js +20 -39
- package/src/tools.js +44 -0
package/README.md
CHANGED
|
@@ -13,7 +13,9 @@ This MCP server exposes the following tools:
|
|
|
13
13
|
| `verify_email` | Verify if an email is deliverable |
|
|
14
14
|
| `enrich_company` | Get company data from domain, LinkedIn URL, or name |
|
|
15
15
|
| `reverse_email_lookup` | Find person info from an email |
|
|
16
|
+
| `lookalike_search` | Find similar companies from a seed domain using vector similarity |
|
|
16
17
|
| `generate_lead_list` | AI-powered lead list generation with natural language |
|
|
18
|
+
| `get_lead_list_results` | Retrieve results from a previously generated lead list |
|
|
17
19
|
|
|
18
20
|
## Prerequisites
|
|
19
21
|
|
|
@@ -89,7 +91,7 @@ In HTTP mode, each client passes their Findymail API key via the `Authorization`
|
|
|
89
91
|
|
|
90
92
|
```bash
|
|
91
93
|
claude mcp add findymail https://your-server.com/mcp -t http -H "Authorization: Bearer your-api-key"
|
|
92
|
-
claude mcp add findymail https://mcp.
|
|
94
|
+
claude mcp add findymail https://mcp.findymail.com/mcp -t http -H "Authorization: Bearer your-api-key"
|
|
93
95
|
```
|
|
94
96
|
|
|
95
97
|
#### Running the HTTP server
|
|
@@ -110,6 +112,7 @@ Once configured, you can ask your AI assistant:
|
|
|
110
112
|
- "Verify if john@example.com is a valid email"
|
|
111
113
|
- "Get company information for stripe.com"
|
|
112
114
|
- "Find me 10 marketing managers at SaaS companies in San Francisco"
|
|
115
|
+
- "Find companies similar to stripe.com in the same country"
|
|
113
116
|
|
|
114
117
|
## API Key
|
|
115
118
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "findymail-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "MCP server for Findymail - Find verified B2B emails, phone numbers, and company data",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/stdio.js",
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
"optionalDependencies": {
|
|
44
44
|
"express": "^5.0.0"
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
}
|
package/src/http.js
CHANGED
|
@@ -21,6 +21,7 @@ try {
|
|
|
21
21
|
|
|
22
22
|
const PORT = process.env.PORT || 3456;
|
|
23
23
|
const BASE_URL = process.env.BASE_URL || `http://localhost:${PORT}`;
|
|
24
|
+
const AUTH_SERVER = process.env.AUTH_SERVER || "https://app.findymail.com";
|
|
24
25
|
|
|
25
26
|
const app = express();
|
|
26
27
|
|
|
@@ -37,52 +38,29 @@ app.use((req, res, next) => {
|
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
// =============================================================================
|
|
40
|
-
// OAuth 2.0
|
|
41
|
+
// OAuth 2.0 discovery (RFC 8414 + RFC 9728)
|
|
42
|
+
// This server is an OAuth Protected Resource, not an Authorization Server.
|
|
43
|
+
// The real OAuth 2.1 infra (Passport, PKCE, DCR) runs on AUTH_SERVER.
|
|
41
44
|
// =============================================================================
|
|
42
45
|
|
|
43
|
-
app.get("/.well-known/oauth-
|
|
44
|
-
log("
|
|
46
|
+
app.get("/.well-known/oauth-protected-resource", (req, res) => {
|
|
47
|
+
log("Protected resource metadata requested");
|
|
45
48
|
res.json({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
token_endpoint: `${BASE_URL}/token`,
|
|
49
|
-
registration_endpoint: `${BASE_URL}/register`,
|
|
50
|
-
response_types_supported: ["code"],
|
|
51
|
-
grant_types_supported: ["authorization_code", "refresh_token"],
|
|
52
|
-
code_challenge_methods_supported: ["S256"],
|
|
53
|
-
token_endpoint_auth_methods_supported: ["none"],
|
|
49
|
+
resource: `${BASE_URL}/mcp`,
|
|
50
|
+
authorization_servers: [AUTH_SERVER],
|
|
54
51
|
});
|
|
55
52
|
});
|
|
56
53
|
|
|
57
|
-
app.
|
|
58
|
-
log(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
app.get("/authorize", (req, res) => {
|
|
68
|
-
log(`Authorization requested for client: ${req.query.client_id}`);
|
|
69
|
-
const code = `code_${Date.now()}`;
|
|
70
|
-
const redirectUri = new URL(req.query.redirect_uri);
|
|
71
|
-
redirectUri.searchParams.set("code", code);
|
|
72
|
-
if (req.query.state) {
|
|
73
|
-
redirectUri.searchParams.set("state", req.query.state);
|
|
54
|
+
app.get("/.well-known/oauth-authorization-server", async (req, res) => {
|
|
55
|
+
log(`OAuth metadata requested — proxying to ${AUTH_SERVER}`);
|
|
56
|
+
try {
|
|
57
|
+
const upstream = await fetch(`${AUTH_SERVER}/.well-known/oauth-authorization-server`);
|
|
58
|
+
const body = await upstream.json();
|
|
59
|
+
res.status(upstream.status).json(body);
|
|
60
|
+
} catch (error) {
|
|
61
|
+
log(`OAuth metadata proxy error: ${error.message}`);
|
|
62
|
+
res.status(502).json({ error: "Upstream authorization server metadata unavailable" });
|
|
74
63
|
}
|
|
75
|
-
log("Auto-approving authorization");
|
|
76
|
-
res.redirect(redirectUri.toString());
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
app.post("/token", (req, res) => {
|
|
80
|
-
log("Token exchange");
|
|
81
|
-
res.json({
|
|
82
|
-
access_token: `access_${Date.now()}`,
|
|
83
|
-
token_type: "Bearer",
|
|
84
|
-
expires_in: 3600,
|
|
85
|
-
});
|
|
86
64
|
});
|
|
87
65
|
|
|
88
66
|
// =============================================================================
|
|
@@ -105,12 +83,15 @@ function createMcpServer() {
|
|
|
105
83
|
// =============================================================================
|
|
106
84
|
|
|
107
85
|
app.use("/mcp", (req, res, next) => {
|
|
86
|
+
const wwwAuth = `Bearer resource_metadata="${BASE_URL}/.well-known/oauth-protected-resource"`;
|
|
108
87
|
const authHeader = req.headers.authorization;
|
|
109
88
|
if (!authHeader || !authHeader.startsWith("Bearer ")) {
|
|
89
|
+
res.set("WWW-Authenticate", wwwAuth);
|
|
110
90
|
return res.status(401).json({ error: "Authorization header with Bearer token is required" });
|
|
111
91
|
}
|
|
112
92
|
const token = authHeader.slice(7).trim();
|
|
113
93
|
if (!token) {
|
|
94
|
+
res.set("WWW-Authenticate", wwwAuth);
|
|
114
95
|
return res.status(401).json({ error: "Bearer token is empty" });
|
|
115
96
|
}
|
|
116
97
|
req.auth = { token, clientId: "", scopes: [] };
|
package/src/tools.js
CHANGED
|
@@ -145,6 +145,50 @@ export function registerTools(server) {
|
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
147
|
|
|
148
|
+
// ===========================================================================
|
|
149
|
+
// Tool: lookalike_search
|
|
150
|
+
// ===========================================================================
|
|
151
|
+
server.tool(
|
|
152
|
+
"lookalike_search",
|
|
153
|
+
"Find companies similar to a given seed company. Given a company domain (e.g. \"stripe.com\"), returns a list of lookalike companies that share similar business characteristics using semantic vector similarity search. Results can be filtered by same country and/or same company size. Exclusion lists can be provided to remove already-known companies from results. Costs 1 Finder credit per 10 results returned.",
|
|
154
|
+
{
|
|
155
|
+
seed: z.string().describe("The domain or URL of the seed company to find lookalikes for (e.g. \"stripe.com\" or \"https://www.stripe.com/pricing\"). URLs are automatically resolved to their root domain."),
|
|
156
|
+
same_country: z.boolean().optional().default(false).describe("When true, only return companies located in the same country as the seed company"),
|
|
157
|
+
same_size: z.boolean().optional().default(false).describe("When true, only return companies with a similar employee count range as the seed company"),
|
|
158
|
+
limit: z.number().optional().default(100).describe("Maximum number of results to return (min: 1, max: 10,000)"),
|
|
159
|
+
exclusion_list_ids: z.array(z.number()).optional().default([]).describe("IDs of exclusion lists whose domains should be removed from results"),
|
|
160
|
+
},
|
|
161
|
+
async (params, extra) => {
|
|
162
|
+
const {
|
|
163
|
+
seed,
|
|
164
|
+
same_country = false,
|
|
165
|
+
same_size = false,
|
|
166
|
+
limit = 100,
|
|
167
|
+
exclusion_list_ids = [],
|
|
168
|
+
} = params;
|
|
169
|
+
|
|
170
|
+
log(`lookalike_search: seed="${seed}" (limit: ${limit})`);
|
|
171
|
+
|
|
172
|
+
const validatedLimit = Math.min(Math.max(1, limit), 10000);
|
|
173
|
+
|
|
174
|
+
try {
|
|
175
|
+
const apiKey = resolveApiKey(extra);
|
|
176
|
+
|
|
177
|
+
const data = await apiPost("/lookalike/search", {
|
|
178
|
+
seed,
|
|
179
|
+
same_country,
|
|
180
|
+
same_size,
|
|
181
|
+
limit: validatedLimit,
|
|
182
|
+
exclusion_list_ids,
|
|
183
|
+
}, apiKey);
|
|
184
|
+
|
|
185
|
+
return formatResponse(data);
|
|
186
|
+
} catch (error) {
|
|
187
|
+
return formatError(error.message);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
|
|
148
192
|
// ===========================================================================
|
|
149
193
|
// Tool: generate_lead_list
|
|
150
194
|
// ===========================================================================
|