Maven 依赖项 MCP 服务器是一个提供工具来检查 Maven 依赖项版本的 MCP(模型上下文协议)服务器。它能让大型语言模型(LLM)验证 Maven 依赖项,并从 Maven 中央仓库获取它们的最新版本。
本服务器可助力大型语言模型(LLM)对 Maven 依赖项进行验证,并从 Maven 中央仓库获取其最新版本。你可以按照以下步骤快速使用本服务器。
你可以使用 npm 全局安装这个 MCP 服务器:
npm install -g mcp-maven-deps
或者直接运行:
npx mcp-maven-deps
要自动为 Claude 桌面版安装 Maven 依赖项服务器,请使用 Smithery:
npx -y @smithery/cli install maven-deps-server --client claude
npm installnpm run build将服务器添加到你的 MCP 设置配置文件中:
{
"mcpServers": {
"maven-deps-server": {
"command": "npx",
"args": ["mcp-maven-deps"]
}
}
}
如果全局安装,你也可以使用:
{
"mcpServers": {
"maven-deps-server": {
"command": "mcp-maven-deps"
}
}
}
要修改或扩展服务器:
src/index.tsnpm run build 重建获取 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'
});
验证 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 许可证。