maven mcp
一个模型上下文协议(MCP)服务器,将AI助手连接到Maven Central,实现依赖关系版本查找、更新检测和项目健康分析。
使用Rust构建,可实现快速启动和最小的资源使用。
特性
- 版本查找:获取任何Maven依赖项的最新稳定、RC、beta和alpha版本
- 版本验证:检查Maven Central上是否存在特定版本
- 更新检测:将当前版本与最新版本进行比较,并对更新进行分类(主要/次要/补丁)
- 批量分析:一次检查多个依赖关系,以进行高效的项目分析
- 年龄分析:将依赖关系分类为当前、新、老化、陈旧或过时
- 健康评分:获取项目依赖关系的总体健康评分(A-F级)
安装
克劳德桌面(MCPB捆绑包)
下载 maven-mcp.mcpb 从 发布页面 然后双击安装,或将其拖动到Claude Desktop中。
来源
git clone https://github.com/lukaesch/maven-mcp.git
cd maven-mcp
cargo build --release工具
get_latest_version
获取具有稳定性分类的Maven依赖项的最新版本。
参数:
dependency(必填):Maven坐标类似org.springframework:spring-coreprefer_stable(可选,默认值:true):优先考虑稳定版本
示例提示:
What's the latest version of spring-boot-starter-web?check_version_exists
验证Maven Central上是否存在特定版本。
参数:
dependency(必填):Maven与以下版本协调org.springframework:spring-core:6.1.0
示例提示:
Does spring-core version 6.1.0 exist?compare_versions
将当前版本与最新版本进行比较,并确定更新类型。
参数:
dependency(必填):Maven与以下版本协调org.springframework:spring-core:5.3.0stable_only(可选,默认:true):仅建议稳定版本升级
示例提示:
How outdated is my spring-core 5.3.0 dependency?check_multiple_dependencies
批量检查多个Maven依赖项以获取可用更新。
参数:
dependencies(必填):Maven坐标列表stable_only(可选,默认:true):仅建议稳定版本升级
示例提示:
Check these dependencies for updates:
- org.springframework.boot:spring-boot-starter-web:2.7.0
- com.fasterxml.jackson.core:jackson-databind:2.14.0
- org.apache.commons:commons-lang3:3.12.0analyze_dependency_age
分析依赖关系有多过时。
参数:
dependency(必填):Maven与版本协调
示例提示:
How stale is my hibernate-core 5.6.0 dependency?analyze_project_health
对所有项目依赖关系进行全面的健康分析。
参数:
dependencies(必填):Maven坐标及其版本列表
示例提示:
Analyze the health of my project dependencies:
[paste your pom.xml or build.gradle dependencies]从源头构建
# Debug build
cargo build
# Release build
cargo build --release
# Run tests
cargo test创建MCPB捆绑包
mkdir -p bundle/server
cp manifest.json bundle/
cp target/release/maven-mcp bundle/server/
cd bundle && zip -r ../maven-mcp.mcpb .建筑
src/
├── main.rs # Entry point, MCP server setup
├── lib.rs # Library exports
├── models/ # Data structures
│ ├── coordinate.rs # Maven coordinate parsing
│ └── version.rs # Version classification & comparison
├── maven/ # Maven Central client
│ ├── client.rs # HTTP client with caching
│ └── metadata.rs # maven-metadata.xml parsing
└── tools/ # MCP tools
├── service.rs # Tool implementations
└── responses.rs # Response types许可证
麻省理工学院
