VirusTotal MCP 服务器
一个用于查询 VirusTotal API 的模型上下文协议 (MCP) 服务器。该服务器提供全面的安防分析工具,并支持自动关系数据获取。它可以无缝集成到支持 MCP 的应用程序中,例如 Claude Desktop。
快速入门(推荐)
通过 Smithery 安装
要自动为 Claude Desktop 安装 VirusTotal 服务器,请通过 Smithery 执行以下命令:
npx -y @smithery/cli install @burtthecoder/mcp-virustotal --client claude
手动安装
- 通过 npm 全局安装服务器:
npm install -g @burtthecoder/mcp-virustotal
- 添加到您的 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
- 重新启动 Claude Desktop
替代设置(从源代码)
如果您希望从源代码运行或需要修改代码:
- 克隆并构建:
git clone <repository_url>
cd mcp-virustotal
npm install
npm run build
- 添加到您的 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 地址分析报告,包括地理位置、声誉数据和相关关系(通信文件、历史 SSL 证书/WHOIS、解析记录)
- 参数:
ip(必需):要分析的 IP 地址
4. 域名报告工具
- 名称:
get_domain_report - 描述:获取全面的域名分析报告,包括 DNS 记录、WHOIS 数据和关键关系(SSL 证书、子域名、历史数据)
- 参数:
domain(必需):要分析的域名relationships(可选):报告中要包含的特定关系数组
关系工具(用于详细分析)
1. URL 关系工具
- 名称:
get_url_relationship - 描述:查询 URL 的特定关系类型,支持分页。可选择 17 种关系类型,包括分析、通信文件、接触的域名/IP、下载的文件、图表、来源文件、重定向、威胁行为者等
- 参数:
url(必需):要获取关系的 URLrelationship(必需):要查询的关系类型- 可用关系类型: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(可选):分页的延续游标
要求
- Node.js (v18 或更高版本)
- 一个有效的 VirusTotal API 密钥
故障排除
API 密钥问题
如果您看到 "错误的 API 密钥" 错误:
- 在 macOS 上检查
/tmp/mcp-virustotal-server.log日志文件中的 API 密钥状态 - 验证您的 API 密钥:
- 应该是一个有效的 VirusTotal API 密钥(通常 64 个字符)
- 密钥周围没有多余的空格或引号
- 必须来自 VirusTotal 账户中的 API 密钥部分
- 在任何配置更改后:
- 保存配置文件
- 重新启动 Claude Desktop
- 检查日志以获取新的 API 密钥状态
模块加载问题
如果您看到 ES 模块加载警告:
- 对于全局安装:使用快速入门中显示的简单配置
- 对于源代码安装:确保在 args 中包含
--experimental-modules
开发
要在开发模式下运行并启用热重载:
npm run dev
错误处理
服务器包含全面的错误处理,用于:
- 无效的 API 密钥
- 速率限制
- 网络错误
- 无效的输入参数
- 无效的哈希格式
- 无效的 IP 格式
- 无效的 URL 格式
- 无效的关系类型
- 分页错误
版本历史
- v1.0.0:初始版本,包含核心功能
- v1.1.0:添加了 URL、文件和 IP 地址的关系分析工具
- v1.2.0:添加了改进的错误处理和日志记录
- v1.3.0:添加了关系查询的分页支持
- v1.4.0:报告工具和域名分析支持自动关系获取
贡献
- 分支仓库
- 创建功能分支 (
git checkout -b feature/amazing-feature) - 提交您的更改 (
git commit -m '添加 amazing 功能') - 推送到分支 (
git push origin feature/amazing-feature) - 打开 Pull Request
许可证
本项目根据 MIT 许可证授权 - 详细内容请参阅 LICENSE 文件。
