Skip to main content
Glama

securitytrails-mcp

npm CI license

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-mcp

Claude 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

securitytrails_ping

Check the API key is accepted

Free

securitytrails_usage

Month-to-date consumption, allowance, remaining quota

Free

securitytrails_domain_details

Current DNS records, hostname counts, registrar metadata

Free

securitytrails_subdomains

Known subdomains as fully-qualified hostnames

Free

securitytrails_associated

Domains sharing registrant details or infrastructure

Free

securitytrails_dns_history

Historical A/AAAA/MX/NS/SOA/TXT records with observation dates

Free

securitytrails_whois_current

Current WHOIS record

Free

securitytrails_whois_history

Past WHOIS records — often pre-redaction

Free

securitytrails_ssl

Certificates issued for a hostname, including SAN entries

Free

securitytrails_tags

SecurityTrails classification tags

Free

securitytrails_ip_neighbors

Adjacent IPv4 blocks, site counts, sample hostnames

Free

securitytrails_ip_whois

Network block registration, owner, abuse contacts

Free

securitytrails_search_domains

Search the domain dataset by filter object or DSL query

Free

securitytrails_search_ips

Search the IP dataset by filter object or DSL query

Free

securitytrails_scroll

Continue a search via its meta.scroll_id, when offered

Varies

securitytrails_ip_useragents

User agents observed originating from an IPv4 address

Paid

securitytrails_company_associated_ips

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_subdomains costs one query regardless of result size. It returns the whole set in a single call, so prefer one call with a high limit over paging with offset — paging re-fetches and is billed again. Results default to 100 hostnames with total_count and has_more always 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_domains and _search_ips all bill per page.

  • The domain and IP datasets accept different DSL fields. ptr_part and open_port_80 are IP-dataset fields; using them against securitytrails_search_domains is 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

SECURITYTRAILS_API_KEY

(required)

Your API key

SECURITYTRAILS_TIMEOUT_MS

30000

Per-attempt request timeout

SECURITYTRAILS_MAX_RETRIES

2

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 server

The 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.

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 tools
securitytrails_associatedAssociated domainsA
Read-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 rangesA
Read-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 recordsA
Read-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 detailsA
Read-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 IPsA
Read-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 IPA
Read-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 WHOISA
Read-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 keyA
Read-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 resultsA
Read-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 domainsA
Read-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 IPsA
Read-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 certificatesA
Read-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 subdomainsA
Read-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 tagsA
Read-onlyIdempotent

Return SecurityTrails’ classification tags for a domain. Many domains carry no tags at all.

Inputs: domain (required), response_format.

securitytrails_usageCheck API quotaA
Read-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 WHOISA
Read-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 WHOISA
Read-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

    A4.1/5.0

    Scored across 17 tools

    Disambiguation5/5

    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.

    Naming Consistency4/5

    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.

    Tool Count4/5

    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.

    Completeness5/5

    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

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Provides 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.
      37
      364 npm
      60
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables AI-driven open-source intelligence investigations by exposing 30 tools for scanning emails, usernames, domains, IPs, and more, with real subprocess execution.
      31
      39 PyPI
      12
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Gives 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.
      -