mcp-shodan
Read-only Shodan intelligence server for AI agents: it can perform IP reconnaissance, device searches, CVE/CPE analysis, and DNS lookups.
Look up an IP's geolocation, open ports, services, banners, TLS certificates, hostnames, CVEs, and cloud details.
Search Shodan's internet-device database with query syntax and a result limit.
Retrieve CVE details from Shodan CVEDB, including CVSS, EPSS, KEV, mitigations, ransomware links, and affected CPEs.
Resolve multiple hostnames to IPs and reverse-resolve multiple IPs to hostnames.
Search CPE 2.3 entries by product, with pagination, limits, and count-only mode.
Find CVEs by product or CPE, filter by KEV/date, sort by EPSS, and paginate/count results.
Requires Node.js v18 or later as a runtime environment for the MCP server.
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., "@mcp-shodan look up CVE-2021-44228 details"
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.
mcp-shodan is an MCP server that gives AI agents access to the Shodan API and Shodan CVEDB. Hand your agent an IP, hostname, search query, product or CVE and get back what an analyst would look at: open ports and banners, TLS certificates, DNS, and vulnerability severity with EPSS and KEV status.
Independent project, not affiliated with Shodan. You need your ownShodan API key.
Highlights
Host reconnaissance. Open ports, products and versions, known CVEs, TLS certificate details (fingerprint, JARM, JA3S), cloud provider and banner history for any IPv4 or IPv6 address.
Device search. Shodan query syntax with paging and facet breakdowns (country, org, port, vuln and more), plus a free count-only mode for sizing a query.
Vulnerability intelligence. CVE details with CVSS v4/v3/v2, EPSS and KEV; CVEs by product or CPE, sortable by EPSS. CVEDB is free and doesn't spend query credits.
DNS. Subdomains and DNS records for a domain, and forward and reverse lookups for many names or IPs in one call.
Credit-aware. Free tools are marked as free, and
api_infoshows the credits left on your plan.Two transports. stdio for desktop clients, HTTP streaming for a shared service.
Tested. Unit tests with a mocked Shodan API run in CI on Node 20, 22 and 24.
Related MCP server: Shodan-MCP-Server
How it works
flowchart LR
A["AI agent<br/>(Claude, Codex, Gemini, VS Code)"] -->|"MCP over stdio or HTTP"| S["mcp-shodan"]
S -->|"validate input,<br/>HTTPS + API key"| SH["Shodan REST API"]
S -->|"HTTPS, no key"| C["Shodan CVEDB"]
SH -->|"JSON"| S
C -->|"JSON"| S
S -->|"structured JSON text"| AQuickstart
Requirements: Node.js 20 or newer and a Shodan API key.
# Claude Code
claude mcp add --transport stdio --env SHODAN_API_KEY=your-key shodan -- npx -y @burtthecoder/mcp-shodan
# Codex CLI
codex mcp add shodan --env SHODAN_API_KEY=your-key -- npx -y @burtthecoder/mcp-shodan
# Gemini CLI
gemini mcp add -e SHODAN_API_KEY=your-key shodan npx -y @burtthecoder/mcp-shodanFor Claude Desktop, VS Code and running from source, see Connect a client.
Then ask your agent: "What is exposed on 8.8.8.8, and is CVE-2021-44228 in the KEV catalog?" More prompts are in example workflows.
Tools
Eleven read-only tools. Full parameters are in the tool reference.
Group | Tool | What it does |
Network |
| Ports, products, CVEs, TLS, location and cloud for one IP, optionally with banner history |
| Search devices with Shodan query syntax, with paging and facet breakdowns | |
| Total matches and facet breakdowns for a query, without results (free) | |
| Subdomains and DNS records for a domain | |
| Resolve hostnames to IPs, in batch | |
| Hostnames for IPs, in batch | |
Vulnerabilities (CVEDB) |
| CVSS, EPSS, KEV, references and affected CPEs for one CVE |
| CPE 2.3 identifiers for a product name | |
| CVEs for a product or CPE, filterable by KEV and date, sortable by EPSS | |
Helpers |
| Valid search filter and facet names |
| Your plan and remaining query and scan credits |
Credits: filteredshodan_search queries cost one query credit (plus one per extra page) and domain_info costs one per call. shodan_count, ip_lookup, dns_lookup, reverse_dns_lookup, search_filters, api_info and the CVEDB tools are free.
HTTP streaming transport
stdio is the default. Set MCP_TRANSPORT=httpStream to run a standalone HTTP service:
MCP_TRANSPORT=httpStream MCP_PORT=3000 SHODAN_API_KEY=your-key node build/index.jsdocker build -t mcp-shodan .
docker run -p 127.0.0.1:3000:3000 -e SHODAN_API_KEY=your-key -e MCP_TRANSPORT=httpStream mcp-shodanA health check is served at /health.
Environment variables
Variable | Default | Description |
| (required) | Your Shodan API key |
|
|
|
|
| Bind address ( |
|
| HTTP port ( |
|
| HTTP endpoint path ( |
Security
The HTTP transport hasno authentication. Keep the port on localhost or behind an authenticating reverse proxy, or anyone who can reach it can spend your query credits.
Tool arguments are validated with zod schemas before any request is built. IPs must be valid IPv4 or IPv6, domains valid hostnames, facets
name[:count]lists, and CVE IDs must matchCVE-YYYY-NNNN.The API key is read from the environment and sent only to
api.shodan.io. CVEDB calls carry no key.What you look up is sent to Shodan.
Report vulnerabilities privately; see SECURITY.md.
Troubleshooting
401 / invalid key: check for spaces or quotes around the key, then restart the client.
curl "https://api.shodan.io/api-info?key=$SHODAN_API_KEY"shows your plan and credits.403 on
shodan_search: search filters need a membership or paid API plan. Runapi_infoto see your plan and credits.429: Shodan allows about one request per second. Retry after a moment.
More in the troubleshooting guide.
Development
git clone https://github.com/w0h1v/mcp-shodan && cd mcp-shodan
npm ci
npm test # build + unit tests, no key or network
npx fastmcp dev build/index.js # try tools interactively (needs SHODAN_API_KEY)See CONTRIBUTING.md and the changelog.
License
MIT. See LICENSE.
Available Tools
7 toolscpe_lookupARead-only
Search for Common Platform Enumeration (CPE) entries by product name in Shodan's CVEDB. Supports pagination and can return either full CPE details or just the total count. Useful for identifying specific versions and configurations of software and hardware.
Inputs: product (required), skip, count, limit.
cve_lookupARead-only
Query detailed vulnerability information from Shodan's CVEDB. Returns comprehensive CVE details including CVSS scores (v2/v3), EPSS probability and ranking, KEV status, proposed mitigations, ransomware associations, and affected products (CPEs).
Inputs: cve (required).
cves_by_productARead-only
Search for vulnerabilities affecting specific products or CPEs. Supports filtering by KEV status, sorting by EPSS score, date ranges, and pagination. Can search by product name or CPE 2.3 identifier. Returns detailed vulnerability information including severity scores and impact assessments.
Inputs: skip, count, cpe23, limit, +5 more.
dns_lookupARead-only
Resolve domain names to IP addresses using Shodan's DNS service. Supports batch resolution of multiple hostnames in a single query. Returns IP addresses mapped to their corresponding hostnames.
Inputs: hostnames (required).
ip_lookupARead-only
Retrieve comprehensive information about an IP address, including geolocation, open ports, running services, SSL certificates, hostnames, and cloud provider details if available. Returns service banners and HTTP server information when present.
Inputs: ip (required).
reverse_dns_lookupARead-only
Perform reverse DNS lookups to find hostnames associated with IP addresses. Supports batch lookups of multiple IP addresses in a single query. Returns all known hostnames for each IP address, with clear indication when no hostnames are found.
Inputs: ips (required).
shodan_searchBRead-only
Search Shodan's database of internet-connected devices. Returns detailed information about matching devices including services, vulnerabilities, and geographic distribution. Supports advanced search filters and returns country-based statistics.
Inputs: query (required), max_results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools are clearly distinct: ip_lookup, shodan_search, dns_lookup, and reverse_dns_lookup each target a different resource. However, cve_lookup and cves_by_product both return vulnerability information, which could cause some confusion despite their different query approaches.
Tool names mostly follow a consistent noun-based pattern (ip_lookup, dns_lookup, cve_lookup, cpe_lookup) with descriptive compound names for searches. The mix of 'lookup' and 'search' verbs is a minor inconsistency, but the pattern is still predictable and readable.
Seven tools is well-scoped for a Shodan-focused server, covering IP intelligence, device search, DNS, and vulnerability data without unnecessary bloat. Each tool serves a distinct purpose within the security research domain.
The tool set covers core Shodan functionality: IP lookup, device search, DNS resolution, and CVE/CPE vulnerability research. Minor gaps exist such as account/API info or network/port-specific queries, but the primary workflows for security research are well covered.
Maintenance
Related MCP Connectors
Shodan InternetDB MCP — wraps Shodan InternetDB (internetdb.shodan.io)
Shodan MCP — wraps the full Shodan REST API (api.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
- 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.-
- AlicenseBqualityDmaintenanceMCP server that exposes Shodan API for host information, search, alerts, scanning, and exploit data.2036 PyPI1MIT
Appeared in Searches
- Information on LinkedIn Business or LinkedIn Advertising
- Information about the VIX (Volatility Index)
- Accessing Clearbit APIs for Company Information and Website Visitor Data
- A guide to finding data in public databases
- How to retrieve information about a device using Microsoft Defender, Intune, and Jamf