Shodan

io.github.w0h1v由 GitHub 账号 w0h1v 发布v1.0.37更新于 Nov 5, 2026

MCP server for Shodan API — device search, IP and domain recon, DNS, and CVE/CPE queries.

概览

AI 生成的概览

Shodan MCP 服务器,让助手查询主机信息、搜索联网设备、解析 DNS,并检索 CVE/CPE 漏洞数据。

可以做什么
  • 查询单个 IP 的开放端口、服务、漏洞、TLS 证书、地理位置与云厂商信息
  • 用查询语法搜索 Shodan 设备库,支持分页与分面统计,也可免费获取匹配数量
  • 枚举域名的子域名与 DNS 记录,并批量做正向与反向 DNS 解析
  • 查询 CVEDB 获取 CVE 详情(CVSS、EPSS、KEV 状态),查找 CPE 标识,按产品或 CPE 列出漏洞
  • 查看 API 套餐与剩余查询、扫描额度,并列出可用的搜索过滤器和分面
适用场景
适合安全与网络侦察类工作:评估某个 IP 或域名的暴露面、确认某 CVE 是否已被在野利用、查找受影响的产品与版本。也适合在对话中做资产发现和漏洞研判。
运行要求
以 Node.js 包形式在本地运行(需 Node.js 20 或更高版本),默认使用 stdio;设置 MCP_TRANSPORT 后可作为 HTTP 流式服务运行。需要 SHODAN_API_KEY 环境变量中的 Shodan API 密钥,并能访问 Shodan 网络。带过滤条件的搜索需要会员或付费 API 套餐。
安装前请注意
Shodan API 密钥是可计费凭证:带过滤条件的 shodan_search 查询和 domain_info 调用会消耗查询额度,密钥被滥用会花掉套餐额度。可选的 HTTP 传输没有身份验证,能访问该端口的人都能消耗额度,应只绑定本机或置于带认证的反向代理之后。查询内容会发送给 Shodan,密钥仅发送至 api.shodan.io。工具均为只读。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Shodan,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[MCP Shodan: network intelligence for AI agents. Internet reconnaissance, DNS intelligence and CVE analysis over the Model Context Protocol.]

[npm version] [CI] [License: MIT] [Node 20 or newer] [MCP Registry]

Quickstart · Tools · HTTP · Security · Troubleshooting · Docs

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.

[!NOTE] Independent project, not affiliated with Shodan. You need your own Shodan 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_info shows 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.

How it works

mermaid
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"| A

Quickstart

Requirements: Node.js 20 or newer and a Shodan API key.

sh
# Claude Codeclaude mcp add --transport stdio --env SHODAN_API_KEY=your-key shodan -- npx -y @burtthecoder/mcp-shodan
# Codex CLIcodex mcp add shodan --env SHODAN_API_KEY=your-key -- npx -y @burtthecoder/mcp-shodan
# Gemini CLIgemini mcp add -e SHODAN_API_KEY=your-key shodan npx -y @burtthecoder/mcp-shodan

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

GroupToolWhat it does
Networkip_lookupPorts, products, CVEs, TLS, location and cloud for one IP, optionally with banner history
shodan_searchSearch devices with Shodan query syntax, with paging and facet breakdowns
shodan_countTotal matches and facet breakdowns for a query, without results (free)
domain_infoSubdomains and DNS records for a domain
dns_lookupResolve hostnames to IPs, in batch
reverse_dns_lookupHostnames for IPs, in batch
Vulnerabilities (CVEDB)cve_lookupCVSS, EPSS, KEV, references and affected CPEs for one CVE
cpe_lookupCPE 2.3 identifiers for a product name
cves_by_productCVEs for a product or CPE, filterable by KEV and date, sortable by EPSS
Helperssearch_filtersValid search filter and facet names
api_infoYour plan and remaining query and scan credits

[!TIP] Credits: filtered shodan_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:

sh
MCP_TRANSPORT=httpStream MCP_PORT=3000 SHODAN_API_KEY=your-key node build/index.js
sh
docker build -t mcp-shodan .docker run -p 127.0.0.1:3000:3000 -e SHODAN_API_KEY=your-key -e MCP_TRANSPORT=httpStream mcp-shodan

A health check is served at /health.

Environment variables

VariableDefaultDescription
SHODAN_API_KEY(required)Your Shodan API key
MCP_TRANSPORTstdiostdio or httpStream
MCP_HOSTlocalhostBind address (httpStream only). The Docker image sets 0.0.0.0
MCP_PORT3000HTTP port (httpStream only)
MCP_ENDPOINT/mcpHTTP endpoint path (httpStream only)

Security

[!WARNING] The HTTP transport has no 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 match CVE-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. Run api_info to see your plan and credits.
  • 429: Shodan allows about one request per second. Retry after a moment.

More in the troubleshooting guide.

Development

sh
git clone https://github.com/w0h1v/mcp-shodan && cd mcp-shodannpm cinpm test                          # build + unit tests, no key or networknpx fastmcp dev build/index.js    # try tools interactively (needs SHODAN_API_KEY)

See CONTRIBUTING.md and the changelog.

License

MIT. See LICENSE.

来源:README.md,提交 422483a

工具

11

ip_lookup

Retrieve comprehensive information about an IP address, including geolocation, operating system, open ports, running services (product, version, CPE), known vulnerabilities (CVEs), SSL certificates, hostnames, and cloud provider details if available. Returns service banners and HTTP server information when present. Optional history returns historical banners; minify omits banners.

输入参数ip必填minifyhistory

cve_lookup

Query detailed vulnerability information from Shodan's CVEDB. Returns comprehensive CVE details including CVSS scores (v4/v3/v2), EPSS probability and ranking, KEV status, proposed mitigations, ransomware associations, and affected products (CPEs).

输入参数cve必填

dns_lookup

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.

输入参数hostnames必填

reverse_dns_lookup

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.

输入参数ips必填

cpe_lookup

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.

输入参数skipcountlimitproduct必填

cves_by_product

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.

输入参数skipcountcpe23limitis_kevproductend_datestart_datesort_by_epss

shodan_count

Get the total number of Shodan results for a query, with optional facet breakdowns (e.g. by country, org, port). Free: does not consume query credits. Use search_filters to list valid filters and facets.

输入参数query必填facets

domain_info

Get subdomains and DNS records for a domain from Shodan. Costs 1 query credit per lookup.

输入参数pagetypedomain必填history

api_info

Show the Shodan API plan, remaining query and scan credits, monitored IPs, and usage limits for the configured API key. Free: does not consume credits.

无需输入参数。

search_filters

List the search filters and facets Shodan supports. Use this to build valid shodan_search and shodan_count queries and facets. Free: does not consume credits.

无需输入参数。

版本历史

3
  1. v1.0.37最新Nov 5, 2026
  2. v1.0.34Oct 12, 2026
  3. v1.0.31Sep 16, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分