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.
One tool call returns a structured intelligence package. No prompt engineering. No scraper maintenance. BYO API key.
Extracts recent_company_trigger (expansion, funding, hiring surge) and scores product_category_match against your seller context. Surfaces opportunities the rep would miss.
Two ready-to-send opening lines: icebreaker_hook_business (core business angle) and icebreaker_hook_news (latest trigger angle). Drop directly into outreach sequences.
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.
Eight fields, strictly typed. null when not found —
no hallucinations, no freeform text blobs.
{ "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)." } }
Every response ships with a machine-readable
data_provenance block.
Security teams get what they need without a manual review cycle.
Supports OpenAI, Anthropic Claude, Alibaba Qwen, and MiniMax. Provider is inferred from the model name — just set the matching API key.
# 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
LeadsClean is a working reference implementation. These patterns are designed to be extracted and adapted for your own MCP servers.
Dispatches to OpenAI, Anthropic, Qwen, or MiniMax based on model name prefix. Callers swap providers at call time — zero server config changes.
core.pySame tool logic served over stdio (Claude Desktop, Cursor) and HTTP (remote agents, production pipelines). One codebase, two modes.
SSRF protection (private IP blocking), prompt injection mitigation (XML boundary tags), API key SHA-256 hashing — never stored in plain text.
core.py + db.pyMachine-readable data_provenance block on every response: source type, PII flag, legal basis. Enterprise security teams can approve without manual review.
Per-key monthly quotas with auto-reset, atomic increment, and rate-limit response headers. Includes a CLI tool for key management.
db.py + auth.pySet LEADSCLEAN_DEMO=1 to bypass all external services. Returns a fixture with _demo: true — ideal for pipeline testing without API keys.