MCP Connector

Query Shodan for Device and Vulnerability Data

MCP server exposing the Shodan API for security research - device search, host intel, and CVE/vulnerability lookup.

Works with shodan

90
Spark score
out of 100
Updated Apr 2025
Version 1.0.0
Models
universal

Add to Favorites

Why it matters

Leverage the Shodan API to conduct in-depth security research, identify internet-connected devices, and detect vulnerabilities. This asset empowers security professionals to analyze device configurations, track threats, and gain comprehensive insights into the global attack surface.

Outcomes

What it gets done

01

Search Shodan for specific devices and services using advanced filters.

02

Retrieve detailed information about hosts, including banners and configurations.

03

Identify and analyze vulnerabilities associated with specific CVEs.

04

Perform DNS lookups and analyze domain information.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-shodan-mcp | bash

Capabilities

Tools your agent gets

test

Verify that the MCP server is working correctly

check_key

Validate your Shodan API key and view account information

search

Search the Shodan database with powerful filtering capabilities

count

Count query results without consuming API credits

get_filters

Retrieve all available Shodan search filters

get_facets

Get available facets for statistical analysis

host

Retrieve detailed information about a specific IP address

domain_info

Get DNS information and subdomains for a domain

+5 tools

Overview

Shodan MCP Server

An MCP server providing a comprehensive interface to the Shodan API for security research: device search and filtering, host and port intelligence, CVE/CPE vulnerability lookup with CVSS/EPSS scoring, and DNS/subdomain reconnaissance. Use when an AI assistant needs to query Shodan for exposed devices, host details, or vulnerability data; requires a Shodan API key and compliance with its terms of service.

What it does

SHODAN-MCP is an MCP server providing a comprehensive interface to the Shodan API, the search engine for internet-connected devices, for security researchers, penetration testers, and cybersecurity professionals to explore, analyze, and monitor the global internet landscape. It covers search and discovery, host intelligence, security research with CVE and vulnerability lookup, and network mapping via DNS intelligence.

When to use - and when NOT to

Use this when you want an AI assistant to query Shodan for exposed devices and services, pull detailed host, port, and banner information for an IP, look up CVE and CPE vulnerability data, or run DNS and subdomain reconnaissance - via natural language like "Find all exposed Jenkins servers in Germany" or "Check if 8.8.8.8 has any known vulnerabilities".

Not needed without a Shodan API key and account, or for security research that doesn't comply with applicable laws, Shodan's terms of service, and ethical standards for the field.

Capabilities

Thirteen commands across five categories. Core: test checks server connectivity, check_key verifies API key validity and account info. Search: search queries with Shodan's filtering syntax, count returns result counts without consuming API credits, get_filters and get_facets support statistical breakdowns. Host: host returns detailed IP information including services, banners, and configurations. DNS: domain_info returns DNS info and subdomains, dns_lookup and reverse_dns resolve between hostnames and IPs. Vulnerabilities: cve_info returns detailed CVE intelligence including CVSS and EPSS exploitation-likelihood scores, find_cpes and find_cves find vulnerabilities by product or CPE identifier.

How to install

Requires Python 3.8+ and a Shodan API key. Clone the repo, install dependencies, and set the key:

git clone https://github.com/yourusername/shodan-mcp.git
cd shodan-mcp
pip install -r requirements.txt
echo "SHODAN_API_KEY=your_api_key_here" > shodan-mcp-server/.env

uv is recommended for managing the Python environment. Configure in Claude Desktop (Settings > Developer > Edit Config, claude_desktop_config.json), Cursor (~/.cursor/mcp.json), or VS Code (settings.json), each pointing the command at your local uv binary with --directory /path/to/shodan-mcp/shodan-mcp-server run shodan_mcp.py as args. Built on FastMCP, the official Shodan Python client, HTTPX for async requests, and python-dotenv for environment-variable management. Some commands consume Shodan API credits; for bulk operations, the async batch methods are recommended to optimize performance. The project is MIT-licensed.

Who it's for

Security researchers, penetration testers, and cybersecurity professionals who want Shodan's internet-wide device and vulnerability intelligence available directly through Claude Desktop, Cursor, or VS Code via natural language, without switching to the Shodan website or writing API calls by hand.

Source README

๐ŸŒ SHODAN-MCP

License
Python
Status

๐Ÿ” Overview

SHODAN-MCP is a powerful interface to the Shodan API, designed to simplify interaction with the world's first search engine for Internet-connected devices. It provides a comprehensive set of tools for security researchers, penetration testers, and cybersecurity professionals to explore, analyze, and monitor the global internet landscape.

"The more systems you can access, the more power you have."

โœจ Key Features

๐Ÿ”Ž Search & Discovery

  • Advanced Search: Query the Shodan database using powerful filtering capabilities and multiple parameters
  • Result Analysis: Detailed breakdowns of search results with geographic distribution and organization insights
  • Count Function: Get total numbers and statistical breakdowns without consuming API credits

๐Ÿ“ก Host Intelligence

  • Detailed Host Information: Comprehensive data about any IP address including all services, banners and configurations
  • Port Scanning: View all open ports and running services on target systems
  • Banner Grabbing: Access complete service banners and headers for in-depth analysis

๐Ÿ”’ Security Research

  • Vulnerability Discovery: Find devices affected by specific CVEs or with particular vulnerabilities
  • CVE Information: Get detailed intelligence on Common Vulnerabilities and Exposures
  • Exploitation Risk Assessment: Evaluate threats with CVSS scores and EPSS exploitation likelihood metrics

๐ŸŒ Network Mapping

  • DNS Intelligence: Retrieve comprehensive DNS information and subdomain discovery
  • Domain Insights: Analyze domain infrastructure and associated services
  • Reverse DNS: Map IP addresses to hostnames for network enumeration

๐Ÿ› ๏ธ Installation & Setup

Prerequisites

  • Python 3.8 or higher
  • Shodan API key (Get one here)
  • pip or uv for dependency management

Basic Installation

# Clone the repository
git clone https://github.com/yourusername/shodan-mcp.git
cd shodan-mcp

# Install dependencies
pip install -r requirements.txt

# Set up your Shodan API key
echo "SHODAN_API_KEY=your_api_key_here" > shodan-mcp-server/.env

Integration Options

SHODAN-MCP can be integrated with various AI and development environments:

๐Ÿค– Claude Integration

Claude can interact with SHODAN-MCP using the MCP protocol:

  1. In Claude Desktop, go to Settings โ†’ Developer โ†’ Edit Config

  2. Edit the claude_desktop_config.json file and add the following configuration:

    "mcpServers": {
      "shodan": {
        "command": "/path/to/uv",
        "args": [
          "--directory",
          "/path/to/shodan-mcp/shodan-mcp-server",
          "run",
          "shodan_mcp.py"
        ]
      }
    }
    
  3. Replace /path/to/uv with your actual path to the uv executable (e.g., ~/.local/bin/uv on macOS/Linux)

  4. Replace /path/to/shodan-mcp with the actual path to your shodan-mcp project directory

  5. Save the configuration and restart Claude

  6. Now you can ask Claude to use Shodan tools directly in your conversations

๐Ÿ–ฅ๏ธ Cursor IDE Integration

Cursor seamlessly integrates with SHODAN-MCP through the MCP configuration file:

  1. The MCP configuration file is located at ~/.cursor/mcp.json (macOS/Linux)

  2. Add the following configuration to your mcp.json:

    {
      "mcpServers": {
        "shodan": {
          "command": "/path/to/uv",
          "args": [
            "--directory",
            "/path/to/shodan-mcp/shodan-mcp-server",
            "run",
            "shodan_mcp.py"
          ],
          "env": {}
        }
      }
    }
    
  3. Replace /path/to/uv with your actual path to the uv executable (e.g., ~/.local/bin/uv on macOS/Linux)

  4. Replace /path/to/shodan-mcp with the actual path to your shodan-mcp project directory

  5. Save the configuration and restart Cursor

  6. The Shodan MCP tools will now be available in your Cursor environment

๐Ÿ“ VSCode Integration

For VSCode users, add the following to your settings.json file:

  1. Open VS Code settings (โŒ˜+Shift+P, then type "Preferences: Open Settings (JSON)")

  2. Add the following configuration:

    "mcp": {
      "inputs": [],
      "servers": {
        "shodan": {
          "command": "/path/to/uv",
          "args": [
            "--directory",
            "/path/to/shodan-mcp/shodan-mcp-server",
            "run",
            "shodan_mcp.py"
          ],
          "env": {}
        }
      }
    }
    
  3. Replace /path/to/uv with your actual path to the uv executable (e.g., ~/.local/bin/uv on macOS/Linux or the full path on Windows)

  4. Replace /path/to/shodan-mcp with the actual path to your shodan-mcp project directory

  5. Save the settings and restart VS Code

  6. Access through the built-in AI features or command palette

Installation with UV

**uv is recommended for managing Python environments and dependencies due to its speed and reliability:

# Install uv if you don't have it
curl -sSf https://github.com/astral-sh/uv/releases/download/0.1.21/uv-installer.sh | sh

# Install project dependencies with uv
uv pip install -r requirements.txt

# Run the MCP server with uv
uv --directory /path/to/shodan-mcp/shodan-mcp-server run shodan_mcp.py

๐Ÿš€ Available Commands

Category Command Description
Core test Test if the MCP server is working correctly
Core check_key Verify Shodan API key validity and view account information
Search search Search the Shodan database with powerful filtering capabilities
Search count Count results for a query without consuming API credits
Search get_filters Get all available Shodan search filters
Search get_facets Get available facets for statistical analysis
Host host Get detailed information about a specific IP address
DNS domain_info Get DNS information and subdomains for a domain
DNS dns_lookup Resolve hostnames to IP addresses
DNS reverse_dns Find hostnames associated with IP addresses
Vulnerabilities cve_info Get detailed information about a specific CVE
Vulnerabilities find_cpes Find CPE identifiers for a specific product
Vulnerabilities find_cves Find vulnerabilities by product or CPE identifier

๐Ÿ“Š Example Usage

Integration with AI Assistants

SHODAN-MCP is designed to be used through AI assistants and IDEs that support the MCP protocol. You can interact with Shodan using natural language:

"Find all exposed Jenkins servers in Germany"
"Check if 8.8.8.8 has any known vulnerabilities"
"Show me the distribution of Nginx servers by country"
"List the top 5 countries with vulnerable MongoDB instances"
"Get DNS information for example.com"

Available Commands through MCP

Once configured in your IDE or AI assistant, SHODAN-MCP offers the following commands:

๐Ÿ’ป System Compatibility

Platform Supported Notes
macOS โœ… Tested on Intel & Apple Silicon (M1/M2/M3)
Linux โœ… Tested on Ubuntu 22.04
Windows โš ๏ธ Not fully tested, but should work in theory
Docker โš ๏ธ Support planned but not yet implemented
Cloud โš ๏ธ Support planned but not yet tested

Note: This project has been primarily developed and tested on macOS and Linux environments. Contributions to expand and test compatibility on other platforms are welcome!

๐Ÿ”ง Technical Architecture

SHODAN-MCP is built using:

  • FastMCP: High-performance async framework for API interactions
  • Shodan API Client: Official Python client for Shodan
  • HTTPX: Modern asynchronous HTTP client
  • Python-dotenv: For secure environment variable management
  • MCP Protocol: For seamless integration with AI assistants

The system uses an asynchronous architecture to provide high-performance, non-blocking API interactions, enabling efficient processing of multiple requests simultaneously.

๐Ÿ”‘ API Key Management

SHODAN-MCP uses the Shodan API key stored in a .env file in the project root. This approach keeps your API key secure and separate from the code.

  1. Get an API key: Sign up at Shodan to obtain your API key
  2. Create .env file: Create a .env file in the project root with the following content:
    SHODAN_API_KEY=your_api_key_here
    

The .env file is included in .gitignore to prevent your API key from being uploaded to public repositories. The project automatically loads the API key from this file using the python-dotenv library.

Security note: Never share your Shodan API key or include it in files that might be uploaded to public repositories.

๐Ÿ›ก๏ธ Security & Ethics

This tool is designed for legitimate security research and defensive purposes. Users are responsible for ensuring they comply with:

  • Applicable laws and regulations
  • Shodan's terms of service
  • Ethical standards for security research

Always obtain proper authorization before scanning or analyzing systems you don't own.

๐Ÿ“š Usage Notes

  • Some commands consume Shodan API credits (see Shodan pricing)
  • Results provide comprehensive intelligence for analysis
  • Data is presented in a structured, readable format
  • Advanced formatting instructions ensure clarity of technical details
  • For bulk operations, consider using the async batch methods to optimize performance

๐Ÿ”ฎ Upcoming Features

The following features are planned for future releases:

  • Markdown Report Generation: Automatically create comprehensive reports in Markdown format for all queries
  • Batch Processing: Process multiple queries in parallel for improved efficiency
  • Advanced Visualization: Visual representations of search results and networks
  • Docker Container: Ready-to-use containerized version for easier deployment
  • Cross-Platform Testing: Expanded testing and support for Windows and other platforms

๐Ÿ‘ฅ Contributions Welcome!

This project was created by a security enthusiast, not a professional developer. There are many areas that could benefit from improvement, and contributions of all kinds are welcome!

Areas Needing Improvement

  • Code Quality: Refactoring and optimization
  • Error Handling: More robust error handling and recovery
  • Documentation: Expanded examples and use cases
  • Testing: Unit tests and integration tests
  • UI Development: A simple web interface for non-programmers
  • Cross-Platform Support: Testing and fixes for Windows and other platforms

If you'd like to contribute, please feel free to submit pull requests or open issues with suggestions. No contribution is too small, and all help is greatly appreciated!

๐Ÿ› Troubleshooting

Issue Solution
API Key errors Verify your key is valid and correctly configured
Rate limiting Implement exponential backoff or upgrade your Shodan plan
Module not found Ensure all dependencies are installed correctly
Integration issues Check your MCP paths and configurations
Timeout errors Increase timeout settings for large queries

๐ŸŒŸ Credits

  • Powered by me ๐Ÿ˜‡ using Shodan API - The Internet's Search Engine
  • Developed using Python's async architecture for optimal performance
  • MCP protocol specification by Anthropic

SHODAN-MCP: See everything. Know everything.

0xh3l1x creation

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.