shodan-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., "@shodan-mcp Look up host 45.33.32.156 and list any known vulnerabilities"
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.
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 installRegister it with Claude Code:
claude mcp add shodan -s user -e SHODAN_API_KEY=your-key-here -- node /absolute/path/to/index.jsOr run it standalone (it speaks MCP over stdio):
SHODAN_API_KEY=your-key-here node index.jsA 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_KEYRelated MCP server: Shodan MCP Server
Tools
Tool | What it does |
| Public IP Shodan sees this API key's requests coming from. Starting point for scanning your own infrastructure. |
| Full Shodan record for one IP: open ports, banners, detected products/versions, known vulnerabilities. |
| Search Shodan's device database using Shodan search syntax ( |
| CVE details from Shodan's CVEDB: CVSS score, affected CPEs, how many exposed hosts Shodan currently sees. |
| CVEs affecting a given CPE (product + version). |
| Count hosts matching a search query without spending query credits. |
| List the search filters Shodan supports (country, port, net, vuln, ...). |
| Subdomains and DNS entries Shodan has seen for a domain. |
| Resolve hostnames to IP addresses. |
| Reverse-resolve IP addresses to hostnames. |
| 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 thepageargument.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 addoutput) ends up stored.
License
MIT
Available Tools
11 toolsshodan_account_infoAccount plan and creditsARead-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 lookupARead-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 productARead-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 infoARead-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 hostnamesBRead-only
Resolve one or more hostnames to their IP addresses.
Inputs: hostnames (required).
shodan_dns_reverseReverse DNS lookupBRead-only
Look up the hostnames associated with one or more IP addresses.
Inputs: ips (required).
shodan_host_countCount search resultsARead-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 lookupARead-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 IPARead-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_searchSearch ShodanARead-only
Search Shodan's database of internet-connected devices using Shodan search syntax (e.g. 'apache country:DE', 'net:203.0.113.0/24', 'vuln:CVE-2021-44228'). Use this for general reconnaissance and world-scale intelligence gathering.
Inputs: query (required), page.
shodan_search_filtersList search filtersARead-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
Scored across 11 tools
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.
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.
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.
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
Related MCP Connectors
Unofficial Shodan MCP — wraps the full Shodan REST API (api.shodan.io)
Unofficial Shodan InternetDB MCP — wraps Shodan InternetDB (internetdb.shodan.io)
MCP server for the Vulners.com API
Defensive Shodan search and host intelligence MCP using customer-provided SHODAN_API_KEY for
Related MCP Servers
- AlicenseAqualityBmaintenanceMCP 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.7191MIT
- FlicenseNot gradedqualityDmaintenanceA 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-
- FlicenseNot gradedqualityDmaintenanceThis 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-
- FlicenseNot gradedqualityBmaintenancePassive reconnaissance MCP server powered by Shodan, enabling host lookups, search, and DNS queries gated against HackerOne scope snapshots.-