shodan-mcp-server
是一个基于 Model Context Protocol (MCP) 的服务器,它提供了对 Shodan API 的访问能力。借助该服务器,你能够以编程方式查询 Shodan,获取设备、漏洞等相关信息,轻松将 Shodan 情报集成到自己的应用程序中。
shodan-mcp-server
提供了一种简便的方式,将 Shodan 情报集成到您的应用程序中,使用 Model Context Protocol (MCP)。它公开了几个工具,允许您查询 Shodan 以获取各种类型的信息。
git clone https://github.com/X3r0K/Shodan-MCP-Server.git
cd shodan-mcp-server
npm install
npm run build
您可以通过 Node.js 使用 MCP 服务器,使用 @modelcontextprotocol/sdk
包。
npm install @modelcontextprotocol/sdk
use_mcp_tool
函数调用工具import { use_mcp_tool } from '@modelcontextprotocol/sdk';
async function get_ip_info() {
try {
const result = await use_mcp_tool('shodan', 'get_ip_info', {
ip: '8.8.8.8' // 示例 IP 地址
});
console.log(result);
} catch (error) {
console.error('Error:', error);
}
}
get_ip_info();
ip
(字符串):要查询的 IP 地址。ip
:目标 IP 地址。hostnames
:与该 IP 关联的主机名数组。location
:地理位置信息,包括国家、城市和经纬度。ASN
:自治系统编号及其所有者。ports
:开放端口列表及其对应的服务。domain
(字符串):要解析的域名。domain
:目标域名。ips
:与该域名关联的 IP 地址列表。ip
(字符串):要查询的 IP 地址。id
:漏洞 ID。title
:漏洞标题。severity
:漏洞严重性等级(例如,"high", "medium", "low")。cve_id
(字符串):CVE ID(例如,"CVE - 2021 - XXXX")。id
:CVE ID。summary
:漏洞摘要。severity
:漏洞严重性等级。affected_packages
:受影响的软件包或组件列表。query
(字符串):要执行的搜索查询。ip
:IP 地址。port
:开放端口。service
:运行的服务。~/.config/mcp/settings.json
)中配置 MCP 服务器:{
"mcpServers": {
"shodan": {
"command": "node",
"args": ["/path/to/shodan-mcp-server/build/index.js"],
"env": {
"SHODAN_API_KEY": ""
},
"disabled": false,
"autoApprove": []
}
}
}
将
替换为您的实际 Shodan API 密钥,将 /path/to/shodan-mcp-server
替换为您实际的 shodan-mcp-server 路径。
shodan-mcp-server/
├── index.js # 主程序入口
├── build/ # 构建输出目录
├── package.json # 依赖管理文件
└── README.md # 项目文档
贡献者可以通过以下方式参与:
请确保在提交代码之前阅读并遵循项目的 贡献规范。
本项目受 MIT License 保护。