mcp-shodan
Shodan MCP 服务器
用于查询Shodan API和Shodan CVEDB 的模型上下文协议 (MCP) 服务器。该服务器提供对 Shodan 网络情报和安全服务的全面访问,包括 IP 侦察、DNS 操作、漏洞追踪和设备发现。所有工具均提供结构化、格式化的输出,方便分析和集成。
快速启动(推荐)
通过 Smithery 安装
要通过Smithery自动为 Claude Desktop 安装 Shodan 服务器:
npx -y @smithery/cli install @burtthecoder/mcp-shodan --client claude手动安装
通过 npm 全局安装服务器:
npm install -g @burtthecoder/mcp-shodan添加到您的 Claude Desktop 配置文件:
{
"mcpServers": {
"shodan": {
"command": "mcp-shodan",
"env": {
"SHODAN_API_KEY": "your-shodan-api-key"
}
}
}
}配置文件位置:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
重启Claude桌面
Related MCP server: Shodan-MCP-Server
替代设置(来自源)
如果您希望从源代码运行或需要修改代码:
克隆并构建:
git clone https://github.com/BurtTheCoder/mcp-shodan.git
cd mcp-shodan
npm install
npm run build添加到您的 Claude Desktop 配置:
{
"mcpServers": {
"shodan": {
"command": "node",
"args": ["/absolute/path/to/mcp-shodan/build/index.js"],
"env": {
"SHODAN_API_KEY": "your-shodan-api-key"
}
}
}
}特征
网络侦察:查询IP地址的详细信息,包括开放端口、服务和漏洞
DNS 操作:域和 IP 地址的正向和反向 DNS 查找
漏洞情报:访问 Shodan 的 CVEDB 获取详细的漏洞信息、CPE 查找和特定于产品的 CVE 跟踪
设备发现:使用高级过滤功能搜索 Shodan 的互联网连接设备数据库
工具
1. IP查找工具
名称:
ip_lookup描述:检索有关 IP 地址的综合信息,包括地理位置、开放端口、正在运行的服务、SSL 证书、主机名和云提供商详细信息(如果可用)
参数:
ip(必填):要查找的 IP 地址
返回:
IP 信息(地址、组织、ISP、ASN)
位置(国家、城市、坐标)
服务(端口、协议、横幅)
云提供商详细信息(如果有)
关联的主机名和域
标签
2. Shodan 搜索工具
名称:
shodan_search描述:搜索 Shodan 的互联网连接设备数据库
参数:
query(必填):Shodan 搜索查询max_results(可选,默认值:10):返回的结果数
返回:
包含总结果的搜索摘要
基于国家的分布统计数据
详细的设备信息包括:
基本信息(IP、组织、ISP)
位置数据
服务详情
Web 服务器信息
关联的主机名和域
3. CVE 查找工具
名称:
cve_lookup描述:从 Shodan 的 CVEDB 查询详细的漏洞信息
参数:
cve(必填):CVE 标识符,格式为 CVE-YYYY-NNNNN(例如,CVE-2021-44228)
返回:
基本信息(ID、发布日期、摘要)
严重程度评分:
CVSS v2 和 v3 及其严重性等级
EPSS概率和排序
影响评估:
KEV 状态
建议的缓解措施
勒索软件协会
受影响的产品(CPE)
参考
4. DNS查找工具
名称:
dns_lookup描述:使用 Shodan 的 DNS 服务将域名解析为 IP 地址
参数:
hostnames(必需):要解析的主机名数组
返回:
DNS 解析将主机名映射到 IP
总查找次数和查询主机名的摘要
5.反向DNS查找工具
名称:
reverse_dns_lookup描述:执行反向 DNS 查找以查找与 IP 地址关联的主机名
参数:
ips(必需):要查找的 IP 地址数组
返回:
将 IP 映射到主机名的反向 DNS 解析
总查找次数和结果摘要
6. CPE查询工具
名称:
cpe_lookup描述:按产品名称搜索通用平台枚举(CPE)条目
参数:
product(必填):要搜索的产品名称count(可选,默认值:false):如果为 true,则仅返回匹配的 CPE 的数量skip(可选,默认值:0):要跳过的 CPE 数量(用于分页)limit(可选,默认值:1000):返回的最大 CPE 数量
返回:
当 count 为 true 时:匹配的 CPE 总数
当 count 为 false 时:包含分页详细信息的 CPE 列表
7. 按产品工具分类的 CVE
名称:
cves_by_product描述:搜索影响特定产品或 CPE 的漏洞
参数:
cpe23(可选):CPE 2.3 标识符(格式:cpe:2.3:part:vendor:product:version)product(可选):要搜索 CVE 的产品名称count(可选,默认值:false):如果为 true,则仅返回匹配的 CVE 的数量is_kev(可选,默认值:false):如果为 true,则仅返回设置了 KEV 标志的 CVEsort_by_epss(可选,默认值:false):如果为 true,则按 EPSS 分数对 CVE 进行排序skip(可选,默认值:0):要跳过的 CVE 数量(用于分页)limit(可选,默认值:1000):返回的最大 CVE 数量start_date(可选):过滤 CVE 的开始日期(格式:YYYY-MM-DDTHH:MM:SS)end_date(可选):过滤 CVE 的结束日期(格式:YYYY-MM-DDTHH:MM:SS)
笔记:
必须提供 cpe23 或产品,但不能同时提供两者
日期过滤使用 CVE 的发布时间
返回:
查询信息
带有分页详细信息的结果摘要
详细的漏洞信息包括:
基本信息
严重程度评分
影响评估
参考
要求
Node.js(v18 或更高版本)
故障排除
API 密钥问题
如果您看到与 API 密钥相关的错误(例如“请求失败,状态代码为 401”):
验证您的 API 密钥:
必须是您帐户设置中的有效 Shodan API 密钥
确保密钥具有足够的信用/权限以执行操作
检查配置中键周围是否有多余的空格或引号
验证密钥是否在 SHODAN_API_KEY 环境变量中正确设置
常见错误代码:
401 未授权:无效的 API 密钥或缺少身份验证
402 需要付款:超出查询信用额度
429 请求过多:超出速率限制
配置步骤:a. 从Shodan 帐户获取您的 API 密钥 b. 将其添加到您的配置文件:
{ "mcpServers": { "shodan": { "command": "mcp-shodan", "env": { "SHODAN_API_KEY": "your-actual-api-key-here" } } } }c. 保存配置文件 d. 重启 Claude Desktop
测试您的密钥:
首先尝试一个简单的查询(例如,dns_lookup 查找“google.com”)
检查您的Shodan 帐户仪表板以了解信用状况
验证密钥是否可以直接与 curl 一起使用:
curl "https://api.shodan.io/dns/resolve?hostnames=google.com&key=your-api-key"
模块加载问题
如果您看到模块加载错误:
对于全局安装:使用快速入门中显示的简单配置
对于源安装:确保您使用的是 Node.js v18 或更高版本
发展
要在开发模式下使用热重载运行:
npm run dev错误处理
该服务器包括针对以下方面的全面错误处理:
无效的 API 密钥
速率限制
网络错误
输入参数无效
无效的 CVE 格式
CPE 查找参数无效
无效的日期格式
互斥参数验证
版本历史记录
v1.0.12:添加反向 DNS 查找并改进输出格式
v1.0.7:添加了按产品搜索 CVE 的功能,并将漏洞工具重命名为 cve_lookup
v1.0.6:添加了 CVEDB 集成,以增强 CVE 查找和 CPE 搜索功能
v1.0.0:具有核心功能的初始版本
贡献
分叉存储库
创建功能分支(
git checkout -b feature/amazing-feature)提交您的更改(
git commit -m 'Add amazing feature')推送到分支(
git push origin feature/amazing-feature)打开拉取请求
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
Available Tools
7 toolscpe_lookupARead-only
Search for Common Platform Enumeration (CPE) entries by product name in Shodan's CVEDB. Supports pagination and can return either full CPE details or just the total count. Useful for identifying specific versions and configurations of software and hardware.
Inputs: product (required), skip, count, limit.
cve_lookupARead-only
Query detailed vulnerability information from Shodan's CVEDB. Returns comprehensive CVE details including CVSS scores (v2/v3), EPSS probability and ranking, KEV status, proposed mitigations, ransomware associations, and affected products (CPEs).
Inputs: cve (required).
cves_by_productARead-only
Search for vulnerabilities affecting specific products or CPEs. Supports filtering by KEV status, sorting by EPSS score, date ranges, and pagination. Can search by product name or CPE 2.3 identifier. Returns detailed vulnerability information including severity scores and impact assessments.
Inputs: skip, count, cpe23, limit, +5 more.
dns_lookupARead-only
Resolve domain names to IP addresses using Shodan's DNS service. Supports batch resolution of multiple hostnames in a single query. Returns IP addresses mapped to their corresponding hostnames.
Inputs: hostnames (required).
ip_lookupARead-only
Retrieve comprehensive information about an IP address, including geolocation, open ports, running services, SSL certificates, hostnames, and cloud provider details if available. Returns service banners and HTTP server information when present.
Inputs: ip (required).
reverse_dns_lookupARead-only
Perform reverse DNS lookups to find hostnames associated with IP addresses. Supports batch lookups of multiple IP addresses in a single query. Returns all known hostnames for each IP address, with clear indication when no hostnames are found.
Inputs: ips (required).
shodan_searchBRead-only
Search Shodan's database of internet-connected devices. Returns detailed information about matching devices including services, vulnerabilities, and geographic distribution. Supports advanced search filters and returns country-based statistics.
Inputs: query (required), max_results.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools are clearly distinct: ip_lookup, shodan_search, dns_lookup, and reverse_dns_lookup each target a different resource. However, cve_lookup and cves_by_product both return vulnerability information, which could cause some confusion despite their different query approaches.
Tool names mostly follow a consistent noun-based pattern (ip_lookup, dns_lookup, cve_lookup, cpe_lookup) with descriptive compound names for searches. The mix of 'lookup' and 'search' verbs is a minor inconsistency, but the pattern is still predictable and readable.
Seven tools is well-scoped for a Shodan-focused server, covering IP intelligence, device search, DNS, and vulnerability data without unnecessary bloat. Each tool serves a distinct purpose within the security research domain.
The tool set covers core Shodan functionality: IP lookup, device search, DNS resolution, and CVE/CPE vulnerability research. Minor gaps exist such as account/API info or network/port-specific queries, but the primary workflows for security research are well covered.
Maintenance
Related MCP Connectors
Unofficial Shodan InternetDB MCP — wraps Shodan InternetDB (internetdb.shodan.io)
Unofficial Shodan MCP — wraps the full Shodan REST API (api.shodan.io)
MCP server for the Vulners.com API
Defensive Shodan search and host intelligence MCP using customer-provided SHODAN_API_KEY for
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA WebSocket server that provides MCP interface for searching and retrieving information about internet-connected devices, IP addresses, DNS data, and CVE vulnerabilities through the Shodan API.3-
- FlicenseNot gradedqualityDmaintenanceThis 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.2-
- FlicenseNot gradedqualityBmaintenancePassive reconnaissance MCP server powered by Shodan, enabling host lookups, search, and DNS queries gated against HackerOne scope snapshots.-
- AlicenseBqualityDmaintenanceMCP server that exposes Shodan API for host information, search, alerts, scanning, and exploit data.20178 PyPI1MIT
Appeared in Searches
- Information on LinkedIn Business or LinkedIn Advertising
- Information about the VIX (Volatility Index)
- Accessing Clearbit APIs for Company Information and Website Visitor Data
- A guide to finding data in public databases
- How to retrieve information about a device using Microsoft Defender, Intune, and Jamf