npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-maven-security

v1.0.9

Published

MCP tool for scanning Maven project dependency vulnerabilities

Downloads

784

Readme

MCP-MAVEN-SECURITY

npm version License: MIT

🤖 This project is generated by AI

一个用于扫描 Maven 项目依赖漏洞的 MCP (Model Context Protocol) 工具。支持任何兼容 MCP 协议的 AI 助手使用。

✨ 特性

  • � **POM 解析T - 支持单模块、多模块项目,自动解析属性占位符和 Parent POM
  • 🛡️ 免费数据源 - 使用 OSV (Open Source Vulnerabilities) 查询漏洞,无需注册
  • 📊 严重程度分级 - Critical、High、Medium、Low、Unrated
  • 💾 本地缓存 - SQLite 持久化缓存,24 小时过期,避免重复查询
  • 📈 增量扫描 - 只查询变更的依赖,大幅提升扫描速度
  • 📄 报告导出 - 支持 PDF 和 TXT 格式
  • 定时扫描 - 支持秒/分/时间隔配置
  • 🔧 修复建议 - 提供安全版本升级建议

🚀 快速开始

方式一:npx 直接运行(推荐)

无需安装,在 MCP 配置文件中添加:

{
  "mcpServers": {
    "maven-security": {
      "command": "npx",
      "args": ["-y", "mcp-maven-security"]
    }
  }
}

方式二:全局安装

npm install -g mcp-maven-security

配置:

{
  "mcpServers": {
    "maven-security": {
      "command": "mcp-maven-security"
    }
  }
}

方式三:本地开发

git clone https://github.com/FronNian/mpc-maven-security.git
cd mpc-maven-security
npm install
npm run build

配置:

{
  "mcpServers": {
    "maven-security": {
      "command": "node",
      "args": ["/path/to/mcp-maven-security/dist/index.js"]
    }
  }
}

🛠️ MCP 工具列表

| 工具名 | 描述 | 参数 | |--------|------|------| | scan_project | 扫描 Maven 项目的依赖漏洞 | project_path (必填), full_scan (可选) | | get_scan_progress | 获取扫描任务进度 | task_id (必填) | | query_vulnerability | 查询指定依赖的漏洞信息 | group_id, artifact_id, version (必填) | | export_report | 导出漏洞报告 | task_id (必填), format (PDF/TXT), severity_filter | | get_scan_history | 获取扫描历史记录 | project_path (必填), limit (可选) | | configure_schedule | 配置定时扫描 | project_path, interval (如 30s/5m/1h), enabled | | clear_cache | 清除漏洞缓存 | dependency_key (可选,不填清除全部) | | get_config_status | 获取配置状态和可用数据源 | 无 |

💬 使用示例

在支持 MCP 的 AI 助手中,你可以这样说:

扫描 /path/to/my-maven-project 的依赖漏洞
查询 org.apache.logging.log4j:log4j-core:2.14.0 的漏洞
导出漏洞报告为 PDF 格式
设置每小时自动扫描一次

📦 数据源

默认数据源(免费,无需配置)

  • OSV (Open Source Vulnerabilities) - Google 维护的开源漏洞数据库

可选数据源(推荐配置 Snyk)

通过环境变量配置额外数据源以获取更全面的漏洞信息:

{
  "mcpServers": {
    "maven-security": {
      "command": "npx",
      "args": ["-y", "mcp-maven-security"],
      "env": {
        "SNYK_TOKEN": "your-snyk-token",
        "OSS_INDEX_USER": "your-email",
        "OSS_INDEX_TOKEN": "your-token",
        "NVD_API_KEY": "your-nvd-api-key"
      }
    }
  }
}

| 数据源 | 说明 | 免费额度 | 注册地址 | |--------|------|----------|----------| | Snyk ⭐ | 漏洞覆盖最全,推荐 | 200次/月 | https://app.snyk.io/account | | OSS Index | Sonatype 漏洞索引 | 无限制 | https://ossindex.sonatype.org/ | | NVD | 美国国家漏洞数据库 | 无限制 | https://nvd.nist.gov/developers/request-an-api-key |

📋 报告示例

TXT 报告输出示例:

════════════════════════════════════════════════════════════
           MAVEN 依赖漏洞扫描报告
════════════════════════════════════════════════════════════

项目名称: my-project
扫描时间: 2024-12-14T10:30:00.000Z

────────────────────────────────────────────────────────────
                    摘要
────────────────────────────────────────────────────────────
依赖总数: 45
存在漏洞的依赖: 3
严重漏洞: 1
高危漏洞: 2
中危漏洞: 1
低危漏洞: 0

────────────────────────────────────────────────────────────
                  漏洞详情
────────────────────────────────────────────────────────────

【org.apache.logging.log4j:log4j-core:2.14.0】
  发现 1 个漏洞:

  ● CVE-2021-44228 [严重]
    CVSS: 10.0
    描述: Apache Log4j2 远程代码执行漏洞...
    修复版本: 2.17.0

  ★ 建议升级: 2.14.0 → 2.17.0

🏗️ 项目结构

src/
├── cache/          # 缓存管理 (SQLite)
├── mcp/            # MCP Server 实现
├── parsers/        # POM 文件解析器
├── reporters/      # 报告生成器 (PDF/TXT)
├── scanners/       # 漏洞扫描器和数据源客户端
├── schedulers/     # 定时任务调度器
├── tasks/          # 异步任务管理
├── types/          # TypeScript 类型定义
└── utils/          # 工具函数

📄 License

MIT

🤝 Contributing

欢迎提交 Issue 和 Pull Request!