Shodan

Security

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

Your AI app calls the Shodan MCP server, which does the security work and sends the result back to the chat.

About Shodan

Shodan is a community MCP server from w0h1v, filed in our directory under security. MCP server for Shodan API, device search, IP and domain recon, DNS, and CVE/CPE queries.

Shodan runs on your own machine: your AI app starts it with the command npx -y @burtthecoder/mcp-shodan@1.0.41 and talks to it over standard input and output. It needs SHODAN_API_KEY set before Shodan starts.

Shodan is listed in the official MCP registry as io.github.w0h1v/shodan, version 1.0.41.

At a glance

Publisher
w0h1v (community)
Runs
Locally on your machine
Install from
Node.js package on npm: @burtthecoder/mcp-shodan
Written in
TypeScript
License
MIT
GitHub stars
194
Official MCP registry
io.github.w0h1v/shodan

How to set up Shodan

  1. Install Node.js on the machine that runs your AI app, because Shodan starts with npx and downloads its package on first run.
  2. Create SHODAN_API_KEY for Shodan in the connected service's own settings, scoped to the smallest permissions the job needs.
  3. Add Shodan to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Shodan tools to confirm the connection.
  5. Run one read-only task with Shodan first, and keep your app asking before each tool call until the results look right.

Shodan compared with similar servers

  • Raindrop by adeze has fewer GitHub stars than Shodan (191 against 194); both are community servers, and both run locally.
  • Dev Machine Guard by step-security has more GitHub stars than Shodan (199 against 194); both are community servers, and both run locally.
  • Ida MCP Server Plugin by taida957789 has fewer GitHub stars than Shodan (190 against 194); both are community servers, and both run locally.

Before you connect Shodan

  • Give Shodan its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Shodan tool call until you trust what it does with them.
  • Treat text that Shodan fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Shodan on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Shodan

How marketing and sales teams put Shodan to work, by company size. Pick the size closest to yours and start Shodan on one use case.

Small business

  • A small business can use Shodan to check its domains, logins and site for common gaps before they cost a customer's trust.
  • Owners can ask Shodan whether a tool or vendor has known issues before connecting it to customer data.
  • Shodan runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Marketing ops can use Shodan to review what each connected app can access and remove keys nobody uses.
  • Security and web teams can connect Shodan to scan campaign sites and forms before launch, not after an incident.
  • Start Shodan on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises can run Shodan in the security team's tooling, so marketing's agents and apps are reviewed like any other system.
  • Large orgs can use Shodan to keep evidence for audits, showing which agents reached which data and when.
  • Shodan is a community server, so have security review the code and pin a version before Shodan touches company data.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Shodan README

From w0h1v/mcp-shodan on GitHub, shared under its MIT license. Images are left out; the original has them.

README.md

Quickstart · Tools · HTTP · Security · Troubleshooting · Docs (w0h1v.github.io/mcp-shodan)

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

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.

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

Group Tool What it does
Network ip_lookup Ports, products, CVEs, TLS, location and cloud for one IP, optionally with banner history
shodan_search Search devices with Shodan query syntax, with paging and facet breakdowns
shodan_count Total matches and facet breakdowns for a query, without results (free)
domain_info Subdomains and DNS records for a domain
dns_lookup Resolve hostnames to IPs, in batch
reverse_dns_lookup Hostnames for IPs, in batch
Vulnerabilities (CVEDB) cve_lookup CVSS, EPSS, KEV, references and affected CPEs for one CVE
cpe_lookup CPE 2.3 identifiers for a product name
cves_by_product CVEs for a product or CPE, filterable by KEV and date, sortable by EPSS
Helpers search_filters Valid search filter and facet names
api_info Your 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:

MCP_TRANSPORT=httpStream MCP_PORT=3000 SHODAN_API_KEY=your-key node build/index.js
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

Variable Default Description
SHODAN_API_KEY (required) Your Shodan API key
MCP_TRANSPORT stdio stdio or httpStream
MCP_HOST localhost Bind address (httpStream only). The Docker image sets 0.0.0.0
MCP_PORT 3000 HTTP port (httpStream only)
MCP_ENDPOINT /mcp HTTP 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

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.

Questions about Shodan

What is the Shodan MCP server?

MCP server for Shodan API, device search, IP and domain recon, DNS, and CVE/CPE queries. Shodan is maintained by w0h1v on GitHub at w0h1v/mcp-shodan, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Shodan MCP server?

Add Shodan to your AI app's MCP config with the command npx -y @burtthecoder/mcp-shodan@1.0.41. In Claude Code, run claude mcp add --transport stdio shodan -- npx -y @burtthecoder/mcp-shodan@1.0.41. To run Shodan this way you need Node.js installed.

Does Shodan need an API key?

Yes. Shodan expects SHODAN_API_KEY to be set. Create the key for Shodan in the connected service's own settings, give it the smallest permissions the job needs, and keep it out of shared config files.

Is Shodan an official MCP server?

No. Shodan is a community server maintained by w0h1v. Community servers can be excellent; read the code and the open issues before you give Shodan access to company data.

What license is Shodan under?

Shodan is released under the MIT license, according to its GitHub repository. The license covers the code of Shodan; the service it connects to has its own terms.