Shodan MCP 服务器

Shodan MCP 服务器

提供通过模型上下文协议访问 Shodan API 的服务器,用于查询设备、漏洞等信息。

快速入门

  1. 克隆仓库: git clone https://github.com/X3r0K/Shodan-MCP-Server.git cd shodan-mcp-server

  2. 安装依赖: npm install

  3. 构建项目: npm run build

  4. 配置 Shodan API 密钥: 在 ~/.config/mcp/settings.json 文件中设置: { "mcpServers": { "shodan": { "command": "node", "args": ["/path/to/shodan-mcp-server/build/index.js"], "env": { "SHODAN_API_KEY": "<your_shodan_api_key>" } } } }

  5. 使用 Node.js 调用工具: npm install @modelcontextprotocol/sdk

    import { use_mcp_tool } from '@modelcontextprotocol/sdk';

    async function getIpInfo(ip) { const result = await use_mcp_tool('shodan', 'get_ip_info', { ip }); console.log(result); }

    getIpInfo('8.8.8.8');