Shodan

io.github.BurtTheCoder由 GitHub 帳號 BurtTheCoder 發布v1.0.22更新於 Oct 24, 2026

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

概覽

AI 產生的概覽

此 MCP 伺服器讓 AI 助理以唯讀方式存取 Shodan 與 Shodan CVEDB,用於主機偵察、裝置搜尋、DNS 與漏洞查詢。

可以做什麼
查詢單一 IPv4 或 IPv6 主機:開放連接埠、產品、CVE、TLS 憑證、位置與雲端資訊,可選擇附上 banner 歷史,並查看方案剩餘額度與可用的搜尋篩選條件及分面。依 Shodan 查詢語法搜尋裝置,支援分頁與分面統計,或只取得符合筆數與分面。解析 DNS:網域的子網域與記錄,以及批次正向與反向解析。查詢 CVEDB:CVE 詳細資料含 CVSS、EPSS 與 KEV,依產品名稱查 CPE 識別碼,以及依產品或 CPE 查 CVE 並依 EPSS 排序。
適用情境
適合在資安研究或排查時需要評估某主機或網域的暴露面、估算或執行 Shodan 裝置搜尋,或取得某個 CVE 或產品的漏洞嚴重度與利用情形時使用。
執行需求
透過 npm 套件以 stdio 在本機執行,需要 Node.js 20 或更新版本。需要自備 Shodan API 金鑰,透過環境變數 SHODAN_API_KEY 提供,並需能連線至 Shodan 的網路。選用的 HTTP 串流模式由 MCP_TRANSPORT、MCP_HOST、MCP_PORT 與 MCP_ENDPOINT 設定。
安裝前請注意
SHODAN_API_KEY 是密鑰,從環境讀取並傳送給 Shodan;你查詢的內容也會傳送給 Shodan。付費工具會消耗查詢額度:帶篩選條件的 shodan_search 每次消耗一個額度,每多一頁再加一個,domain_info 每次呼叫消耗一個。選用的 HTTP 傳輸沒有身分驗證,任何能連到該連接埠的人都能消耗你的額度,應只綁定 localhost 或置於具驗證的反向代理之後。工具皆為唯讀。

安裝

在 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] [Smithery]

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, Smithery 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,提交 08bf8ee

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.22最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分