io.github.BurtTheCoder/shodan
编码与调试by burtthecoder
面向 Shodan API 的 MCP server,支持设备搜索、IP 查询、DNS 以及 CVE/CPE 检索。
把 Shodan 的设备搜索、IP 与 DNS 查询、CVE/CPE 检索整合进 MCP,做安全排查和暴露面情报分析时少切好几个工具。
什么是 io.github.BurtTheCoder/shodan?
面向 Shodan API 的 MCP server,支持设备搜索、IP 查询、DNS 以及 CVE/CPE 检索。
README
Shodan MCP Server
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.
Quick Start (Recommended)
Installing via Claude Code
claude mcp add --transport stdio --env SHODAN_API_KEY=your-shodan-api-key shodan -- npx -y @burtthecoder/mcp-shodan
Installing via Codex CLI
codex mcp add shodan --env SHODAN_API_KEY=your-shodan-api-key -- npx -y @burtthecoder/mcp-shodan
Installing via Gemini CLI
gemini mcp add -e SHODAN_API_KEY=your-shodan-api-key shodan npx -y @burtthecoder/mcp-shodan
Installing via Smithery
To install Shodan Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @burtthecoder/mcp-shodan --client claude
Installing Manually
- Install the server globally via npm:
npm install -g @burtthecoder/mcp-shodan
- Add to your Claude Desktop configuration file:
{
"mcpServers": {
"shodan": {
"command": "mcp-shodan",
"env": {
"SHODAN_API_KEY": "your-shodan-api-key"
}
}
}
}
Configuration file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- Restart Claude Desktop
Alternative Setup (From Source)
If you prefer to run from source or need to modify the code:
- Clone and build:
git clone https://github.com/BurtTheCoder/mcp-shodan.git
cd mcp-shodan
npm install
npm run build
- Add to your Claude Desktop configuration:
{
"mcpServers": {
"shodan": {
"command": "node",
"args": ["/absolute/path/to/mcp-shodan/build/index.js"],
"env": {
"SHODAN_API_KEY": "your-shodan-api-key"
}
}
}
}
Features
- Network Reconnaissance: Query detailed information about IP addresses, including open ports, services, and vulnerabilities
- DNS Operations: Forward and reverse DNS lookups for domains and IP addresses
- Vulnerability Intelligence: Access to Shodan's CVEDB for detailed vulnerability information, CPE lookups, and product-specific CVE tracking
- Device Discovery: Search Shodan's database of internet-connected devices with advanced filtering
Tools
1. IP Lookup Tool
- Name:
ip_lookup - Description: Retrieve comprehensive information about an IP address, including geolocation, open ports, running services, SSL certificates, hostnames, and cloud provider details if available
- Parameters:
ip(required): IP address to lookup
- Returns:
- IP Information (address, organization, ISP, ASN)
- Location (country, city, coordinates)
- Services (ports, protocols, banners)
- Cloud Provider details (if available)
- Associated hostnames and domains
- Tags
2. Shodan Search Tool
- Name:
shodan_search - Description: Search Shodan's database of internet-connected devices
- Parameters:
query(required): Shodan search querymax_results(optional, default: 10): Number of results to return
- Returns:
- Search summary with total results
- Country-based distribution statistics
- Detailed device information including:
- Basic information (IP, organization, ISP)
- Location data
- Service details
- Web server information
- Associated hostnames and domains
3. CVE Lookup Tool
- Name:
cve_lookup - Description: Query detailed vulnerability information from Shodan's CVEDB
- Parameters:
cve(required): CVE identifier in format CVE-YYYY-NNNNN (e.g., CVE-2021-44228)
- Returns:
- Basic Information (ID, published date, summary)
- Severity Scores:
- CVSS v2 and v3 with severity levels
- EPSS probability and ranking
- Impact Assessment:
- KEV status
- Proposed mitigations
- Ransomware associations
- Affected products (CPEs)
- References
4. DNS Lookup Tool
- Name:
dns_lookup - Description: Resolve domain names to IP addresses using Shodan's DNS service
- Parameters:
hostnames(required): Array of hostnames to resolve
- Returns:
- DNS resolutions mapping hostnames to IPs
- Summary of total lookups and queried hostnames
5. Reverse DNS Lookup Tool
- Name:
reverse_dns_lookup - Description: Perform reverse DNS lookups to find hostnames associated with IP addresses
- Parameters:
ips(required): Array of IP addresses to lookup
- Returns:
- Reverse DNS resolutions mapping IPs to hostnames
- Summary of total lookups and results
6. CPE Lookup Tool
- Name:
cpe_lookup - Description: Search for Common Platform Enumeration (CPE) entries by product name
- Parameters:
product(required): Name of the product to search forcount(optional, default: false): If true, returns only the count of matching CPEsskip(optional, default: 0): Number of CPEs to skip (for pagination)limit(optional, default: 1000): Maximum number of CPEs to return
- Returns:
- When count is true: Total number of matching CPEs
- When count is false: List of CPEs with pagination details
7. CVEs by Product Tool
- Name:
cves_by_product - Description: Search for vulnerabilities affecting specific products or CPEs
- Parameters:
cpe23(optional): CPE 2.3 identifier (format: cpe:2.3:part:vendor:product:version)product(optional): Name of the product to search for CVEscount(optional, default: false): If true, returns only the count of matching CVEsis_kev(optional, default: false): If true, returns only CVEs with KEV flag setsort_by_epss(optional, default: false): If true, sorts CVEs by EPSS scoreskip(optional, default: 0): Number of CVEs to skip (for pagination)limit(optional, default: 1000): Maximum number of CVEs to returnstart_date(optional): Start date for filtering CVEs (format: YYYY-MM-DDTHH:MM:SS)end_date(optional): End date for filtering CVEs (format: YYYY-MM-DDTHH:MM:SS)
- Notes:
- Must provide either cpe23 or product, but not both
- Date filtering uses published time of CVEs
- Returns:
- Query information
- Results summary with pagination details
- Detailed vulnerability information including:
- Basic information
- Severity scores
- Impact assessments
- References
Requirements
- Node.js (v20 or later)
- A valid Shodan API Key
Troubleshooting
API Key Issues
If you see API key related errors (e.g., "Request failed with status code 401"):
-
Verify your API key:
- Must be a valid Shodan API key from your account settings
- Ensure the key has sufficient credits/permissions for the operation
- Check for extra spaces or quotes around the key in the configuration
- Verify the key is correctly set in the SHODAN_API_KEY environment variable
-
Common Error Codes:
- 401 Unauthorized: Invalid API key or missing authentication
- 402 Payment Required: Out of query credits
- 429 Too Many Requests: Rate limit exceeded
-
Configuration Steps: a. Get your API key from Shodan Account b. Add it to your configuration file:
json{ "mcpServers": { "shodan": { "command": "mcp-shodan", "env": { "SHODAN_API_KEY": "your-actual-api-key-here" } } } }c. Save the config file d. Restart Claude Desktop
-
Testing Your Key:
- Try a simple query first (e.g., dns_lookup for "google.com")
- Check your Shodan account dashboard for credit status
- Verify the key works directly with curl:
bash
curl "https://api.shodan.io/dns/resolve?hostnames=google.com&key=your-api-key"
Module Loading Issues
If you see module loading errors:
- For global installation: Use the simple configuration shown in Quick Start
- For source installation: Ensure you're using Node.js v18 or later
Development
Build the project:
npm install
npm run build
Test interactively with FastMCP's built-in dev tool:
npx fastmcp dev build/index.js
Error Handling
The server includes comprehensive error handling for:
- Invalid API keys
- Rate limiting
- Network errors
- Invalid input parameters
- Invalid CVE formats
- Invalid CPE lookup parameters
- Invalid date formats
- Mutually exclusive parameter validation
Version History
- v1.0.22: Published to the official MCP Registry — added
server.jsonmanifest, CLI install support for Claude Code, Codex, and Gemini CLI - v1.1.0: Migrated from raw
@modelcontextprotocol/sdkto FastMCP — modular tool files, automatic schema validation, simplified error handling - v1.0.12: Added reverse DNS lookup and improved output formatting
- v1.0.7: Added CVEs by Product search functionality and renamed vulnerabilities tool to cve_lookup
- v1.0.6: Added CVEDB integration for enhanced CVE lookups and CPE search functionality
- v1.0.0: Initial release with core functionality
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
常见问题
io.github.BurtTheCoder/shodan 是什么?
面向 Shodan API 的 MCP server,支持设备搜索、IP 查询、DNS 以及 CVE/CPE 检索。
相关 Skills
前端设计
by anthropics
面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。
✎ 想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。
网页应用测试
by anthropics
用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。
✎ 借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。
网页构建器
by anthropics
面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。
✎ 在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。
相关 MCP Server
GitHub
编辑精选by GitHub
GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。
✎ 这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。
Context7 文档查询
编辑精选by Context7
Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。
✎ 它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。
by tldraw
tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。
✎ 这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。