A Model Context Protocol (MCP) server for querying the Shodan API and Shodan CVEDB. This server provides comprehensive access to Shodan's network intelligence and security services, including IP reconnaissance, DNS operations, vulnerability tracking, and device discovery. All tools provide structured, formatted output for easy analysis and integration. To install Shodan Server for Claude Desktop a
Add this skill
npx mdskills install BurtTheCoder/mcp-shodanWell-documented MCP server with comprehensive Shodan API integration and clear tool descriptions
1# Shodan MCP Server23[](https://smithery.ai/server/@burtthecoder/mcp-shodan)45A Model Context Protocol (MCP) server for querying the [Shodan API](https://shodan.io) and [Shodan CVEDB](https://cvedb.shodan.io). This server provides comprehensive access to Shodan's network intelligence and security services, including IP reconnaissance, DNS operations, vulnerability tracking, and device discovery. All tools provide structured, formatted output for easy analysis and integration.67<a href="https://glama.ai/mcp/servers/79uakvikcj"><img width="380" height="200" src="https://glama.ai/mcp/servers/79uakvikcj/badge" /></a>89## Quick Start (Recommended)1011### Installing via Smithery1213To install Shodan Server for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@burtthecoder/mcp-shodan):1415```bash16npx -y @smithery/cli install @burtthecoder/mcp-shodan --client claude17```1819### Installing Manually201. Install the server globally via npm:21```bash22npm install -g @burtthecoder/mcp-shodan23```24252. Add to your Claude Desktop configuration file:26```json27{28 "mcpServers": {29 "shodan": {30 "command": "mcp-shodan",31 "env": {32 "SHODAN_API_KEY": "your-shodan-api-key"33 }34 }35 }36}37```3839Configuration file location:40- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`41- Windows: `%APPDATA%\Claude\claude_desktop_config.json`42433. Restart Claude Desktop4445## Alternative Setup (From Source)4647If you prefer to run from source or need to modify the code:48491. Clone and build:50```bash51git clone https://github.com/BurtTheCoder/mcp-shodan.git52cd mcp-shodan53npm install54npm run build55```56572. Add to your Claude Desktop configuration:58```json59{60 "mcpServers": {61 "shodan": {62 "command": "node",63 "args": ["/absolute/path/to/mcp-shodan/build/index.js"],64 "env": {65 "SHODAN_API_KEY": "your-shodan-api-key"66 }67 }68 }69}70```7172## Features7374- **Network Reconnaissance**: Query detailed information about IP addresses, including open ports, services, and vulnerabilities75- **DNS Operations**: Forward and reverse DNS lookups for domains and IP addresses76- **Vulnerability Intelligence**: Access to Shodan's CVEDB for detailed vulnerability information, CPE lookups, and product-specific CVE tracking77- **Device Discovery**: Search Shodan's database of internet-connected devices with advanced filtering7879## Tools8081### 1. IP Lookup Tool82- Name: `ip_lookup`83- Description: Retrieve comprehensive information about an IP address, including geolocation, open ports, running services, SSL certificates, hostnames, and cloud provider details if available84- Parameters:85 * `ip` (required): IP address to lookup86- Returns:87 * IP Information (address, organization, ISP, ASN)88 * Location (country, city, coordinates)89 * Services (ports, protocols, banners)90 * Cloud Provider details (if available)91 * Associated hostnames and domains92 * Tags9394### 2. Shodan Search Tool95- Name: `shodan_search`96- Description: Search Shodan's database of internet-connected devices97- Parameters:98 * `query` (required): Shodan search query99 * `max_results` (optional, default: 10): Number of results to return100- Returns:101 * Search summary with total results102 * Country-based distribution statistics103 * Detailed device information including:104 - Basic information (IP, organization, ISP)105 - Location data106 - Service details107 - Web server information108 - Associated hostnames and domains109110### 3. CVE Lookup Tool111- Name: `cve_lookup`112- Description: Query detailed vulnerability information from Shodan's CVEDB113- Parameters:114 * `cve` (required): CVE identifier in format CVE-YYYY-NNNNN (e.g., CVE-2021-44228)115- Returns:116 * Basic Information (ID, published date, summary)117 * Severity Scores:118 - CVSS v2 and v3 with severity levels119 - EPSS probability and ranking120 * Impact Assessment:121 - KEV status122 - Proposed mitigations123 - Ransomware associations124 * Affected products (CPEs)125 * References126127### 4. DNS Lookup Tool128- Name: `dns_lookup`129- Description: Resolve domain names to IP addresses using Shodan's DNS service130- Parameters:131 * `hostnames` (required): Array of hostnames to resolve132- Returns:133 * DNS resolutions mapping hostnames to IPs134 * Summary of total lookups and queried hostnames135136### 5. Reverse DNS Lookup Tool137- Name: `reverse_dns_lookup`138- Description: Perform reverse DNS lookups to find hostnames associated with IP addresses139- Parameters:140 * `ips` (required): Array of IP addresses to lookup141- Returns:142 * Reverse DNS resolutions mapping IPs to hostnames143 * Summary of total lookups and results144145### 6. CPE Lookup Tool146- Name: `cpe_lookup`147- Description: Search for Common Platform Enumeration (CPE) entries by product name148- Parameters:149 * `product` (required): Name of the product to search for150 * `count` (optional, default: false): If true, returns only the count of matching CPEs151 * `skip` (optional, default: 0): Number of CPEs to skip (for pagination)152 * `limit` (optional, default: 1000): Maximum number of CPEs to return153- Returns:154 * When count is true: Total number of matching CPEs155 * When count is false: List of CPEs with pagination details156157### 7. CVEs by Product Tool158- Name: `cves_by_product`159- Description: Search for vulnerabilities affecting specific products or CPEs160- Parameters:161 * `cpe23` (optional): CPE 2.3 identifier (format: cpe:2.3:part:vendor:product:version)162 * `product` (optional): Name of the product to search for CVEs163 * `count` (optional, default: false): If true, returns only the count of matching CVEs164 * `is_kev` (optional, default: false): If true, returns only CVEs with KEV flag set165 * `sort_by_epss` (optional, default: false): If true, sorts CVEs by EPSS score166 * `skip` (optional, default: 0): Number of CVEs to skip (for pagination)167 * `limit` (optional, default: 1000): Maximum number of CVEs to return168 * `start_date` (optional): Start date for filtering CVEs (format: YYYY-MM-DDTHH:MM:SS)169 * `end_date` (optional): End date for filtering CVEs (format: YYYY-MM-DDTHH:MM:SS)170- Notes:171 * Must provide either cpe23 or product, but not both172 * Date filtering uses published time of CVEs173- Returns:174 * Query information175 * Results summary with pagination details176 * Detailed vulnerability information including:177 - Basic information178 - Severity scores179 - Impact assessments180 - References181182## Requirements183184- Node.js (v20 or later)185- A valid [Shodan API Key](https://account.shodan.io/)186187## Troubleshooting188189### API Key Issues190191If you see API key related errors (e.g., "Request failed with status code 401"):1921931. Verify your API key:194 - Must be a valid Shodan API key from your [account settings](https://account.shodan.io/)195 - Ensure the key has sufficient credits/permissions for the operation196 - Check for extra spaces or quotes around the key in the configuration197 - Verify the key is correctly set in the SHODAN_API_KEY environment variable1981992. Common Error Codes:200 - 401 Unauthorized: Invalid API key or missing authentication201 - 402 Payment Required: Out of query credits202 - 429 Too Many Requests: Rate limit exceeded2032043. Configuration Steps:205 a. Get your API key from [Shodan Account](https://account.shodan.io/)206 b. Add it to your configuration file:207 ```json208 {209 "mcpServers": {210 "shodan": {211 "command": "mcp-shodan",212 "env": {213 "SHODAN_API_KEY": "your-actual-api-key-here"214 }215 }216 }217 }218 ```219 c. Save the config file220 d. Restart Claude Desktop2212224. Testing Your Key:223 - Try a simple query first (e.g., dns_lookup for "google.com")224 - Check your [Shodan account dashboard](https://account.shodan.io/) for credit status225 - Verify the key works directly with curl:226 ```bash227 curl "https://api.shodan.io/dns/resolve?hostnames=google.com&key=your-api-key"228 ```229230### Module Loading Issues231232If you see module loading errors:2331. For global installation: Use the simple configuration shown in Quick Start2342. For source installation: Ensure you're using Node.js v18 or later235236## Development237238Build the project:239```bash240npm install241npm run build242```243244Test interactively with FastMCP's built-in dev tool:245```bash246npx fastmcp dev build/index.js247```248249## Error Handling250251The server includes comprehensive error handling for:252- Invalid API keys253- Rate limiting254- Network errors255- Invalid input parameters256- Invalid CVE formats257- Invalid CPE lookup parameters258- Invalid date formats259- Mutually exclusive parameter validation260261## Version History262263- v1.1.0: Migrated from raw `@modelcontextprotocol/sdk` to [FastMCP](https://github.com/punkpeye/fastmcp) — modular tool files, automatic schema validation, simplified error handling264- v1.0.12: Added reverse DNS lookup and improved output formatting265- v1.0.7: Added CVEs by Product search functionality and renamed vulnerabilities tool to cve_lookup266- v1.0.6: Added CVEDB integration for enhanced CVE lookups and CPE search functionality267- v1.0.0: Initial release with core functionality268269## Contributing2702711. Fork the repository2722. Create a feature branch (`git checkout -b feature/amazing-feature`)2733. Commit your changes (`git commit -m 'Add amazing feature'`)2744. Push to the branch (`git push origin feature/amazing-feature`)2755. Open a Pull Request276277## License278279This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.280
Full transparency — inspect the skill content before installing.