Open Source  ·  MCP Server  ·  MIT

Open-source MCP server
for B2B lead extraction

Point any company URL at LeadsClean. Get back structured buying signals, personalised icebreakers, and GDPR-ready provenance — in a single tool call. A reference implementation for building your own MCP tools.

extract_lead_intelligence(url="https://acmehotels.com")
Fetching & analysing…
Works with
Claude Desktop
Cursor
OpenAI Agents SDK
Any MCP client
Features

What it extracts

One tool call returns a structured intelligence package. No prompt engineering. No scraper maintenance. BYO API key.

Buying Signal Detection

Extracts recent_company_trigger (expansion, funding, hiring surge) and scores product_category_match against your seller context. Surfaces opportunities the rep would miss.

product_category_match

Personalised Icebreakers

Two ready-to-send opening lines: icebreaker_hook_business (core business angle) and icebreaker_hook_news (latest trigger angle). Drop directly into outreach sequences.

icebreaker_hook_*

GDPR-ready by Default

Every response includes data_provenance: source type, PII status (false), and legal basis (legitimate_interest, Art. 6(1)(f)). Enterprise security teams can approve the integration without a manual compliance review.

data_provenance
Output schema

Structured JSON, every time

Eight fields, strictly typed. null when not found — no hallucinations, no freeform text blobs.

company_name
Canonical name extracted from the page
core_business_summary
≤ 15-word summary of what the company does
product_category_match
Fit assessment scored against your seller context
recent_company_trigger
Latest expansion, funding, or event — or null
inferred_business_need
Specific need that aligns with your offering
icebreaker_hook_business
Opening line referencing core business
icebreaker_hook_news
Opening line referencing latest trigger — or null
data_provenance
GDPR metadata block (source, PII flag, legal basis)
response.json

  "company_name" "Acme Hotels Group"
  "core_business_summary" "Boutique hotel chain, 12 properties, Europe."
  "product_category_match"
    "Strong match — hotel groups purchase furniture in bulk for room refits."
  "recent_company_trigger"
    "Expanding to 3 new cities Q1 2026, adding 400+ rooms."
  "inferred_business_need"
    "Bulk furnishing for new hotel rooms on tight fit-out timelines."
  "icebreaker_hook_business"
    "Running 12 properties across Europe is impressive — furnishing at scale is where we help."
  "icebreaker_hook_news"
    "Saw the Q1 expansion news — we help hotel groups source wholesale furniture fast."
  "data_provenance" 
    "source_url"   "https://acmehotels.com"
    "source_type"  "public_website"
    "contains_pii" false
    "gdpr_basis"   "legitimate_interest"
    "gdpr_notes"   "Public web pages only. GDPR Art. 6(1)(f)."
  
GDPR Compliance

Enterprise-ready compliance, built in

Every response ships with a machine-readable data_provenance block. Security teams get what they need without a manual review cycle.

Data source
Public company websites only
PII collected
None — contains_pii: false
Legal basis
Legitimate interest · Art. 6(1)(f)
Data storage
None — never leaves your pipeline
Fetch method
Jina Reader public fetch
Provenance format
Machine-readable JSON, audit-log ready
Quick Start

Up and running in 2 minutes

Supports OpenAI, Anthropic Claude, Alibaba Qwen, and MiniMax. Provider is inferred from the model name — just set the matching API key.

pip install
Claude Desktop
Cursor
Demo mode
# install
pip install mcp-leadsclean

# run (stdio, for Claude Desktop / Cursor)
OPENAI_API_KEY=sk-... mcp-leadsclean

# run over HTTP (for remote / multi-tenant agents)
OPENAI_API_KEY=sk-... mcp-leadsclean --transport http --port 8001
// ~/Library/Application Support/Claude/claude_desktop_config.json

  "mcpServers" 
    "leadsclean" 
      "command" "mcp-leadsclean"
      "env"  "OPENAI_API_KEY" "sk-..." 
    
  
// ~/.cursor/mcp.json

  "mcpServers" 
    "leadsclean" 
      "command" "mcp-leadsclean"
      "env"  "OPENAI_API_KEY" "sk-..." 
    
  
# try without any API key — returns the demo fixture
LEADSCLEAN_DEMO=1 mcp-leadsclean

# responses include "_demo": true so agents can detect and discard them
# ideal for testing your agent pipeline before adding real credentials
Reference Patterns

Patterns you can reuse

LeadsClean is a working reference implementation. These patterns are designed to be extracted and adapted for your own MCP servers.

Multi-Provider LLM Routing

Dispatches to OpenAI, Anthropic, Qwen, or MiniMax based on model name prefix. Callers swap providers at call time — zero server config changes.

core.py

Dual-Transport MCP

Same tool logic served over stdio (Claude Desktop, Cursor) and HTTP (remote agents, production pipelines). One codebase, two modes.

mcp_server.py

Security Hardening

SSRF protection (private IP blocking), prompt injection mitigation (XML boundary tags), API key SHA-256 hashing — never stored in plain text.

core.py + db.py

GDPR Provenance

Machine-readable data_provenance block on every response: source type, PII flag, legal basis. Enterprise security teams can approve without manual review.

core.py

Usage Metering

Per-key monthly quotas with auto-reset, atomic increment, and rate-limit response headers. Includes a CLI tool for key management.

db.py + auth.py

Demo Mode

Set LEADSCLEAN_DEMO=1 to bypass all external services. Returns a fixture with _demo: true — ideal for pipeline testing without API keys.

core.py + auth.py