Maven Dependencies MCP Server
镜像
这个 MCP 服务器可以验证 Maven 依赖并从 Maven 中央仓库获取最新版本信息。
安装与配置
# 1. 克隆仓库
# 2. 安装依赖
npm install
# 3. 构建服务器
npm run build
将服务器添加到 MCP 配置中:
{
"mcpServers": {
"maven-deps-server": {
"command": "node",
"args": ["/path/to/maven-deps-server/build/index.js"]
}
}
}
可用工具
1. 获取最新版本
使用 get_maven_latest_version
工具检索 Maven 依赖的最新版本。
const result = await mcpClient.callTool("maven-deps-server", "get_maven_latest_version", {
dependency: "org.springframework:spring-core"
});
// 返回: "6.2.1"
2. 检查版本是否存在
使用 check_maven_version_exists
工具验证特定版本是否存在。
const result = await mcpClient.callTool("maven-deps-server", "check_maven_version_exists", {
dependency: "org.springframework:spring-core",
version: "5.3.20"
});
// 返回: "true" 或 "false"
示例响应
// 最新版本检查 (org.springframework:spring-core)
"6.2.1"
// 版本存在性检查 (org.springframework:spring-core, 5.3.20)
"true"
// 无效依赖
"No Maven dependency found for nonexistent.group:fake-artifact"
功能概述
- ✅ 查询任何 Maven 依赖的最新版本
- ✅ 验证 Maven 依赖是否存在
- ✅ 检查特定版本的依赖是否存在
- ✅ 实时访问 Maven 中央仓库数据
- ✅ 完善的错误处理
许可证
MIT