Get the FREE Ultimate OpenClaw Setup Guide →

Shodan

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

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio x3r0k-shodan-mcp-server node /path/to/shodan-mcp-server/build/index.js \
  --env SHODAN_API_KEY="<your_shodan_api_key>"

How to use

The Shodan MCP Server exposes a set of MCP tools that let you query Shodan for host information, DNS lookups, CVE details, and vulnerability data. You can call these tools through the MCP SDK (e.g., @modelcontextprotocol/sdk) from your application to fetch structured JSON results without interacting with Shodan directly. The available tools are: get_ip_info to retrieve details about a specific IP, dns_lookup to resolve domain names, get_vulnerabilities to list vulnerabilities associated with an IP, cve_info to fetch data for a particular CVE, and search to run Shodan-style queries against devices and services. To use them, configure the MCP server in your MCP settings, then invoke the tools by name (e.g., shodan, get_ip_info) with the appropriate input payloads. The server expects inputs as standard JSON objects, and returns structured JSON responses you can consume in your application.

How to install

Prerequisites:

  • Node.js (version 14+ recommended) and npm
  • Git
  • A Shodan API key

Installation steps:

  1. Clone the repository git clone https://github.com/X3r0K/Shodan-MCP-Server.git cd Shodan-MCP-Server

  2. Install dependencies npm install

  3. Build the project (if applicable) npm run build

  4. Obtain and configure your Shodan API key in your MCP settings (see Configuration section in README):

    • You should set the SHODAN_API_KEY environment variable when launching the server or via your MCP settings file.
  5. Run the server (example) node /path/to/shodan-mcp-server/build/index.js

  6. Optional: Add to your MCP settings.json { "mcpServers": { "shodan": { "command": "node", "args": ["/path/to/shodan-mcp-server/build/index.js"], "env": { "SHODAN_API_KEY": "<your_shodan_api_key>" }, "disabled": false, "autoApprove": [] } } }

Additional notes

Tips and considerations:

  • Keep your SHODAN_API_KEY secure; do not commit it to version control. Prefer environment variables or secret managers when deploying.
  • If you rebuild the project, ensure the built index.js path in the MCP config is updated to the new location.
  • The MCP SDK usage example in the README demonstrates calling get_ip_info; other tools (dns_lookup, get_vulnerabilities, cve_info, search) follow the same pattern: use_mcp_tool('shodan', '<tool_name>', <payload>) and handle the JSON response.
  • If you encounter rate limits from Shodan, consider caching results where appropriate within your application logic.
  • Ensure your MCP client and server timeouts are configured to handle network latency when querying the external API.
  • Validate inputs before sending to the MCP server to avoid unnecessary API calls.
  • Monitor environment variables for sensitive data and rotate keys as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers