├── README.md └── mcp_osint_server ├── Dockerfile ├── mcp_osint_server ├── __init__.py └── main.py ├── requirements.txt ├── setup.py └── smithery.yaml /README.md: -------------------------------------------------------------------------------- 1 | # mcp-osint OSINT Server 2 | 3 | [![smithery badge](https://smithery.ai/badge/mcp-osint)](https://smithery.ai/server/mcp-osint) 4 | MCP server to perform various OSINT tasks by leveraging common network reconnaissance tools. 5 | 6 | ## Overview 7 | 8 | The mcp-osint server provides a set of tools to perform open source intelligence (OSINT) investigations. It supports executing commands such as WHOIS lookups, Nmap scans, DNS reconnaissance (via dnsrecon, dig, and host), and domain permutation checks using dnstwist. Additionally, the server offers a consolidated tool to run all these functions in parallel for a comprehensive overview. 9 | 10 | ## OSINT Capabilities 11 | 12 | 1. **WHOIS Lookup** 13 | - Retrieve domain registration information. 14 | 15 | 2. **Nmap Scan** 16 | - Perform a fast Nmap scan to discover open ports and services. 17 | 18 | 3. **DNS Reconnaissance** 19 | - Use `dnsrecon` to gather DNS information for a target domain. 20 | 21 | 4. **DNSTwist Lookup** 22 | - Identify potential domain typosquatting or permutation issues using `dnstwist`. 23 | 24 | 5. **Dig Lookup** 25 | - Query detailed DNS records with `dig`. 26 | 27 | 6. **Host Lookup** 28 | - Retrieve DNS host information using the `host` command. 29 | 30 | 7. **OSINT Overview** 31 | - Execute all of the above tools concurrently for a quick and comprehensive OSINT report. 32 | 33 | ## Example Prompts 34 | 35 | When integrated with Claude, you can use natural language prompts like: 36 | 37 | * "Get me the WHOIS information for example.com" 38 | * "Perform a fast Nmap scan on 192.168.1.1" 39 | * "Run DNS reconnaissance on mytarget.com" 40 | * "Check for domain typos using DNSTwist on mytarget.com" 41 | * "Show me all DNS records for example.com using dig" 42 | * "Fetch host lookup details for example.com" 43 | * "Give me an OSINT overview for example.com" 44 | 45 | ## Quickstart 46 | 47 | ### Install 48 | 49 | #### Installing via Smithery 50 | 51 | To install **mcp-osint** for Claude Desktop automatically via [Smithery](https://smithery.ai/server/mcp-osint): 52 | 53 | ```bash 54 | npx -y @smithery/cli install mcp-osint --client claude 55 | -------------------------------------------------------------------------------- /mcp_osint_server/Dockerfile: -------------------------------------------------------------------------------- 1 | # Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile 2 | FROM python:3.10-slim 3 | 4 | # Install OSINT tools dependencies 5 | RUN apt-get update && \ 6 | apt-get install -y whois nmap dnsrecon dnstwist dnsutils host && \ 7 | rm -rf /var/lib/apt/lists/* 8 | 9 | WORKDIR /app 10 | 11 | # Copy necessary files from the current directory 12 | COPY setup.py ./ 13 | COPY requirements.txt ./ 14 | COPY mcp_osint_server/ ./mcp_osint_server/ 15 | 16 | # Install the MCP OSINT server package 17 | RUN pip install --no-cache-dir . 18 | 19 | # Set the entrypoint to the MCP server startup command provided by setup.py 20 | ENTRYPOINT ["mcp-osint"] 21 | -------------------------------------------------------------------------------- /mcp_osint_server/mcp_osint_server/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/himanshusanecha/mcp-osint-server/e1767ad9a46a5090b0ba8a8372d01cee5fc93940/mcp_osint_server/mcp_osint_server/__init__.py -------------------------------------------------------------------------------- /mcp_osint_server/mcp_osint_server/main.py: -------------------------------------------------------------------------------- 1 | from fastmcp import FastMCP 2 | import subprocess 3 | from concurrent.futures import ThreadPoolExecutor, as_completed 4 | 5 | # Create an MCP server instance named "OSINT Server" 6 | mcp = FastMCP("OSINT Server") 7 | 8 | # Define all the OSINT functions (WHOIS, Amass, Nmap, etc.) 9 | @mcp.tool() 10 | def whois_lookup(target: str) -> str: 11 | try: 12 | result = subprocess.run(["whois", target], capture_output=True, text=True, timeout=10000) 13 | return "WHOIS Lookup:\n" + (result.stdout if result.returncode == 0 else "Failed") 14 | except Exception as e: 15 | return f"Error during WHOIS lookup: {str(e)}" 16 | 17 | @mcp.tool() 18 | def nmap_scan(target: str) -> str: 19 | try: 20 | result = subprocess.run(["nmap", "-F", "-T4", target], capture_output=True, text=True, timeout=10000) 21 | return "Nmap Fast Scan:\n" + (result.stdout if result.returncode == 0 else "Failed") 22 | except Exception as e: 23 | return f"Error during Nmap scan: {str(e)}" 24 | 25 | @mcp.tool() 26 | def dnsrecon_lookup(target: str) -> str: 27 | try: 28 | result = subprocess.run(["dnsrecon", "-d", target], capture_output=True, text=True, timeout=10000) 29 | return "DNSRecon Results:\n" + (result.stdout if result.returncode == 0 else "Failed") 30 | except Exception as e: 31 | return f"Error during DNSRecon lookup: {str(e)}" 32 | 33 | @mcp.tool() 34 | def dnstwist_lookup(domain: str) -> str: 35 | try: 36 | result = subprocess.run(["dnstwist", domain], capture_output=True, text=True, timeout=10000) 37 | return result.stdout if result.returncode == 0 else "DNSTwist lookup failed." 38 | except Exception as e: 39 | return f"Error running DNSTwist: {str(e)}" 40 | 41 | @mcp.tool() 42 | def dig_lookup(target: str) -> str: 43 | try: 44 | result = subprocess.run(["dig", target], capture_output=True, text=True, timeout=10000) 45 | return "Dig Results:\n" + (result.stdout if result.returncode == 0 else "Failed") 46 | except Exception as e: 47 | return f"Error running Dig: {str(e)}" 48 | 49 | @mcp.tool() 50 | def host_lookup(target: str) -> str: 51 | try: 52 | result = subprocess.run(["host", target], capture_output=True, text=True, timeout=10000) 53 | return "Host Lookup Results:\n" + (result.stdout if result.returncode == 0 else "Failed") 54 | except Exception as e: 55 | return f"Error running Host lookup: {str(e)}" 56 | 57 | # Parallel OSINT execution 58 | @mcp.tool() 59 | def osint_overview(target: str) -> str: 60 | tools = [ 61 | whois_lookup, 62 | nmap_scan, 63 | dnsrecon_lookup, 64 | dnstwist_lookup, 65 | dig_lookup, 66 | host_lookup 67 | ] 68 | 69 | results = [] 70 | with ThreadPoolExecutor() as executor: 71 | future_to_tool = {executor.submit(tool, target): tool.__name__ for tool in tools} 72 | for future in as_completed(future_to_tool): 73 | tool_name = future_to_tool[future] 74 | try: 75 | results.append(f"{tool_name}:{future.result()}") 76 | except Exception as e: 77 | results.append(f"{tool_name} failed with error: {str(e)}") 78 | 79 | return "\n\n".join(results) 80 | 81 | # Main function to run the MCP server 82 | def main(): 83 | mcp.run(transport="stdio") 84 | 85 | if __name__ == "__main__": 86 | main() -------------------------------------------------------------------------------- /mcp_osint_server/requirements.txt: -------------------------------------------------------------------------------- 1 | fastmcp 2 | -------------------------------------------------------------------------------- /mcp_osint_server/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | name="mcp_osint_server", 5 | version="0.1", 6 | packages=find_packages(), 7 | install_requires=["fastmcp"], 8 | entry_points={ 9 | "console_scripts": [ 10 | "mcp-osint=mcp_osint_server.main:main" 11 | ] 12 | }, 13 | author="Himanshu sanecha", 14 | description="MCP OSINT Server with integrated tools like WHOIS, Nmap, Subfinder, etc.", 15 | ) 16 | -------------------------------------------------------------------------------- /mcp_osint_server/smithery.yaml: -------------------------------------------------------------------------------- 1 | # Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml 2 | 3 | startCommand: 4 | type: stdio 5 | configSchema: 6 | # JSON Schema defining the configuration options for the MCP. 7 | {} 8 | commandFunction: 9 | # A JS function that produces the CLI command based on the given config to start the MCP on stdio. 10 | |- 11 | (_) => ({ command: 'mcp-osint', args: [], env: {} }) 12 | exampleConfig: {} 13 | --------------------------------------------------------------------------------