Purpose
mcp-dnstwist is an MCP (Model Context Protocol) server that lets AI agents run dnstwist, a DNS fuzzing tool, to find suspicious domains that imitate your own domain—including typos, homoglyphs, bit flips, swapped TLDs, and more.
This project is independent and is not affiliated with the official dnstwist. It may only be used to scan domains you own or are authorized to assess.
Main capabilities
Lookalike domain discovery
You can use all of dnstwist's domain permutation algorithms, or select only the algorithms you specify.
Threat signals
For each registered lookalike domain, it can report:
- DNS records
- Open mail relays that can intercept email (mxcheck)
- WHOIS creation date and registrar
- HTTP and SMTP banners
- Web page similarity (ssdeep or TLSH), used to identify cloned phishing sites
Multiple ways to run
You can use a locally installed dnstwist, the official dnstwist Docker image, or the self-contained mcp-dnstwist image.
Security hardening
No shell is used, strict input validation is enforced, and time limits are set so long-running scans can be stopped and cleaned up.
Testing
End-to-end tests use fake docker and dnstwist executables and run in CI on Node 20, 22, and 24.
How to use
Prerequisites
- Node.js 20.3 or newer
- Install dnstwist (
pipx install "dnstwist[full]") or Docker - No API key required
Connect a client
For Claude Desktop, VS Code, Docker, Smithery, and running from source, see the "Connect a client" documentation.
Once connected, you can ask the agent questions such as: "Which lookalike domains of example.com are registered, and could any of them intercept email?" More prompt examples are in "example workflows".
Tools
There is only one tool:fuzz_domain. For the full parameters and real example output, see the "tool reference".
Limitations and security notes
The tool's call parameters come from an AI model, and the content the model reads may influence its behavior, so the server treats parameters as untrusted input:
- No shell: dnstwist is launched via execFile with an argument array; if a shell-based API appears, the tests will fail the build.
- Strict validation: domains must be hostnames, name servers must be IPv4 or DoH URLs, and numbers and names come from fixed sets; no value may start with
-. - Constrained execution: time limits are set, and processes and containers are cleaned up on timeout, cancellation, and shutdown.
The Docker runner requires access to the Docker daemon (equivalent to root privileges on most systems). The local runner or the self-contained image can avoid this requirement. For details, see the "security model". Report vulnerabilities privately; see SECURITY.md.
Version security notice
Versions 1.0.4 and earlier have a command injection vulnerability (GHSA-p4jr-h3rj-2rw4) and are deprecated. Use 1.0.5 or newer;npx -y @burtthecoder/mcp-dnstwist always get the latest version.
Troubleshooting
- Message: "Neither dnstwist nor Docker is available": install dnstwist (
pipx install "dnstwist[full]") or launch Docker. The desktop client may not recognize the shell's PATH. - Slow on Apple Silicon: the dnstwist Docker image only supports amd64. Please install dnstwist locally, and it will be used automatically.
- Prompted "did not finish within N seconds": add an IPv4 domain name server (DNS-over-HTTPS is slower), disable whois, lsh, or banners, or increase DNSTWIST_TIMEOUT_SECONDS.
For more, see the "troubleshooting guide".
License
MIT License, see LICENSE for details.