Inbound Lead Generation MCP server

Automates lead generation and enrichment by combining Google CSE discovery, Hunter.io and Clearbit data enrichment, and LinkedIn scraping into a unified API with Redis caching and asynchronous processing for high concurrency.
Back to servers
Setup instructions
Provider
Bashir Kobo
Release date
Mar 01, 2025
Language
Python
Stats
7 stars

This MCP server provides powerful lead generation capabilities using the MCP SDK and Crawl4AI for intelligent web crawling. It enables a complete lead lifecycle from discovery to enrichment with features like UUID-based tracking, multi-source aggregation, and enterprise-grade error handling.

Prerequisites

Before installation, ensure you have:

  • Python 3.10 or higher
  • The following API keys set as environment variables:
    export HUNTER_API_KEY="your_key"
    export CLEARBIT_API_KEY="your_key"
    export GOOGLE_CSE_ID="your_id"
    export GOOGLE_API_KEY="your_key"
    
  • LinkedIn Session Cookie (if using scraping features)
  • Minimum 4GB RAM (8GB recommended for heavy scraping)

Installation

Standard Setup

# Create virtual environment
python -m venv .venv && source .venv/activate

# Install required dependencies
pip install mcp crawl4ai[all] aiocache aiohttp uvloop

# Set up browser dependencies for scraping
python -m playwright install chromium

Docker Installation

FROM python:3.10-slim

RUN apt-get update && apt-get install -y \
    gcc \
    libpython3-dev \
    chromium \
    && rm -rf /var/lib/apt/lists/*

COPY . /app
WORKDIR /app

RUN pip install --no-cache-dir -r requirements.txt
CMD ["python", "-m", "mcp", "run", "lead_server.py"]

Configuration

Create a config.yaml file with your settings:

services:
  hunter:
    api_key: ${HUNTER_API_KEY}
    rate_limit: 50/60s
    
  clearbit:
    api_key: ${CLEARBIT_API_KEY}
    cache_ttl: 86400

scraping:
  stealth_mode: true
  headless: true
  timeout: 30
  max_retries: 3

cache:
  backend: redis://localhost:6379/0
  default_ttl: 3600

Running the Server

Development Mode

mcp dev lead_server.py --reload --port 8080

Production Mode

gunicorn -w 4 -k uvicorn.workers.UvicornWorker lead_server:app

Using Docker

docker build -t lead-server .
docker run -p 8080:8080 -e HUNTER_API_KEY=your_key lead-server

Using the API

Generate a Lead

POST /tools/lead_generation
Content-Type: application/json

{
  "search_terms": "OpenAI"
}

Response:

{
  "lead_id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "pending",
  "estimated_time": 15
}

Enrich Lead Data

POST /tools/data_enrichment
Content-Type: application/json

{
  "lead_id": "550e8400-e29b-41d4-a716-446655440000"
}

Monitor Lead Status

GET /tools/lead_maintenance

Code Examples

Python Client

from mcp.client import Client

async with Client() as client:
    # Generate lead
    lead = await client.call_tool(
        "lead_generation",
        {"search_terms": "Anthropic"}
    )
    
    # Enrich with all services
    enriched = await client.call_tool(
        "data_enrichment",
        {"lead_id": lead['lead_id']}
    )
    
    # Get full lead data
    status = await client.call_tool(
        "lead_status",
        {"lead_id": lead['lead_id']}
    )

Using cURL

# Generate lead
curl -X POST http://localhost:8080/tools/lead_generation \
  -H "Content-Type: application/json" \
  -d '{"search_terms": "Cohere AI"}'

Advanced Usage

Custom Caching Configuration

from aiocache import Cache

# Configure Redis cluster
Cache.from_url(
    "redis://cluster-node1:6379/0",
    timeout=10,
    retry=True,
    retry_timeout=2
)

Setting Up Rate Limits

from mcp.server.middleware import RateLimiter

mcp.add_middleware(
    RateLimiter(
        rules={
            "lead_generation": "100/1m",
            "data_enrichment": "50/1m"
        }
    )
)

Troubleshooting

Error Solution
403 Forbidden from Google Rotate IPs or use official CSE API
429 Too Many Requests Implement exponential backoff
Playwright Timeout Increase scraping.timeout in config
Cache Miss Verify Redis connection and TTL settings

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "inbound-lead-generation" '{"command":"python","args":["-m","mcp","run","lead_server.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "inbound-lead-generation": {
            "command": "python",
            "args": [
                "-m",
                "mcp",
                "run",
                "lead_server.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "inbound-lead-generation": {
            "command": "python",
            "args": [
                "-m",
                "mcp",
                "run",
                "lead_server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later