# π LeadMagic MCP Server
<div align="center">

**β‘ The Ultimate Model Context Protocol Server for B2B Data Enrichment**
*Seamlessly integrate LeadMagic's complete API suite with Claude, Cursor, Windsurf, and all MCP-compatible AI tools*
[](https://www.npmjs.com/package/leadmagic-mcp-server)
[](https://www.npmjs.com/package/leadmagic-mcp-server)
[](https://opensource.org/licenses/MIT)
[](https://nodejs.org/)
[](https://www.typescriptlang.org/)
[](https://modelcontextprotocol.io)
[](https://github.com/LeadMagic/leadmagic-mcp)
[](https://github.com/LeadMagic/leadmagic-mcp/security)
[](https://github.com/LeadMagic/leadmagic-mcp/stargazers)
[](https://github.com/LeadMagic/leadmagic-mcp/issues)
[](https://github.com/LeadMagic/leadmagic-mcp/network/members)
[](https://github.com/LeadMagic/leadmagic-mcp/commits/main)
---
**π― 19 Powerful Tools β’ π₯ Zero Configuration β’ β‘ One-Line Setup β’ π‘οΈ Enterprise Security**
</div>
---
## π Table of Contents
- [π Super Easy Installation](#-super-easy-installation)
- [π οΈ Available Tools](#οΈ-available-tools)
- [π‘ Usage Examples](#-usage-examples)
- [π Supported MCP Clients](#-supported-mcp-clients)
- [π§ Development Setup](#-development-setup)
- [ποΈ Architecture](#οΈ-architecture)
- [π API Reference](#-api-reference)
- [π Security & Best Practices](#-security--best-practices)
- [π― Installation Matrix](#-installation-matrix)
- [π€ Support & Resources](#-support--resources)
- [π License](#-license)
- [πββοΈ Contributing](#οΈ-contributing)
- [π Updates & Changelog](#-updates--changelog)
---
> π― **Access all 19 LeadMagic API endpoints through the Model Context Protocol for seamless integration with Claude, Cursor, Windsurf, Continue.dev, and other MCP-compatible AI tools.**
## π Super Easy Installation
### β‘ Option 1: Interactive Installer (Recommended)
The easiest way to get started - works on **macOS**, **Windows**, and **Linux**. Our new interactive installer, built with React and Ink, makes setup a breeze.
```bash
# π₯ Using npx (no installation required)
npx leadmagic-mcp-server install
```
**β¨ The installer will:**
- β
**Validate your API key** in real-time and show your remaining credits.
- β
Automatically detect and configure your preferred AI tool (Claude, Cursor, VS Code, etc.).
- β
Create all necessary config files and a local `.env` for development.
- β
Provide usage examples and helpful links.
### π± Option 2: Quick Manual Setup
If you prefer manual setup or are using a client like **Aider**, you can add the server configuration directly to your client's settings file. The interactive installer provides copy-pasteable snippets for this.
Run the installer and choose the "Other (Manual Setup)" option:
```bash
npx leadmagic-mcp-server install
```
### π Get Your API Key
1. π Visit [LeadMagic Dashboard](https://app.leadmagic.io/dashboard/api-keys)
2. π Sign up for free (if needed)
3. π Generate your API key
4. π Paste it into the interactive installer when prompted.
### β‘ npx Usage (Zero Installation)
You can use the server without installing, which is great for quick tests or containerized environments:
```bash
# π Run directly with your API key
LEADMAGIC_API_KEY=your-key npx leadmagic-mcp-server
# π Run the interactive installer
npx leadmagic-mcp-server install
# β Check available commands
npx leadmagic-mcp-server --help
```
---
## π οΈ Available Tools
### π Core Operations (3 tools)
- π³ `get_credits` - Check API credit balance
- β
`validate_email` - Validate email deliverability and get company info
- π§ `find_email` - Find verified email addresses by name and company
### π’ Profile & Company Intelligence (5 tools)
- π€ `search_profile` - Get full B2B profile details (300 req/min)
- π `search_company` - Search companies by domain, name, or profile URL
- π± `find_mobile` - Find mobile phone numbers from profiles/emails
- π `email_to_profile` - Find B2B profile URLs from work emails
- π° `get_company_funding` - Get funding, financials, and competitor data
### βοΈ Advanced Email Finding (2 tools)
- π¨ `find_personal_email` - Find personal emails from B2B profiles
- π `social_to_work_email` - Find work emails from social profiles
### πΌ Job & Employee Intelligence (5 tools)
- π `find_jobs` - Search job postings with advanced filters
- π `find_role` - Find specific roles within companies
- π₯ `find_employees` - Find employees of specific companies
- π `get_job_countries` - Get available job search countries
- π `get_job_types` - Get available job types for filtering
### π± Advertisement Intelligence (4 tools)
- π `search_google_ads` - Search Google Ads by company
- π `search_meta_ads` - Search Meta (Facebook/Instagram) Ads
- π `search_b2b_ads` - Search B2B advertising campaigns
- π `get_b2b_ad_details` - Get detailed B2B ad information
---
## π‘ Usage Examples
Once installed, you can use natural language commands in your AI tool:
### π§ Email Operations
```
"Find the email for John Doe at Microsoft"
"Validate the email john@acme.com"
"Find personal email for B2B profile https://linkedin.com/in/johndoe"
```
### π’ Company Intelligence
```
"Search for Tesla company information"
"Get funding information for Stripe"
"Find employees at OpenAI who work in engineering"
```
### πΌ Job & Recruitment
```
"Find software engineer jobs at tech companies"
"Search for product manager roles in San Francisco"
"Find mobile number for this B2B profile"
```
### π± Competitive Analysis
```
"Search for Google Ads from competitor.com"
"Find Meta ads for company XYZ"
"Get B2B advertising campaigns for stripe.com"
```
---
## π§ Development Setup
### π Prerequisites
- π¦ Node.js 18.0.0 or higher
- π LeadMagic API key from [leadmagic.io](https://leadmagic.io)
### π» Local Development
```bash
# π₯ Clone the repository
git clone https://github.com/LeadMagic/leadmagic-mcp.git
cd leadmagic-mcp
# π¦ Install dependencies
npm install
# π Create environment file
echo "LEADMAGIC_API_KEY=your-api-key-here" > .env
# π Start development server
npm run dev
# ποΈ Build for production
npm run build
# β
Run validation
npm run validate
```
### π Testing with MCP Inspector
```bash
# π Start the MCP inspector
npm run inspector
# π Open the provided URL in your browser to test all tools
```
---
## π Supported MCP Clients
| Client | Installation | Status | Notes |
|--------|-------------|--------|-------|
| π€ **Claude Desktop** | Interactive installer or manual config | β
Fully Supported | Official Anthropic client |
| π― **Cursor (Cline)** | Interactive installer or VS Code settings | β
Fully Supported | Requires Cline extension |
| π **Windsurf** | Interactive installer or manual config | β
Fully Supported | Codeium's AI IDE |
| π **Continue.dev** | Interactive installer or config file | β
Fully Supported | Open source coding assistant |
| π» **VS Code (Cline)** | VS Code settings.json | β
Fully Supported | Requires Cline extension |
| π» **VS Code (Continue)** | Continue extension config | β
Fully Supported | Requires Continue extension |
| β‘ **Zed Editor** | Interactive installer or settings | β
Fully Supported | Modern code editor |
| π€ **Aider** | Manual Configuration | β
Supported | AI pair programming in your terminal |
| β¨ **Augment Code** | Manual Configuration | β
Supported | AI coding assistant |
| π **Any MCP Client** | Manual configuration | β
Supported | Standard MCP protocol |
---
## ποΈ Architecture
### π οΈ Technology Stack
- β‘ **Runtime**: Node.js 18+
- π **Language**: TypeScript with strict type checking
- π **MCP SDK**: @modelcontextprotocol/sdk v1.0.0+
- π **HTTP Client**: Axios with comprehensive error handling
- β
**Validation**: Zod schemas for all API inputs/outputs
- π§ **Development**: ESLint, Prettier, Jest for testing
### π Project Structure
```
βββ src/
β βββ index.ts # π Main entry point and CLI command handling
β βββ server.ts # π MCP server implementation with all 19 tools
β βββ client.ts # π LeadMagic API client wrapper
β βββ types.ts # π TypeScript types and Zod schemas
β βββ install.tsx # π¨ The new interactive installer (React/Ink)
βββ dist/ # π¦ Compiled JavaScript output
βββ .env.example # π Environment configuration example
βββ README.md # π This file
```
---
## π API Reference
### π€ Field Naming Convention
**All fields use snake_case** (matching LeadMagic API):
```json
{
"first_name": "John",
"company_name": "Acme Corp",
"email_status": "valid"
}
```
### π Authentication
Include your API key in requests:
```bash
X-API-Key: your-leadmagic-api-key
```
### β±οΈ Rate Limits
- π€ **Profile Search**: 300 requests/minute
- π **Other endpoints**: Standard rate limits apply
### β Error Handling
Consistent error format across all endpoints:
```json
{
"error": "Bad Request",
"message": "API key is missing or invalid."
}
```
---
## π Credit Consumption
| Endpoint | Credits | Notes |
|----------|---------|--------|
| π³ `/credits` | 0 | Free to check |
| β
`/email-validate` | 0.05 | Very cost-effective |
| π§ `/email-finder` | 1 | Standard rate |
| π± `/mobile-finder` | 5 | Only if found |
| π€ `/profile-search` | 1 | Rate limited (300/min) |
| π `/b2b-profile` | 10 | Higher cost for reverse lookup |
| π° `/company-funding` | 4 | Premium intelligence |
| πΌ `/jobs-finder` | 1 per job | Based on results |
| π `/google/searchads` | 1 per ad | Based on ads found |
| π All others | 1-2 | Standard rates |
---
## π Security & Best Practices
β
**No API keys in code** - Always use environment variables
β
**Type-safe requests** - Full TypeScript coverage with Zod validation
β
**Error handling** - Comprehensive error catching and user-friendly messages
β
**Rate limiting** - Respects LeadMagic API rate limits
β
**Secure defaults** - Production-ready configuration out of the box
β
**Interactive installer** - No manual config file editing required
---
## π― Installation Matrix
Choose your installation method based on your setup:
| Scenario | Command | Best For |
|----------|---------|----------|
| π **First time user** | `npx leadmagic-mcp-server install` | Easiest setup |
| π€ **Claude Desktop** | Interactive installer β Option 1 | Most popular |
| π― **Cursor/VS Code** | Interactive installer β Option 2/5 | Developers |
| π **Multiple clients** | Interactive installer β Option 7 | Power users |
| β‘ **Quick test** | `LEADMAGIC_API_KEY=key npx leadmagic-mcp-server` | Testing |
| π» **Local development** | Clone repo + `.env` file | Contributors |
---
## π€ Support & Resources
- π **API Documentation**: [docs.leadmagic.io](https://docs.leadmagic.io)
- π **Official Website**: [leadmagic.io](https://leadmagic.io)
- π **Dashboard**: [app.leadmagic.io](https://app.leadmagic.io)
- π **Support**: support@leadmagic.io
- π **Issues**: [GitHub Issues](https://github.com/LeadMagic/leadmagic-mcp/issues)
- π¬ **Community**: [Join our Discord](https://discord.gg/leadmagic)
- π **Source Code**: [GitHub Repository](https://github.com/LeadMagic/leadmagic-mcp)
---
## π License
MIT License - see the [LICENSE](LICENSE) file for details.
---
## πββοΈ Contributing
We welcome contributions! Here's how to get started:
1. π΄ Fork the repository
2. πΏ Create a feature branch: `git checkout -b feature/new-feature`
3. β¨ Make your changes and add tests
4. β
Run validation: `npm run validate`
5. πΎ Commit your changes: `git commit -am 'Add new feature'`
6. π€ Push to the branch: `git push origin feature/new-feature`
7. π Submit a pull request
### π Bug Reports
Found a bug? Please [open an issue](https://github.com/LeadMagic/leadmagic-mcp/issues/new?assignees=&labels=bug&template=bug_report.md&title=) with:
- π Clear description of the issue
- π Steps to reproduce
- π» Your environment details
- π Expected vs actual behavior
### π‘ Feature Requests
Have an idea? [Request a feature](https://github.com/LeadMagic/leadmagic-mcp/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=) with:
- π Clear description of the feature
- π― Use case and benefits
- π Any implementation ideas
---
## π Updates & Changelog
### v1.0.1 (Latest) - June 27, 2025
- π¨ Redesigned README with professional and impactful header
- π¦ Enhanced package.json with better description and keywords
- π― Improved branding and visual presentation
- π§ Documentation polish and terminology consistency
- π·οΈ Added enhanced badges with security verification
- π Overall professional presentation improvements
### v1.0.0 - June 27, 2025
- β¨ Interactive installer for all major AI tools
- β
Support for Claude Desktop, Cursor, Windsurf, Continue.dev, VS Code, Zed
- π§ All 19 LeadMagic API endpoints implemented
- π― Zero-config npx usage
- π Enhanced security and error handling
- π Comprehensive documentation
[View complete changelog](CHANGELOG.md)
---
<div align="center">
**π Built with the [official LeadMagic OpenAPI specification](https://github.com/LeadMagic/leadmagic-openapi) for 100% API accuracy**
---
### π Star us on GitHub β’ π Report Issues β’ π‘ Request Features
[](https://github.com/LeadMagic/leadmagic-mcp)
[](https://www.npmjs.com/package/leadmagic-mcp-server)
[](https://discord.gg/leadmagic)
**Made with β€οΈ by the LeadMagic team**
</div>