Back to MCP directory
publicPublicdnsLocal runtime

maven-mcp-server

MCP服务器工具,用于查询和验证Maven依赖项版本

article

README

🚀 Maven 依赖项 MCP 服务器

Maven 依赖项 MCP 服务器是一个提供工具来检查 Maven 依赖项版本的 MCP(模型上下文协议)服务器。它能让大型语言模型(LLM)验证 Maven 依赖项,并从 Maven 中央仓库获取它们的最新版本。

🚀 快速开始

本服务器可助力大型语言模型(LLM)对 Maven 依赖项进行验证,并从 Maven 中央仓库获取其最新版本。你可以按照以下步骤快速使用本服务器。

📦 安装指南

使用 npm 安装

你可以使用 npm 全局安装这个 MCP 服务器:

npm install -g mcp-maven-deps

或者直接运行:

npx mcp-maven-deps

通过 Smithery 安装

要自动为 Claude 桌面版安装 Maven 依赖项服务器,请使用 Smithery

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"
    }
  }
}

开发修改

要修改或扩展服务器:

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

💻 使用示例

基础用法

get_maven_latest_version

获取 Maven 依赖项的最新版本。 输入方案:

{
  "type": "object",
  "properties": {
    "dependency": {
      "type": "string",
      "description": "Maven 坐标格式为 \"groupId:artifactId[:version][:packaging][:classifier]\"(例如 \"org.springframework:spring-core\" 或 \"org.springframework:spring-core:5.3.0:javadoc\")"
    }
  },
  "required": ["dependency"]
}

示例:

const result = await getMavenLatestVersion({
  dependency: 'com.example:mylib'
});

is_maven_version_valid

验证 Maven 依赖项版本是否有效。 输入方案:

{
  "type": "object",
  "properties": {
    "dependencyWithVersion": {
      "type": "string",
      "description": "带有版本号的 Maven 依赖项,格式为 \"groupId:artifactId:version\""
    }
  },
  "required": ["dependencyWithVersion"]
}

示例:

const result = await isMavenVersionValid({
  dependencyWithVersion: 'org.springframework:spring-core:5.3.0'
});

📄 许可证

本项目采用 MIT 许可证。

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client