findymail-mcp 0.1.12 → 0.1.14

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
@@ -9,6 +9,7 @@ This MCP server exposes the following tools:
9
9
  | Tool | Description |
10
10
  |------|-------------|
11
11
  | `find_email` | Find verified B2B email from name + domain or LinkedIn URL |
12
+ | `find_employees` | Find employees at a company by job title — returns name + LinkedIn URL only (no email), 1 finder credit per contact |
12
13
  | `find_phone` | Find phone number(s) from LinkedIn URL |
13
14
  | `verify_email` | Verify if an email is deliverable |
14
15
  | `enrich_company` | Get company data from domain, LinkedIn URL, or name |
@@ -108,6 +109,7 @@ Requests to `/mcp` without a valid `Authorization: Bearer <token>` header will b
108
109
  Once configured, you can ask your AI assistant:
109
110
 
110
111
  - "Find the email for John Smith at Acme Corp"
112
+ - "Find 3 sales managers at stripe.com and get their emails"
111
113
  - "What's the phone number for the CEO of findymail.com?"
112
114
  - "Verify if john@example.com is a valid email"
113
115
  - "Get company information for stripe.com"
@@ -134,6 +136,10 @@ npm install
134
136
  FINDYMAIL_API_KEY=your-key npm start
135
137
  ```
136
138
 
139
+ ## Deployment
140
+
141
+ See [PUBLISHING.md](PUBLISHING.md) for the npm release process.
142
+
137
143
  ## License
138
144
 
139
145
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "findymail-mcp",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
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 endpoints (required for HTTP transport)
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-authorization-server", (req, res) => {
44
- log("OAuth metadata requested");
46
+ app.get("/.well-known/oauth-protected-resource", (req, res) => {
47
+ log("Protected resource metadata requested");
45
48
  res.json({
46
- issuer: BASE_URL,
47
- authorization_endpoint: `${BASE_URL}/authorize`,
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.post("/register", (req, res) => {
58
- log("Client registration");
59
- const clientId = `client_${Date.now()}`;
60
- res.status(201).json({
61
- client_id: clientId,
62
- client_id_issued_at: Math.floor(Date.now() / 1000),
63
- redirect_uris: req.body?.redirect_uris || [],
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
@@ -44,6 +44,38 @@ export function registerTools(server) {
44
44
  }
45
45
  );
46
46
 
47
+ // ===========================================================================
48
+ // Tool: find_employees
49
+ // ===========================================================================
50
+ server.tool(
51
+ "find_employees",
52
+ "Find employees at a company by job title. Given a company website/domain and target job titles, returns a list of matching contacts with name, job title, company, and LinkedIn URL. IMPORTANT: this tool does NOT return email addresses (by design) — chain it with `find_email` (using the returned name + domain, or the LinkedIn URL) to get a verified email. Costs 1 finder credit per contact returned.",
53
+ {
54
+ website: z.string().describe("Company website or domain (e.g., \"findymail.com\")"),
55
+ job_titles: z.array(z.string()).describe("Target job titles (max 10, each max 50 characters, e.g., [\"CTO\", \"VP Engineering\"])"),
56
+ count: z.number().optional().default(1).describe("Number of contacts to return (min: 1, max: 5, default: 1)"),
57
+ },
58
+ async ({ website, job_titles, count = 1 }, extra) => {
59
+ log(`find_employees: website="${website}" job_titles=${JSON.stringify(job_titles)} count=${count}`);
60
+
61
+ const validatedCount = Math.min(Math.max(1, count), 5);
62
+
63
+ try {
64
+ const apiKey = resolveApiKey(extra);
65
+
66
+ const data = await apiPost("/search/employees", {
67
+ website,
68
+ job_titles,
69
+ count: validatedCount,
70
+ }, apiKey);
71
+
72
+ return formatResponse(data);
73
+ } catch (error) {
74
+ return formatError(error.message);
75
+ }
76
+ }
77
+ );
78
+
47
79
  // ===========================================================================
48
80
  // Tool: find_phone
49
81
  // ===========================================================================