Skip to main content
Glama
Cgisclair29

Rapid7 Bulk Export MCP

by Cgisclair29

Rapid7 Bulk Export MCP

AI 驱动的 Rapid7 Command Platform 数据分析,使用 MCP(Model Context Protocol)和 AgentSkills

此工具为尽力而为的支持。由于使用此工具的工具和工作流具有定制化且不断变化的特性,我们无法提供 MCP Code 和 AgentSkill 内容之外的支持或指导。

这是什么?

此工具通过 Rapid7 Bulk Export API 从 Rapid7 Command Platform 导出数据,并使其可在 GenAI 和 Agentic 工作流中查询。

  • MCP Server:嵌入工具,用于获取、处理和查询数据

  • Agent Skill / Kiro Power:提供额外的上下文、模式知识以及如何使用 MCP 工具的说明

  • DuckDB 数据库:基于文件的本地数据库,支持结构化快速查询

功能特性

  • AI 驱动分析:可与 Kiro、Claude Desktop 或任何兼容 MCP 的 AI 助手一起使用

  • 按需数据加载:自动从 Rapid7 获取并加载数据

  • 导出复用:自动复用当天导出,避免冗余 API 调用

  • 自然语言查询:使用简单英语提问

  • SQL 查询执行:针对漏洞、资产和其他数据运行复杂 SQL 查询

  • 模式探索:发现可用的数据字段

  • 统计与洞察:获取即时摘要和分布情况

  • 安全锁定:用户查询在沙箱中运行 —— 在 DuckDB 引擎级别禁用文件系统和网络访问

  • Docker 支持:作为容器化 HTTP 服务运行,适用于远程或共享部署

本地模式与远程模式

你可以根据你的环境以两种模式运行 MCP 服务器:

本地 (stdio) — AI 客户端将服务器作为子进程启动,并通过 stdin/stdout 进行通信。这是默认且最简单的选项。服务器在您的机器上运行,数据库位于其旁边,所有内容都保留在本地。最适合在工作站或笔记本电脑上个人使用。

远程 (Docker / 可流式 HTTP) — 服务器作为容器化 HTTP 服务运行,暴露单个 /mcp 端点。客户端通过网络 URL 连接。最适合共享环境、团队使用,或当您希望服务器在与 AI 工具分离的专用基础设施上运行时。需要注意的是,这将使数据在远程 mcp 的所有用户之间共享,您应对 /mcp 端点进行身份验证和保护。

两种模式使用相同的 MCP 工具和安全控制。唯一的区别是客户端的连接方式。

快速开始

0. 获取您的 Rapid7 API 密钥和区域

在开始之前,您需要从您的 Rapid7 Insight Platform 帐户获取凭据。

生成 API 密钥:

重要提示: API 密钥必须由平台管理员生成。批量导出 API 会返回整个平台的所有漏洞数据,因此需要管理员级访问权限。

  1. 以平台管理员身份登录 Rapid7 Insight Platform

  2. 导航到“管理 → API 密钥管理”

  3. 选择密钥类型:

    • 组织密钥(推荐):完全管理员权限(需要平台管理员角色)

    • 用户密钥:继承您的帐户权限 —— 必须由平台管理员创建,才能拥有足够的权限进行批量导出

  4. 点击“生成新的管理员密钥”(如果使用平台管理员帐户,则点击“生成新的用户密钥”)

  5. 选择您的组织并为密钥提供名称

  6. 立即复制密钥——您将无法再次查看它!

查找您的区域:

您的区域决定了使用哪个 API 端点。要查找您的区域:

  1. 前往 insight.rapid7.com 并登录

  2. 在右上角您的帐户名下方查找“数据存储区域”标签

更多详情,请参阅:

1. 设置您的 AI 工具

在下方选择您的 AI 工具。每份指南都会介绍如何安装 MCP 服务器、添加 Agent Skill 以及验证连接。

保护您的 API 密钥: 避免将 RAPID7_API_KEY 明文存储在磁盘上。使用机密管理器在运行时注入密钥——例如 1Password CLI、Bitwarden CLI、macOS Keychain、Windows Credential Manager 或 PowerShell SecretManagement。使用 1Password 时,您可以设置 "command": "op""args": ["run", "--", "rapid7-mcp-server"],并在 env 块中使用 op:// 机密引用——密钥将从您的保管库中解析,绝不会写入配置文件。将此模式调整为适合您使用的任何密码管理器。

安装 MCP 服务器

  1. 打开 Claude Desktop,导航到“自定义 → 连接器”

  2. 在连接器目录中搜索“Rapid7 Bulk Export”

  3. 点击“安装”,并在提示时提供您的 RAPID7_API_KEYRAPID7_REGION

Installing from the Connectors directory

安装 Agent Skill

  1. 前往“自定义 → 技能”

  2. 点击 (+)

  3. 创建技能

  4. 上传技能

  5. 从右侧的发布版本中上传最新的技能 zip 文件

Installing the agent skill

验证

  1. 尝试:/rapid7-bulk-export-analysis-expert Load the latest vulnerability data from Rapid7

安装 MCP 服务器

# Using uv
uv pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

# Or using pip
pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

配置

创建或编辑 .kiro/settings/mcp.json

{
  "mcpServers": {
    "rapid7-bulk-export": {
      "command": "rapid7-mcp-server",
      "args": [],
      "env": {
        "RAPID7_API_KEY": "your-api-key-here",
        "RAPID7_REGION": "your-region"
      }
    }
  }
}

安装 Agent Skill

  1. 打开 Kiro 技能面板(命令面板 → “Kiro: Open Skills”)

  2. 点击“从 GitHub 安装”

  3. 输入仓库 URL:https://github.com/rapid7/rapid7-bulk-export-mcp/rapid7-bulk-export-skill

在聊天中使用 #rapid7-bulk-export-skill 激活技能。

验证

  1. 重启或重新连接 MCP 服务器(命令面板 → “MCP: Reconnect All Servers”)

  2. 在 MCP 面板中检查“rapid7-bulk-export”服务器(应显示“已连接”)

  3. 尝试:#rapid7-bulk-export-skill Load the latest vulnerability data from Rapid7

安装 MCP 服务器

# Using uv
uv pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

# Or using pip
pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

配置

使用 Claude Code CLI:

claude mcp add --transport stdio \
  --env RAPID7_API_KEY=your-api-key-here \
  --env RAPID7_REGION=your-region \
  rapid7-bulk-export \
  -- rapid7-mcp-server

或手动编辑 ~/.claude.json(用户范围)或 .mcp.json(项目范围):

{
  "mcpServers": {
    "rapid7-bulk-export": {
      "command": "rapid7-mcp-server",
      "args": [],
      "env": {
        "RAPID7_API_KEY": "your-api-key-here",
        "RAPID7_REGION": "your-region"
      }
    }
  }
}

使用 --scope user 进行跨项目访问,或使用 --scope project 进行团队共享。

安装 Agent Skill

# User-level (available in all projects)
mkdir -p ~/.claude/skills/rapid7-bulk-export
curl -sL https://raw.githubusercontent.com/rapid7/rapid7-bulk-export-mcp/main/rapid7-bulk-export-skill/SKILL.md \
  -o ~/.claude/skills/rapid7-bulk-export/SKILL.md

# Or project-level (only in current project)
mkdir -p .claude/skills/rapid7-bulk-export
curl -sL https://raw.githubusercontent.com/rapid7/rapid7-bulk-export-mcp/main/rapid7-bulk-export-skill/SKILL.md \
  -o .claude/skills/rapid7-bulk-export/SKILL.md

或使用 npx skills 直接安装:

npx skills install https://github.com/rapid7/rapid7-bulk-export-mcp

Claude Code 会在相关时自动发现并使用该技能。

验证

  1. 重启 Claude Code 或重新加载窗口

  2. 在聊天中输入 /mcp 检查服务器状态

  3. 确认“rapid7-bulk-export”出现在列表中

  4. 尝试:Load the latest vulnerability data from Rapid7

安装 MCP 服务器

# Using uv
uv pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

# Or using pip
pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

配置

编辑 VS Code 中的 MCP 设置:

  • 使用命令面板:“MCP: Edit Configuration”

  • 或手动编辑:.vscode/mcp.json(工作区)或用户设置

{
  "mcpServers": {
    "rapid7-bulk-export": {
      "command": "rapid7-mcp-server",
      "args": [],
      "env": {
        "RAPID7_API_KEY": "your-api-key-here",
        "RAPID7_REGION": "your-region"
      }
    }
  }
}

安装 Agent Skill

# Project-level (recommended, stored in repository)
mkdir -p .github/skills/rapid7-bulk-export
curl -sL https://raw.githubusercontent.com/rapid7/rapid7-bulk-export-mcp/main/rapid7-bulk-export-skill/SKILL.md \
  -o .github/skills/rapid7-bulk-export/SKILL.md

# Or user-level (available across all projects)
mkdir -p ~/.copilot/skills/rapid7-bulk-export
curl -sL https://raw.githubusercontent.com/rapid7/rapid7-bulk-export-mcp/main/rapid7-bulk-export-skill/SKILL.md \
  -o ~/.copilot/skills/rapid7-bulk-export/SKILL.md

或使用 npx skills 直接安装:

npx skills install https://github.com/rapid7/rapid7-bulk-export-mcp

使用该技能作为斜杠命令:/rapid7-bulk-export

验证

  1. 重新加载 VS Code 窗口

  2. 在状态栏或输出面板中检查 MCP 状态

  3. 尝试:Load the latest vulnerability data from Rapid7

安装 MCP 服务器

# Using uv
uv pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

# Or using pip
pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

配置

使用 Codex CLI 添加服务器:

codex mcp add rapid7-bulk-export \
  --env RAPID7_API_KEY=your-api-key-here \
  --env RAPID7_REGION=your-region \
  -- rapid7-mcp-server

或手动编辑 ~/.codex/config.toml

[mcp_servers.rapid7-bulk-export]
command = "rapid7-mcp-server"
args = []
enabled = true

[mcp_servers.rapid7-bulk-export.env]
RAPID7_API_KEY = "your-api-key-here"
RAPID7_REGION = "your-region"

如果从 shell 使用环境变量而不是硬编码它们:

[mcp_servers.rapid7-bulk-export]
command = "rapid7-mcp-server"
args = []
enabled = true
env_vars = ["RAPID7_API_KEY", "RAPID7_REGION"]

验证

  1. 列出已配置的服务器:codex mcp list

  2. 查看服务器详情:codex mcp get rapid7-bulk-export

  3. 尝试:Load the latest vulnerability data from Rapid7

安装 MCP 服务器

# Using uv
uv pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

# Or using pip
pip install git+https://github.com/rapid7/rapid7-bulk-export-mcp.git

配置

编辑您的 Antigravity MCP 配置文件:

  • macOS/Linux: ~/.gemini/antigravity/mcp_config.json

  • Windows: C:\Users\<USERNAME>\.gemini\antigravity\mcp_config.json

您也可以从 Antigravity Agent 面板 → “...” → MCP 服务器 → 管理 MCP 服务器 → 查看原始配置来访问此文件。

将以下内容添加到 mcp_config.json

{
  "mcpServers": {
    "rapid7-bulk-export": {
      "command": "rapid7-mcp-server",
      "args": [],
      "env": {
        "RAPID7_API_KEY": "your-api-key-here",
        "RAPID7_REGION": "your-region"
      }
    }
  }
}

验证

  1. 重启 Antigravity 以使更改生效

  2. 打开 MCP 服务器面板(“...” 菜单 → MCP 服务器)

  3. 确认“rapid7-bulk-export”出现在可用工具中

  4. 尝试:Load the latest vulnerability data from Rapid7

Docker 镜像

使用 Red Hat UBI 10 Python 3.12 Minimal 基础镜像,预装 Python 3.12.13。支持只读文件系统操作。无需 Red Hat 订阅。

构建并运行

使用 docker compose(推荐):

RAPID7_API_KEY=your-key RAPID7_REGION=us docker compose up -d

使用 docker run:

# Build
docker build -t rapid7-bulk-export-mcp .

# Run with read-only filesystem
docker run -d \
  -p 8000:8000 \
  -e RAPID7_API_KEY=your-api-key-here \
  -e RAPID7_REGION=us \
  -e DATA_DIR=/data \
  -e TMPDIR=/tmp \
  -v rapid7-data:/data \
  --tmpfs /tmp \
  --read-only \
  --security-opt no-new-privileges:true \
  --name rapid7-bulk-export-mcp \
  rapid7-bulk-export-mcp

配置您的 MCP 客户端

将任何兼容 MCP 的客户端指向 HTTP 端点:

{
  "mcpServers": {
    "rapid7-bulk-export": {
      "url": "http://localhost:8000/mcp"
    }
  }
}

安装 Agent Skill

按照上方对应 AI 工具的技能安装说明操作。无论 MCP 服务器是本地还是远程,该技能的工作方式都相同。

验证

  1. 确认容器正在运行:docker ps

  2. 测试端点:curl http://localhost:8000/mcp

  3. 连接您的 AI 工具并尝试:Load the latest vulnerability data from Rapid7

2. 开始分析

注意: 首次导出需要 1-5 分钟,具体取决于组织规模。完成后,数据会被缓存,后续加载会复用同一导出。您随时可以要求刷新数据以获取最新数据集。

Show me the top 10 critical vulnerabilities with known exploits
What's the severity distribution across my cloud assets?

工具参考

start_rapid7_export

在 Rapid7 服务器上启动新的导出任务。立即返回导出 ID。支持三种导出类型:vulnerabilitypolicyremediation

Start a vulnerability export from Rapid7

check_rapid7_export_status

轮询 Rapid7 API 一次以获取导出任务的当前状态。在 start_rapid7_export 之后使用,以了解数据何时就绪。

Check the status of export abc-123

download_rapid7_export

下载已完成导出的 Parquet 文件,并将其加载到本地 DuckDB 数据库中。这是数据变为可查询状态的地方。

Download and load export abc-123

load_rapid7_parquet

直接从磁盘加载现有的 Parquet 文件(必须位于 ~/.rapid7_mcp/imports/ 内)。如果您已经有导出的文件并希望跳过 API 调用,这将非常有用。

Load parquet files from ~/.rapid7_mcp/imports/my-export/

query_rapid7

对已加载的数据执行 SQL。加载后连接会被锁定——在 DuckDB 引擎级别阻止文件系统读取、写入和网络访问。

可用表:assetsvulnerabilitiespoliciesvulnerability_remediation

Run: SELECT severity, COUNT(*) FROM vulnerabilities GROUP BY severity

get_rapid7_schema

返回所有已加载表的列名和数据类型。在编写查询之前,使用此工具了解哪些字段可用。

Show me the schema of the loaded data

get_rapid7_stats

返回汇总统计信息——行数、严重性分布、CVSS 分数范围、漏洞利用计数和云提供商细分。

Give me an overview of the vulnerability data

list_rapid7_exports

显示最近的导出历史,包括 ID、日期、状态和行数。对于查找之前要重新加载的导出非常有用。

List my recent exports

purge_rapid7_data

从磁盘永久删除漏洞数据库和导出跟踪数据库。在完成分析后或在移交机器之前使用。

Purge all local Rapid7 data

架构

graph TB
    subgraph "AI Layer"
        LLM[LLM/AI Assistant<br/>Copilot, Kiro, Claude Desktop, etc.]
    end

    subgraph "Rapid7 Bulk Export MCP Tool"
        MCP[MCP Server<br/>rapid7-bulk-export]
        Skill[Agent Skill / Power<br/>rapid7-bulk-export-skill]
    end

    subgraph "Data Layer"
        DB[(DuckDB<br/>rapid7_bulk_export.db)]
        Tracker[(Export Tracker<br/>rapid7_bulk_export_tracking.db)]
    end

    subgraph "Rapid7 API"
        R7[Rapid7 Bulk Export API<br/>/export/graphql ]
    end

    LLM <-->|Model Context Protocol| MCP
    LLM -.->|Enhanced Context| Skill
    MCP -->|SQL Queries| DB
    MCP -->|Track Exports| Tracker
    MCP -->|Fetch Data| R7
    R7 -->|Parquet Files| MCP
    MCP -->|Load Data| DB

    style LLM fill:#e1f5ff
    style MCP fill:#fff4e1
    style Skill fill:#f0e1ff
    style DB fill:#e8f5e9
    style Tracker fill:#e8f5e9
    style R7 fill:#ffe1e1

开发

可以在本地对 AgentSkill 和 MCP 进行更改,以便您根据自身环境进行定制——欢迎向本仓库贡献代码。

克隆并安装

git clone https://github.com/rapid7/rapid7-bulk-export-mcp.git
cd rapid7-bulk-export-mcp
uv sync

为开发进行配置

创建或编辑 .kiro/settings/mcp.json

{
  "mcpServers": {
    "rapid7-bulk-export": {
      "command": "/absolute/path/to/rapid7-bulk-export-mcp/.venv/bin/rapid7-mcp-server",
      "args": [],
      "env": {
        "RAPID7_API_KEY": "your-api-key-here",
        "RAPID7_REGION": "your-region",
        "DATA_DIR": "/Users/you/.rapid7-mcp"
      }
    }
  }
}

注意:command 直接指向 venv 入口点,而不是将 uv runcwd 一起使用。Claude Desktop 在启动 MCP 服务器时不保证工作目录,因此 uv run 可能会解析到缓存或系统安装的包版本,而不是本地源代码。

运行测试

uv run pytest

环境变量

变量

必需

默认值

描述

RAPID7_API_KEY

Rapid7 InsightVM API 密钥

RAPID7_REGION

us

API 区域:usus2us3eucaauap

DATA_DIR

~/.rapid7_mcp

数据库文件目录;必须可写。手动 parquet 导入必须放置在 $DATA_DIR/imports/

MCP_TRANSPORT

stdio

传输协议:stdiohttp

MCP_HOST

0.0.0.0

HTTP 绑定地址(仅当 MCP_TRANSPORT=http 时)

MCP_PORT

8000

HTTP 端口(仅当 MCP_TRANSPORT=http 时)

-
license - not tested
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cgisclair29/Rapid7-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server