shodan-mcp-server
是一个基于模型上下文协议(MCP)的服务器,它为用户提供了便捷访问 Shodan API 的途径。借助该服务器,您能够以编程方式对 Shodan 进行查询,获取设备信息、漏洞详情等各类相关数据,轻松将 Shodan 情报集成到自己的应用程序中。
shodan-mcp-server
提供了一种简便的方式,将 Shodan 情报集成到您的应用程序中,使用模型上下文协议 (MCP)。它公开了多种工具,允许您查询 Shodan 以获取各种类型的信息。
git clone https://github.com/X3r0K/Shodan-MCP-Server.git
cd shodan-mcp-server
npm install
npm run build
~/.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
替换为您的实际路径。
const { Client } = require('mcp-client');
async function main() {
const client = new Client({
server: 'http://localhost:3000'
});
try {
// 示例:查询 Shodan
const response = await client.query('example query');
console.log(response);
} catch (error) {
console.error(error);
}
}
main();
ip
(字符串):要查询的 IP 地址。domain
(字符串):要解析的域名。ip
(字符串):要查询的 IP 地址。cve_id
(字符串):要查询的 CVE ID。query
(字符串):搜索查询字符串。shodan-mcp-server/
├── src/
│ ├── server.js # 主服务器文件
│ └── routes/ # 路由定义
│ └── shodanRoutes.js # Shodan 相关路由
├── package.json # 项目依赖和脚本
└── README.md # 项目文档
欢迎为这个项目贡献代码或提出问题。请参考 GitHub 仓库 的贡献指南。
本项目使用 MIT 许可证。