securitytrails-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@securitytrails-mcp What subdomains does example.com have?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
securitytrails-mcp
An MCP server that gives an LLM agent the SecurityTrails API: DNS history, subdomain enumeration, WHOIS (current and historical), SSL certificates, and IPv4 intelligence — 17 read-only tools.
Built for reconnaissance work where the interesting question is usually "what did this look like before the CDN went up?" rather than "what does it resolve to now?".
Unofficial project. Not affiliated with, endorsed by, or sponsored by SecurityTrails or Recorded Future, Inc. You bring your own SecurityTrails API key and use it under your own agreement with them. See Legal.
Quickstart
You need a SecurityTrails API key — the free tier is enough to try it. Get one at securitytrails.com/app/account/credentials.
Claude Code
claude mcp add securitytrails --env SECURITYTRAILS_API_KEY=your_key -- npx -y securitytrails-mcpClaude Desktop, Cursor, VS Code, and other MCP hosts
{
"mcpServers": {
"securitytrails": {
"command": "npx",
"args": ["-y", "securitytrails-mcp"],
"env": {
"SECURITYTRAILS_API_KEY": "your_key"
}
}
}
}Config file locations: Claude Desktop uses claude_desktop_config.json
(~/Library/Application Support/Claude/ on macOS, %APPDATA%\Claude\ on Windows);
Cursor uses ~/.cursor/mcp.json; VS Code uses .vscode/mcp.json in the workspace.
Related MCP server: Clearfront MCP Server
Tools
Every tool is read-only, accepts response_format, and costs one SecurityTrails API query per
call — including per page when paging.
Tool | What it does | Plan |
| Check the API key is accepted | Free |
| Month-to-date consumption, allowance, remaining quota | Free |
| Current DNS records, hostname counts, registrar metadata | Free |
| Known subdomains as fully-qualified hostnames | Free |
| Domains sharing registrant details or infrastructure | Free |
| Historical A/AAAA/MX/NS/SOA/TXT records with observation dates | Free |
| Current WHOIS record | Free |
| Past WHOIS records — often pre-redaction | Free |
| Certificates issued for a hostname, including SAN entries | Free |
| SecurityTrails classification tags | Free |
| Adjacent IPv4 blocks, site counts, sample hostnames | Free |
| Network block registration, owner, abuse contacts | Free |
| Search the domain dataset by filter object or DSL query | Free |
| Search the IP dataset by filter object or DSL query | Free |
| Continue a search via its | Varies |
| User agents observed originating from an IPv4 address | Paid |
| IP ranges attributed to a domain's owning organisation | Paid |
Plan column reflects what a free-tier key could reach at the time of writing; SecurityTrails may move endpoints between tiers. The two paid endpoints return a clear plan error rather than a generic failure, so an agent knows to stop retrying:
Your SecurityTrails plan does not permit this endpoint (HTTP 403): This feature is not
available for your subscription package.Response format
Every tool takes response_format:
markdown(default) — a compact summary. Converts the API's raw Unix timestamps to dates, drops null-filled privacy contacts, and appends a pagination footer saying whether more data exists. Typically a fraction of the tokens of the equivalent JSON.json— the untouched upstream payload, for when you need a field the summary omits.
If a payload does not match the shape a renderer expects, the server returns the raw JSON rather than a partial summary. A rendering gap will cost you tokens, never data.
Examples
Finding an origin IP behind a CDN
The current A record is a CDN edge, so ask what it used to be:
> Has example.com always been behind Cloudflare? Check its A record history.// securitytrails_domain_details { "domain": "example.com" }
// securitytrails_dns_history { "domain": "example.com", "type": "a" }The history table shows each IP with the window it was observed in and the hosting organisation — an address that predates the CDN cutover is a candidate origin.
Expanding scope from one domain
> I only know example.com. What else does this organisation own?// securitytrails_whois_current { "domain": "example.com" }
// securitytrails_associated { "domain": "example.com" }
// securitytrails_search_domains { "query": "whois_email = 'admin@example.com'" }WHOIS gives the registrant email; searching the dataset by that email finds every other domain
registered with it. securitytrails_whois_history is often more productive than the current
record, because older entries predate privacy redaction.
Mining certificates for hostnames
> Find hostnames for example.com that subdomain enumeration might have missed.// securitytrails_subdomains { "domain": "example.com", "limit": 1000 }
// securitytrails_ssl { "domain": "example.com", "status": "all", "include_subdomains": true }SAN entries on expired certificates frequently name internal or staging hosts that no longer
resolve. Use status: "all" — the default valid filter hides exactly the interesting ones.
Profiling an IP
> Who owns 8.8.8.8 and what else is in that block?// securitytrails_ip_whois { "ip": "8.8.8.8" }
// securitytrails_ip_neighbors { "ip": "8.8.8.8" }Quota and performance
SecurityTrails bills per API query against a monthly allowance. securitytrails_usage reports
where you stand. Things worth knowing before pointing an agent at a large target:
securitytrails_subdomainscosts one query regardless of result size. It returns the whole set in a single call, so prefer one call with a highlimitover paging withoffset— paging re-fetches and is billed again. Results default to 100 hostnames withtotal_countandhas_morealways reported, so a truncated result is never mistaken for a complete one.Paged endpoints cost one query per page.
securitytrails_associated,_dns_history,_ssl,_search_domainsand_search_ipsall bill per page.The domain and IP datasets accept different DSL fields.
ptr_partandopen_port_80are IP-dataset fields; using them againstsecuritytrails_search_domainsis a syntax error, not an empty result.
Each request has a 30-second timeout and retries twice on 429/5xx/network errors with
exponential backoff (500ms, then 1000ms). Non-transient failures — 400, 401, 403, 404 —
are never retried, so a bad argument costs one query rather than three.
Configuration
Variable | Default | Purpose |
| (required) | Your API key |
|
| Per-attempt request timeout |
|
| Retries on 429/5xx/network errors |
If the key is missing the server still starts and still lists its tools, so the host shows it as
healthy; each tool call then returns an error naming the variable to set. This is deliberate — a
server that exits on startup shows up in most hosts as an unexplained crash. The key is validated
by use rather than by a startup ping, so that restarting your editor does not spend quota.
Development
git clone https://github.com/aqhmal/securitytrails-mcp.git
cd securitytrails-mcp
npm install
npm test # 85 tests, no API key needed — the HTTP layer is stubbed
npm run build
npm run format # Prettier, in place
npm run inspect # build, then open the MCP Inspector against the serverThe suite drives a real MCP Client against the server in-process, so tool schemas, argument
validation, rendering and error handling are exercised through the actual protocol rather than by
calling handlers directly. See CONTRIBUTING.md.
Release history is in CHANGELOG.md.
evals/ holds a ten-question evaluation set for checking whether a model can actually accomplish
realistic lookups with these tools.
Security
This is a reconnaissance tool. Only use it against infrastructure you are authorised to investigate.
The API key is read from the environment, sent only to api.securitytrails.com over HTTPS as a
header, and never logged, written to disk, or included in a tool result. Tool arguments are
validated with Zod before any request is made: hostnames must be bare hostnames, IPs must be
IPv4, and identifiers interpolated into request paths are percent-encoded, so a traversal
sequence cannot escape its endpoint.
To report a vulnerability, see SECURITY.md.
Legal
This is an unofficial, community-maintained client. It is not affiliated with, endorsed by, or sponsored by SecurityTrails, Recorded Future, Inc., or Mastercard.
SecurityTrails is a trademark of Recorded Future, Inc. (officially styled SecurityTrails, a Recorded Future Company). The name is used here only to identify the API this software talks to — nominative use — and no claim to the mark, and no sponsorship or endorsement, is made or implied. No SecurityTrails logos or brand assets are included or distributed with this project.
This project is a client. It ships no SecurityTrails data, and it grants you no rights to any. Your use of the API is governed entirely by your own agreement with SecurityTrails / Recorded Future, including their terms of service, your plan's query limits, and any restrictions on storing or redistributing what you retrieve. You are responsible for complying with those terms, and for only running reconnaissance against infrastructure you are authorised to investigate.
The MIT licence below covers this client's own source code and nothing else.
License
MIT © aqhmal
Available Tools
17 toolssecuritytrails_associatedAssociated domainsARead-onlyIdempotent
Find other domains associated with this one through shared registrant details or infrastructure. Useful for expanding scope from a single known domain to an organisation’s wider estate.
Inputs: domain (required), page, response_format.
securitytrails_company_associated_ipsCompany IP rangesARead-onlyIdempotent
Look up IP addresses and ranges attributed to the organisation that owns a domain. Takes the company’s primary domain, not a company name. Requires a paid SecurityTrails plan — returns a plan error on the free tier.
Inputs: company_domain (required), response_format.
securitytrails_dns_historyHistorical DNS recordsARead-onlyIdempotent
Retrieve historical values of one DNS record type for a domain, with the date range each value was observed. The primary tool for spotting infrastructure migrations and origin IPs that predate a CDN.
Inputs: type (required), domain (required), page, response_format.
securitytrails_domain_detailsDomain detailsARead-onlyIdempotent
Fetch the current DNS records (A, AAAA, MX, NS, SOA, TXT), hostname counts and registrar metadata for one domain. The best first call when profiling an unfamiliar domain.
Inputs: domain (required), response_format.
securitytrails_ip_neighborsList neighbouring IPsARead-onlyIdempotent
List IP blocks adjacent to the given IPv4 address, with the number of sites and sample hostnames seen on each. Useful for finding sibling infrastructure in the same allocation.
Inputs: ip (required), response_format.
securitytrails_ip_useragentsUser agents seen on an IPARead-onlyIdempotent
List user-agent strings SecurityTrails has observed originating from one IPv4 address, with first and last seen dates. Paginated. Requires a paid SecurityTrails plan — returns a plan error on the free tier.
Inputs: ip (required), page, response_format.
securitytrails_ip_whoisIP WHOISARead-onlyIdempotent
Fetch WHOIS and network-block registration data for one IPv4 address — owning organisation, allocation, and abuse contacts.
Inputs: ip (required), response_format.
securitytrails_pingVerify API keyARead-onlyIdempotent
Check that the configured SecurityTrails API key is accepted. Returns only a success flag — use securitytrails_usage for quota figures.
Inputs: response_format. Returns: success
securitytrails_scrollScroll search resultsARead-onlyIdempotent
Fetch the next batch of a large search using a scroll id. Only usable when a previous securitytrails_search_domains or securitytrails_search_ips response included meta.scroll_id — scrolling is not enabled on every plan or every query. When no scroll id is offered, page with the page argument instead.
Inputs: scroll_id (required), response_format.
securitytrails_search_domainsSearch domainsARead-onlyIdempotent
Search the domain dataset by structured filter or DSL query. Valid fields include apex_domain, keyword, tld, mx, ns, cname, ipv4, ipv6 and whois_email — for example {"apex_domain": "example.com"} or "whois_email = 'admin@example.com'". Note that the domain and IP datasets accept different field names: IP-only fields such as ptr_part or open_port_80 are a syntax error here, and belong in securitytrails_search_ips. Exactly one of filter or query is required. Each page costs one API query.
Inputs: page, query, filter, include_ips, +1 more.
securitytrails_search_ipsSearch IPsARead-onlyIdempotent
Search the IP dataset by DSL query or structured filter — for example "ptr_part = 'example'" or "open_port_80 = true". These IP-dataset fields are distinct from the domain-dataset fields used by securitytrails_search_domains. Exactly one of query or filter is required. Each page costs one API query.
Inputs: page, query, filter, response_format.
securitytrails_sslSSL/TLS certificatesARead-onlyIdempotent
List SSL/TLS certificates issued for a hostname. Subject alternative names in the results frequently reveal hostnames that subdomain enumeration alone misses. Pass status: "all" to include expired certificates, which are often the more interesting ones historically.
Inputs: domain (required), page, status, response_format, +1 more.
securitytrails_subdomainsEnumerate subdomainsARead-onlyIdempotent
List known subdomains of a domain as fully-qualified hostnames, ready to feed into resolution or scanning. Costs one API query regardless of how many hostnames exist, so prefer a single call with a high limit over paging with offset — each page is separately billed. The response always reports total_count and has_more so a truncated result is never mistaken for a complete one.
Inputs: domain (required), limit, offset, children_only, +2 more. Returns: apex, note, limit, offset, +5 more
securitytrails_tagsDomain tagsARead-onlyIdempotent
Return SecurityTrails’ classification tags for a domain. Many domains carry no tags at all.
Inputs: domain (required), response_format.
securitytrails_usageCheck API quotaARead-onlyIdempotent
Report this month’s SecurityTrails API consumption against the plan allowance. Call this before a large enumeration to confirm there is remaining quota.
Inputs: response_format. Returns: remaining, percent_used, allowed_monthly_usage, current_monthly_usage
securitytrails_whois_currentCurrent WHOISARead-onlyIdempotent
Fetch the current WHOIS record for a domain: registrar, registrant contacts where not redacted, nameservers, and creation/expiry dates.
Inputs: domain (required), response_format.
securitytrails_whois_historyHistorical WHOISARead-onlyIdempotent
Retrieve past WHOIS records for a domain, each with the window it was observed in. Historical records often expose registrant details that have since been redacted behind privacy services.
Inputs: domain (required), response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Each tool targets a distinct resource or action: WHOIS, DNS, subdomains, history, SSL, IP data, and search are clearly separated. The only potential overlap is domain_details vs whois_current, but the descriptions make their scopes explicit (DNS vs WHOIS record). No two tools appear to serve the same purpose.
All tools share the 'securitytrails_' prefix and use snake_case, which is consistent. However, some names are nouns (ping, usage, tags) while others are verb_noun (search_domains, get_domain_details implied), so the pattern is not uniformly verb-first. Minor deviation but still predictable and readable.
17 tools is on the heavier side but appropriate for the breadth of SecurityTrails' API (WHOIS, DNS, subdomains, IP intelligence, search). Each tool covers a meaningful function; the count reflects the domain's scope rather than redundancy. It sits just above the ideal range but remains well-scoped.
The tool surface covers the major SecurityTrails capabilities: current and historical WHOIS/DNS, subdomain enumeration, associated domains, SSL certificates, IP information, and flexible search with scrolling. There are no obvious dead ends—quota checks and paging support are included. The API's core workflows appear fully represented.
Maintenance
Related MCP Connectors
29 DNS, SEO, SSL, security, WHOIS & mail tools for AI agents. Pay per call (x402) or card API key.
35 WHOIS, DNS, IP, threat intelligence, email, and bulk tools for AI agents via WhoisXML API.
DNS, WHOIS, IP geolocation and SSL checks as agent tools.
30 security tools for AI agents: phishing links, exposure maps, DNS, SSL, PQC, history, pivots.
Related MCP Servers
- AlicenseAqualityCmaintenanceProvides AI agents with 37 OSINT tools and 12 data sources to perform unified reconnaissance, domain analysis, and attack surface mapping. It enables agents to query, correlate, and reason across platforms like Shodan, VirusTotal, and Censys in parallel.37364 npm60MIT
- AlicenseAqualityCmaintenanceEnables AI-driven open-source intelligence investigations by exposing 30 tools for scanning emails, usernames, domains, IPs, and more, with real subprocess execution.3139 PyPI12MIT
- AlicenseNot gradedqualityCmaintenanceExposes Validin's threat intelligence and DNS, WHOIS, OSINT, certificate, crawl, and threat data as 55+ MCP tools for AI agents.MIT
- FlicenseNot gradedqualityAmaintenanceGives AI agents access to the Shodan API and Shodan CVEDB for host reconnaissance, device search, DNS lookups, and CVE/CPE vulnerability intelligence. It returns open ports, banners, TLS certificates, subdomains, and CVSS/EPSS/KEV severity data through eleven read-only tools.-