Maven Dependencies MCP Server

Maven Dependencies MCP Server

一个提供 Maven 依赖版本检查工具的 MCP (模型上下文协议) 服务器。

npm 版本 maven-mcp-server MCP 服务器

简介

这是一个MCP服务器,提供工具来验证Maven依赖并从Maven中央仓库检索最新版本信息。

安装

# 全局安装
npm install -g mcp-maven-deps

# 或直接使用npx
npx mcp-maven-deps

# 通过Smithery为Claude Desktop安装
npx -y @smithery/cli install maven-deps-server --client claude

配置

将服务器添加到MCP设置中:

{
  "mcpServers": {
    "maven-deps-server": {
      "command": "mcp-maven-deps"
    }
  }
}

可用工具

获取最新版本

// 检索Maven依赖的最新版本
const result = await mcpClient.callTool("maven-deps-server", "get_maven_latest_version", {
  dependency: "org.springframework:spring-core"
});
// 返回: "6.2.2"

检查版本是否存在

// 方式1: 依赖字符串中包含版本
const result1 = await mcpClient.callTool("maven-deps-server", "check_maven_version_exists", {
  dependency: "org.springframework:spring-core:5.3.20"
});

// 方式2: 使用单独的版本参数
const result2 = await mcpClient.callTool("maven-deps-server", "check_maven_version_exists", {
  dependency: "org.springframework:spring-core",
  version: "5.3.20"
});

功能特点

  • 查询任何Maven依赖的最新版本
  • 验证Maven依赖是否存在
  • 支持完整的Maven坐标 (groupId:artifactId:version:packaging:classifier)
  • 实时访问Maven中央仓库数据
  • 兼容多种构建工具格式(Maven、Gradle、SBT、Mill)

许可

MIT