theHarvester MCP Server

theHarvester MCP Server

Enables AI assistants to perform domain reconnaissance using theHarvester OSINT tool, including email harvesting, subdomain discovery, DNS brute force, and Shodan integration, via SSH on a Kali Linux host.

Category
Visit Server

README

theHarvester MCP Server

MCP License: MIT TypeScript

An MCP (Model Context Protocol) server that provides AI assistants with access to theHarvester - a powerful OSINT reconnaissance tool for email and subdomain harvesting during penetration testing.

Overview

theHarvester is one of the most widely used OSINT tools for gathering intelligence during the reconnaissance phase of penetration testing. This MCP server wraps theHarvester's capabilities, allowing AI assistants like Claude to perform domain reconnaissance tasks through a structured interface.

The server executes theHarvester commands via SSH on a Kali Linux host, making it ideal for security professionals who maintain a dedicated Kali environment.

Features

  • Email Harvesting - Discover email addresses associated with target domains
  • Subdomain Discovery - Find subdomains using 40+ public and premium data sources
  • DNS Brute Force - Enumerate subdomains using wordlist-based brute forcing
  • Shodan Integration - Query discovered hosts for open ports, services, and banners
  • Takeover Detection - Check for subdomain takeover vulnerabilities
  • Virtual Host Discovery - Identify virtual hosts on discovered IP addresses

Installation

Prerequisites

  1. Kali Linux Host - A Kali Linux system accessible via SSH
  2. SSH Configuration - SSH access configured in ~/.ssh/config
  3. theHarvester - Installed on the Kali host:
    sudo apt install theharvester
    
  4. Node.js - Version 18 or higher

Setup

# Clone the repository
git clone https://github.com/schwarztim/sec-theharvester-mcp.git
cd sec-theharvester-mcp

# Install dependencies
npm install

# Build the project
npm run build

MCP Configuration

Add to your Claude Desktop or MCP client configuration:

{
  "mcpServers": {
    "theharvester": {
      "command": "node",
      "args": ["/path/to/sec-theharvester-mcp/dist/index.js"],
      "env": {
        "KALI_HOST": "kali"
      }
    }
  }
}

Tools

Tool Description
theharvester_search Full OSINT search with configurable sources and options
theharvester_sources List available data sources and API requirements
theharvester_emails Quick search focused on email harvesting
theharvester_hosts Quick search for subdomain/host discovery
theharvester_dns_brute DNS brute force enumeration
theharvester_shodan Search with Shodan integration for detailed host info
theharvester_full_recon Comprehensive reconnaissance using all features
theharvester_check_status Verify theHarvester availability on Kali host

Data Sources

No API Key Required

  • anubis, baidu, bing, crtsh, dnsdumpster, duckduckgo
  • hackertarget, otx, rapiddns, sitedossier, subdomaincenter
  • threatminer, urlscan, yahoo

API Key Required

  • bevigil, binaryedge, brave, bufferoverun, censys
  • criminalip, fullhunt, github-code, hunter, hunterhow
  • intelx, leakix, netlas, onyphe, pentesttools
  • projectdiscovery, rocketreach, securityscorecard
  • securitytrails, shodan, tomba, virustotal, zoomeye

Configure API keys in theHarvester's configuration file on your Kali host.

Configuration

Environment Variables

Variable Default Description
KALI_HOST kali SSH hostname for Kali Linux system

SSH Setup

Ensure your SSH config (~/.ssh/config) includes an entry for your Kali host:

Host kali
    HostName 192.168.1.100
    User root
    IdentityFile ~/.ssh/kali_key

Usage Examples

Basic Domain Search

{
  "tool": "theharvester_search",
  "arguments": {
    "domain": "example.com",
    "sources": ["bing", "crtsh", "dnsdumpster"],
    "limit": 500
  }
}

Email Harvesting

{
  "tool": "theharvester_emails",
  "arguments": {
    "domain": "example.com",
    "sources": ["hunter", "tomba", "bing"]
  }
}

Subdomain Discovery with DNS Resolution

{
  "tool": "theharvester_hosts",
  "arguments": {
    "domain": "example.com",
    "dns_resolve": true,
    "dns_brute": true
  }
}

Full Reconnaissance

{
  "tool": "theharvester_full_recon",
  "arguments": {
    "domain": "example.com"
  }
}

Output Format

All tools return structured JSON with:

  • Parsed results (emails, hosts, IPs, URLs, ASNs)
  • Statistics and metadata
  • Raw output for detailed analysis

Example response:

{
  "domain": "example.com",
  "sources": ["bing", "crtsh"],
  "emails": ["admin@example.com", "support@example.com"],
  "hosts": ["www.example.com", "mail.example.com"],
  "ips": ["93.184.216.34"],
  "urls": [],
  "asns": [],
  "interesting_urls": [],
  "raw_output": "..."
}

Security Considerations

  • This tool is intended for authorized security testing only
  • Always obtain proper authorization before scanning any domain
  • Be mindful of rate limits on data source APIs
  • Some sources may log your queries

Development

# Watch mode for development
npm run dev

# Build for production
npm run build

# Run the server
npm start

Related Projects

License

MIT License - see LICENSE for details.

Disclaimer

This tool is provided for educational and authorized security testing purposes only. Users are responsible for ensuring they have proper authorization before scanning any systems or domains. The authors are not responsible for any misuse of this software.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured