Skip to main content
Glama

shodan-mcp

A minimal Model Context Protocol server for Shodan. It exposes only the endpoints needed for two things: checking what your own infrastructure exposes to the internet, and searching Shodan's data for general reconnaissance. One file, no extra dependencies beyond the official MCP SDK.

Quick start

git clone https://github.com/aethrox/shodan-mcp.git
cd shodan-mcp
npm install

Register it with Claude Code:

claude mcp add shodan -s user -e SHODAN_API_KEY=your-key-here -- node /absolute/path/to/index.js

Or run it standalone (it speaks MCP over stdio):

SHODAN_API_KEY=your-key-here node index.js

A Shodan API key is required either way. Instead of exporting SHODAN_API_KEY yourself, you can copy .env.example to .env and put the key there; the server loads it automatically on startup. .env is gitignored, so it never gets committed.

cp .env.example .env
# then edit .env and set SHODAN_API_KEY

Related MCP server: Shodan MCP Server

Tools

Tool

What it does

shodan_my_ip

Public IP Shodan sees this API key's requests coming from. Starting point for scanning your own infrastructure.

shodan_host_lookup

Full Shodan record for one IP: open ports, banners, detected products/versions, known vulnerabilities.

shodan_search

Search Shodan's device database using Shodan search syntax (country:, net:, vuln:, ...).

shodan_cve_lookup

CVE details from Shodan's CVEDB: CVSS score, affected CPEs, how many exposed hosts Shodan currently sees.

shodan_cves_by_product

CVEs affecting a given CPE (product + version).

shodan_host_count

Count hosts matching a search query without spending query credits.

shodan_search_filters

List the search filters Shodan supports (country, port, net, vuln, ...).

shodan_dns_domain

Subdomains and DNS entries Shodan has seen for a domain.

shodan_dns_resolve

Resolve hostnames to IP addresses.

shodan_dns_reverse

Reverse-resolve IP addresses to hostnames.

shodan_account_info

This API key's plan and remaining query/scan credits.

Requirements

  • Node.js 20+

  • A Shodan API key with the plan tier needed for the endpoints you use (host lookup and search require more than the free tier)

Limitations

  • No caching or rate-limit handling: requests go straight to the Shodan API, so hitting your plan's rate limit surfaces as a raw API error.

  • No pagination helper for shodan_search; multi-page results need repeated calls with the page argument.

  • The API key is passed as a plain environment variable to the MCP process, same as any other stdio MCP server. Don't commit it, and be mindful of where your MCP client config file (e.g. claude mcp add output) ends up stored.

License

MIT

Available Tools

11 tools
shodan_account_infoAccount plan and creditsA
Read-only

Show this API key's plan and remaining query/scan credits. Check this before running credit-consuming operations.

Inputs: no named parameters.

shodan_cve_lookupCVE lookupA
Read-only

Fetch details for a specific CVE from Shodan's CVEDB, including CVSS score, affected CPEs, and how many internet-facing hosts Shodan currently sees running vulnerable versions.

Inputs: cve_id (required).

shodan_cves_by_productCVEs by productA
Read-only

List recent/known CVEs affecting a given CPE (product+version), e.g. 'cpe:2.3:a:apache:log4j'. Useful for tracking what's currently going on for a specific technology.

Inputs: cpe23 (required), limit.

shodan_dns_domainDomain DNS infoA
Read-only

Look up subdomains and DNS entries Shodan has seen for a domain. Use this to map out your own domain's exposed surface.

Inputs: domain (required).

shodan_dns_resolveResolve hostnamesB
Read-only

Resolve one or more hostnames to their IP addresses.

Inputs: hostnames (required).

shodan_dns_reverseReverse DNS lookupB
Read-only

Look up the hostnames associated with one or more IP addresses.

Inputs: ips (required).

shodan_host_countCount search resultsA
Read-only

Count how many hosts match a Shodan search query without spending query credits. Use this for quick world-scale stats (e.g. how many hosts expose a given CVE) before running a full search.

Inputs: query (required).

shodan_host_lookupHost lookupA
Read-only

Look up everything Shodan knows about a single IP address: open ports, banners, detected products/versions, and known vulnerabilities. Use this to check what your own infrastructure exposes.

Inputs: ip (required).

shodan_my_ipMy public IPA
Read-only

Returns the public IP address Shodan sees this API key's requests coming from. Use this as the starting point for scanning your own infrastructure.

Inputs: no named parameters.

shodan_search_filtersList search filtersA
Read-only

List the search filters Shodan supports (e.g. country, port, net, vuln, product). Use this before writing a shodan_search query to confirm the right filter name.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 11 tools

    Disambiguation5/5

    Each tool targets a distinct Shodan resource and action: CVE lookup, CVE-by-product, host count, DNS resolve/reverse/domain, host lookup, search, filters, account info, and my IP. There is no functional overlap; even similar tools like host_count and search are clearly differentiated by purpose.

    Naming Consistency4/5

    All tools share the 'shodan_' prefix and mostly follow a descriptive pattern of resource-action or resource-attribute (e.g., cve_lookup, dns_resolve, host_count). Minor exceptions like 'my_ip' and 'cves_by_product' are still predictable and readable.

    Tool Count5/5

    11 tools is a well-scoped count for a Shodan MCP server. It covers the major Shodan API surfaces (CVE, DNS, host, search, account) without unnecessary bloat or missing essentials.

    Completeness4/5

    The set covers the core Shodan workflows: search, host details, DNS reconnaissance, CVE intelligence, and credit management. Some advanced features like alerts or exploit lookups are absent, but the surface is complete enough for typical threat intelligence and infrastructure assessment tasks.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      MCP server for querying the Shodan API and Shodan CVEDB. This server provides tools for IP lookups, device searches, DNS lookups, vulnerability queries, CPE lookups, and more.
      7
      191
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      A WebSocket server that provides MCP interface for searching and retrieving information about internet-connected devices, IP addresses, DNS data, and CVE vulnerabilities through the Shodan API.
      3
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      This is a Model Context Protocol (MCP) server that provides access to the Shodan API. It allows you to programmatically query Shodan for information about devices, vulnerabilities, and more.
      2
      -