M

MCP VirusTotal分析工具

一个用于查询[VirusTotal](https://www.virustotal.com/gui/home/upload) API 的 MCP 服务器。该服务器提供扫描 URL、分析文件哈希值和检索 IP 地址报告的工具。

security-and-iamother

386 查看 · 2026-07-07 更新

简介

一个用于查询VirusTotal API 的 MCP 服务器。该服务器提供扫描 URL、分析文件哈希值和检索 IP 地址报告的工具。

简介

一个用于查询VirusTotal API 的 MCP 服务器。该服务器提供扫描 URL、分析文件哈希值和检索 IP 地址报告的工具。

VirusTotal MCP 服务器

smithery 徽章

一个用于查询 VirusTotal API 的 Model Context Protocol (MCP) 服务器。该服务器提供全面的安全分析工具,并自动获取关系数据。它无缝集成到如 Claude Desktop 这样的 MCP 兼容应用程序中。

快速开始(推荐)

通过 Smithery 安装

要通过 Smithery 自动为 Claude Desktop 安装 VirusTotal 服务器:

npx -y @smithery/cli install @burtthecoder/mcp-virustotal --client claude

手动安装

  1. 通过 npm 全局安装服务器:
npm install -g @burtthecoder/mcp-virustotal
  1. 添加到你的 Claude Desktop 配置文件中:
{ "mcpServers": { "virustotal": { "command": "mcp-virustotal", "env": { "VIRUSTOTAL_API_KEY": "your-virustotal-api-key" } } } }

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  1. 重启 Claude Desktop

替代设置(从源代码)

如果你更喜欢从源代码运行或需要修改代码:

  1. 克隆并构建:
git clone <repository_url> cd mcp-virustotal npm install npm run build
  1. 添加到你的 Claude Desktop 配置中:
{ "mcpServers": { "virustotal": { "command": "node", "args": ["--experimental-modules", "/absolute/path/to/mcp-virustotal/build/index.js"], "env": { "VIRUSTOTAL_API_KEY": "your-virustotal-api-key" } } } }

功能

  • 全面的分析报告:每个分析工具都会自动获取相关的关系数据以及基本报告,从而在一个请求中提供完整的安全概览
  • URL 分析:带有自动获取联系域名、下载文件和威胁行为者的安全报告
  • 文件分析:详细分析文件哈希,包括行为、丢弃的文件和网络连接
  • IP 分析:包含历史数据、解析记录和相关威胁的安全报告
  • 域名分析:DNS 信息、WHOIS 数据、SSL 证书和子域
  • 详细的关系分析:支持分页查询特定类型关系的专用工具
  • 丰富的格式:清晰分类和呈现分析结果及关系数据

工具

报告工具(带自动关系获取)

1. URL 报告工具

  • 名称:get_url_report
  • 描述:获取一个综合的 URL 分析报告,包括安全扫描结果和关键关系(通信文件、联系域名/IP、下载文件、重定向、威胁行为者)
  • 参数:
    • url(必需):要分析的 URL

2. 文件报告工具

  • 名称:get_file_report
  • 描述:使用其哈希(MD5/SHA-1/SHA-256)获取一个全面的文件分析报告。包括检测结果、文件属性和关键关系(行为、丢弃的文件、网络连接、嵌入内容、威胁行为者)
  • 参数:
    • hash(必需):文件的 MD5、SHA-1 或 SHA-256 哈希

3. IP 报告工具

  • 名称: get_ip_report
  • 描述: 获取一个全面的 IP 地址分析报告,包括地理位置、信誉数据和关键关系(通信文件、历史证书/WHOIS、解析记录)
  • 参数:
    • ip (必需): 要分析的 IP 地址

4. 域名报告工具

  • 名称: get_domain_report
  • 描述: 获取一个全面的域名分析报告,包括 DNS 记录、WHOIS 数据和关键关系(SSL 证书、子域名、历史数据)
  • 参数:
    • domain (必需): 要分析的域名
    • relationships (可选): 要包含在报告中的特定关系数组

关系工具(用于详细分析)

1. URL 关系工具

  • 名称: get_url_relationship
  • 描述: 查询特定类型的 URL 关系,并支持分页。从 17 种关系类型中选择,包括分析、通信文件、联系的域名/IP、下载的文件、图表、引用者、重定向以及威胁行为者
  • 参数:
    • url (必需): 要获取关系的 URL
    • relationship (必需): 要查询的关系类型
      • 可用关系: analyses, comments, communicating_files, contacted_domains, contacted_ips, downloaded_files, graphs, last_serving_ip_address, network_location, referrer_files, referrer_urls, redirecting_urls, redirects_to, related_comments, related_references, related_threat_actors, submissions
    • limit (可选,默认值: 10): 要检索的相关对象的最大数量 (1-40)
    • cursor (可选): 用于分页的延续游标

2. 文件关系工具

  • 名称: get_file_relationship
  • 描述: 查询特定类型的文件关系,并支持分页。从 41 种关系类型中选择,包括行为、网络连接、丢弃的文件、嵌入的内容、执行链以及威胁行为者
  • 参数:
    • hash (必需): 文件的 MD5、SHA-1 或 SHA-256 哈希值
    • relationship (必需): 要查询的关系类型
      • 可用关系: analyses, behaviours, bundled_files, carbonblack_children, carbonblack_parents, ciphered_bundled_files, ciphered_parents, clues, collections, comments, compressed_parents, contacted_domains, contacted_ips, contacted_urls, dropped_files, email_attachments, email_parents, embedded_domains, embedded_ips, embedded_urls, execution_parents, graphs, itw_domains, itw_ips, itw_urls, memory_pattern_domains, memory_pattern_ips, memory_pattern_urls, overlay_children, overlay_parents, pcap_children, pcap_parents, pe_resource_children, pe_resource_parents, related_references, related_threat_actors, similar_files, submissions, screenshots, urls_for_embedded_js, votes
    • limit (可选,默认值: 10): 要检索的相关对象的最大数量 (1-40)
    • cursor (可选): 用于分页的延续游标

3. IP 关系工具

  • 名称: get_ip_relationship
  • 描述: 查询特定 IP 地址的某种关系类型,并支持分页。从 12 种关系类型中选择,包括通信文件、历史 SSL 证书、WHOIS 记录、解析记录和威胁参与者等
  • 参数:
    • ip (必需): 要分析的 IP 地址
    • relationship (必需): 要查询的关系类型
      • 可用关系: comments, communicating_files, downloaded_files, graphs, historical_ssl_certificates, historical_whois, related_comments, related_references, related_threat_actors, referrer_files, resolutions, urls
    • limit (可选, 默认: 10): 要检索的相关对象的最大数量(1-40)
    • cursor (可选): 分页时使用的连续游标

4. 域名关系工具

  • 名称: get_domain_relationship
  • 描述: 查询特定域名的某种关系类型,并支持分页。从 21 种关系类型中选择,包括 SSL 证书、子域名、历史数据和 DNS 记录等
  • 参数:
    • domain (必需): 要分析的域名
    • relationship (必需): 要查询的关系类型
      • 可用关系: caa_records, cname_records, comments, communicating_files, downloaded_files, historical_ssl_certificates, historical_whois, immediate_parent, mx_records, ns_records, parent, referrer_files, related_comments, related_references, related_threat_actors, resolutions, soa_records, siblings, subdomains, urls, user_votes
    • limit (可选, 默认: 10): 要检索的相关对象的最大数量(1-40)
    • cursor (可选): 分页时使用的连续游标

要求

故障排除

API 密钥问题

如果您看到“错误的 API 密钥”错误:

  1. 检查位于 /tmp/mcp-virustotal-server.log(在 macOS 上)的日志文件以查看 API 密钥状态
  2. 验证您的 API 密钥:
    • 应为有效的 VirusTotal API 密钥(通常是 64 个字符)
    • 密钥周围没有额外的空格或引号
    • 必须来自您的 VirusTotal 账户中的 API 密钥部分
  3. 在进行任何配置更改后:
    • 保存配置文件
    • 重启 Claude Desktop
    • 检查日志以获取新的 API 密钥状态

模块加载问题

如果您看到 ES 模块加载警告:

  1. 对于全局安装:使用快速入门中显示的简单配置
  2. 对于源码安装:确保在参数中包含 --experimental-modules

开发

要以开发模式运行并启用热重载:

npm run dev

错误处理

服务器包括全面的错误处理机制,涵盖以下情况:

  • 无效的 API 密钥
  • 速率限制
  • 网络错误
  • 无效的输入参数
  • 无效的哈希格式
  • 无效的 IP 格式
  • 无效的 URL 格式
  • 无效的关系类型
  • 分页错误

版本历史

请注意,原文档中关于开发环境下的具体命令行示例被截断了,标记为 #5 的部分可能需要根据实际开发指南补充完整信息。如果还有更多细节或有其他章节需要翻译,请告知!

  • v1.0.0: 初始版本,包含核心功能
  • v1.1.0: 添加了针对 URL、文件和 IP 地址的关系分析工具
  • v1.2.0: 增强了错误处理和日志记录
  • v1.3.0: 为关系查询添加了分页支持
  • v1.4.0: 在报告工具中添加了自动关系获取,并支持域名分析

贡献

  1. 叉取仓库
  2. 创建一个特性分支 (git checkout -b feature/amazing-feature)
  3. 提交你的更改 (git commit -m 'Add amazing feature')
  4. 推送到该分支 (git push origin feature/amazing-feature)
  5. 打开一个 Pull Request

许可证

本项目采用 MIT 许可证 - 详情请参阅 LICENSE 文件。

服务配置

[{'mcpServers': {'virustotal': {'command': 'mcp-virustotal', 'env': {'VIRUSTOTAL_API_KEY': 'your-virustotal-api-key'}}}}, {'mcpServers': {'virustotal': {'args': ['--experimental-modules', '/absolute/path/to/mcp-virustotal/build/index.js'], 'command': 'node', 'env': {'VIRUSTOTAL_API_KEY': 'your-virustotal-api-key'}}}}]

来源