maven-mcp-server

by Bigsy
Verified

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Supports Maven dependency checking in Gradle build tool format

Maven 依赖 MCP 服务器

一个 MCP(模型上下文协议)服务器,提供用于检查 Maven 依赖项版本的工具。此服务器使 LLM 能够验证 Maven 依赖项并从 Maven 中央存储库检索其最新版本。

安装

您可以使用 npm 全局安装此 MCP 服务器:

npm install -g mcp-maven-deps

或者直接使用 npx 运行:

npx mcp-maven-deps

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Maven Dependencies Server:

npx -y @smithery/cli install maven-deps-server --client claude

特征

  • 查询任何 Maven 依赖项的最新版本
  • 验证 Maven 依赖项是否存在
  • 检查依赖项的特定版本是否存在
  • 支持完整的 Maven 坐标,包括包装和分类器
  • 实时访问 Maven 中央存储库数据
  • 兼容多种构建工具格式(Maven、Gradle、SBT、Mill)

对于开发:

  1. 克隆此存储库
  2. 安装依赖项: npm install
  3. 构建服务器: npm run build

配置

将服务器添加到您的 MCP 设置配置文件:

{ "mcpServers": { "maven-deps-server": { "command": "npx", "args": ["mcp-maven-deps"] } } }

如果全局安装,您还可以使用:

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

可用工具

获取 Maven 最新版本

检索 Maven 依赖项的最新版本。

输入模式:

{ "type": "object", "properties": { "dependency": { "type": "string", "description": "Maven coordinate in format \"groupId:artifactId[:version][:packaging][:classifier]\" (e.g. \"org.springframework:spring-core\" or \"org.springframework:spring-core:5.3.20:jar\")" } }, "required": ["dependency"] }

示例用法:

const result = await mcpClient.callTool("maven-deps-server", "get_maven_latest_version", { dependency: "org.springframework:spring-core" }); // Returns: "6.2.2"

检查 Maven 版本是否存在

检查 Maven 依赖项的特定版本是否存在。版本信息可以在依赖项字符串中提供,也可以作为单独的参数提供。

输入模式:

{ "type": "object", "properties": { "dependency": { "type": "string", "description": "Maven coordinate in format \"groupId:artifactId[:version][:packaging][:classifier]\" (e.g. \"org.springframework:spring-core\" or \"org.springframework:spring-core:5.3.20:jar\")" }, "version": { "type": "string", "description": "Version to check if not included in dependency string" } }, "required": ["dependency"] }

示例用法:

// Using version in dependency string const result1 = await mcpClient.callTool("maven-deps-server", "check_maven_version_exists", { dependency: "org.springframework:spring-core:5.3.20" }); // Using separate version parameter const result2 = await mcpClient.callTool("maven-deps-server", "check_maven_version_exists", { dependency: "org.springframework:spring-core", version: "5.3.20" });

实现细节

  • 使用 Maven Central 的 REST API 获取依赖项信息
  • 支持完整的 Maven 坐标(groupId:artifactId:version:packaging:classifier)
  • 按时间戳对结果进行排序,以确保返回最新版本
  • 包括无效依赖项和 API 问题的错误处理
  • 返回有效依赖项的干净、可解析的版本字符串
  • 为版本存在性检查提供布尔响应

错误处理

服务器处理各种错误情况:

  • 依赖项格式无效
  • 版本格式无效
  • 不存在的依赖关系
  • API 连接问题
  • 格式错误的响应
  • 缺少版本信息

发展

要修改或扩展服务器:

  1. 修改src/index.ts
  2. 使用npm run build重建
  3. 重启 MCP 服务器以应用更改

执照

麻省理工学院

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

一个 MCP(模型上下文协议)服务器,提供用于检查 Maven 依赖项版本的工具。此服务器使 LLM 能够验证 Maven 依赖项并从 Maven 中央存储库检索其最新版本。

  1. Installation
    1. Installing via Smithery
  2. Features
    1. Configuration
      1. Available Tools
        1. get_maven_latest_version
        2. check_maven_version_exists
      2. Implementation Details
        1. Error Handling
          1. Development
            1. License
              ID: juuo2ye0qi