Bigsy_maven Mcp Server

Bigsy_maven Mcp Server

🚀 Maven 依赖 MCP 服务器

这是一个 MCP(模型上下文协议)服务器,提供工具用于检查 Maven 依赖版本。借助该服务器,大型语言模型能够验证 Maven 依赖项,并从 Maven 中央仓库检索其最新版本。

✨ 主要特性

  • 可查询任何 Maven 依赖项的最新版本。
  • 能够验证某个 Maven 依赖项是否存在。
  • 可以检查特定版本的依赖项是否存在。
  • 支持实时访问 Maven 中央仓库数据。

📦 安装指南

  1. 克隆或下载此仓库。
  2. 安装依赖:
npm install
  1. 构建服务器:
npm run build

🛠️ 配置说明

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

{
"mcpServers": {
"maven-deps-server": {
"command": "node",
"args": ["/path/to/maven-deps-server/build/index.js"]
}
}
}

💻 使用示例

get_maven_latest_version

检索某个 Maven 依赖项的最新版本。 输入 schema:

{
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Maven 依赖项格式为 \"groupId:artifactId\"(例如 \"org.springframework:spring-core\")"
}
},
"required": ["dependency"]
}

示例用法:

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

check_maven_version_exists

检查某个特定版本的 Maven 依赖项是否存在。 输入 schema:

{
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Maven 依赖项格式为 \"groupId:artifactId\"(例如 \"org.springframework:spring-core\")"
},
"version": {
"type": "string",
"description": "要检查的版本(例如 \"5.3.20\")"
}
},
"required": ["dependency", "version"]
}

示例用法:

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.apache.kafka:kafka-clients
"3.7.2"

// 输入: nonexistent.group:fake-artifact
"Maven 依赖项中未找到 nonexistent.group:fake-artifact"

版本存在性检查

// 输入: { dependency: "org.springframework:spring-core", version: "5.3.20" }
"true"

// 输入: { dependency: "org.springframework:spring-core", version: "0.0.1" }
"false"

🔧 技术细节

  • 利用 Maven 中央仓库的 REST API 拉取依赖项信息。
  • 根据时间戳对结果进行排序,以此确保返回最新版本。
  • 包含针对无效依赖项和 API 问题的错误处理。
  • 返回有效依赖项的干净、可解析的版本字符串。
  • 提供版本存在性检查的布尔响应。

❗ 错误处理

服务器能够处理各种错误情况,包括:

  • 无效依赖项格式。
  • 网络连接问题。
  • 无法找到依赖项信息。

📚 详细文档

要维护或扩展此服务器,可以参考以下仓库和文档:

📄 许可证

[此处插入许可证详细信息]

  • 0 关注
  • 0 收藏,24 浏览
  • system 提出于 2025-09-24 23:15

相似服务问题

相关AI产品