maven-mcp-server
Maven Dependencies MCP Server
Maven依存関係のバージョンを確認するためのツールを提供するMCP(Model Context Protocol)サーバーです。このサーバーにより、LLMはMaven依存関係を検証し、Maven Central Repositoryから最新バージョンを取得できるようになります。
インストール
npmを使用して、このMCPサーバーをグローバルにインストールできます:
npm install -g mcp-maven-depsまたは、npxを使用して直接実行することもできます:
npx mcp-maven-depsSmithery経由でのインストール
Smithery を介してClaude Desktop用のMaven Dependencies Serverを自動的にインストールするには:
npx -y @smithery/cli install maven-deps-server --client claudeRelated MCP server: Maven Decoder MCP Server
機能
Maven依存関係の最新の安定版リリースを取得(デフォルトでプレリリース版を除外)
Maven依存関係が存在するかどうかを検証
特定のバージョンの依存関係が存在するかどうかを確認
オプションのプレリリースフィルタリングを使用してMaven依存関係のバージョンを一覧表示
インテリジェントなプレリリース検出(alpha、beta、milestone、RC、snapshot)
パッケージングや分類子を含む完全なMaven座標をサポート
Maven Central Repositoryデータへのリアルタイムアクセス
複数のビルドツール形式(Maven、Gradle、SBT、Mill)と互換性あり
開発用:
このリポジトリをクローン
依存関係をインストール:
npm installサーバーをビルド:
npm run build
設定
MCP設定ファイルにサーバーを追加します:
{
"mcpServers": {
"maven-deps-server": {
"command": "npx",
"args": ["mcp-maven-deps"]
}
}
}グローバルにインストールされている場合は、以下も使用できます:
{
"mcpServers": {
"maven-deps-server": {
"command": "mcp-maven-deps"
}
}
}トランスポートオプション
サーバーは2つのトランスポートモードをサポートしています:
stdio(デフォルト) - 標準入出力通信
SSE(Server-Sent Events) - オプションのリモートアクセスを備えたHTTPベースの通信
SSEトランスポートを使用するには、ホストとポートの両方を指定できます:
# Local access only (default host: localhost)
npx mcp-maven-deps --port=3000
# Remote access
npx mcp-maven-deps --host=0.0.0.0 --port=3000MCP設定でSSEトランスポートを使用する場合:
{
"mcpServers": {
"maven-deps-server": {
"command": "npx",
"args": ["mcp-maven-deps", "--port=3000"]
}
}
}リモートアクセスの場合は、クライアント設定でサーバーのIPまたはホスト名を使用してください:
{
"mcpServers": {
"maven-deps-server": {
"command": "npx",
"args": ["mcp-maven-deps", "--host=your-server-ip", "--port=3000"]
}
}
}利用可能なツール
get_latest_release
Maven依存関係の最新の安定版リリースバージョンを取得します。デフォルトでは、本番環境に対応したバージョンを確実に取得するために、プレリリースバージョン(alpha、beta、milestone、RC、snapshot)を除外します。
入力スキーマ:
{
"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\")"
},
"excludePreReleases": {
"type": "boolean",
"description": "Whether to exclude pre-release versions (alpha, beta, milestone, RC, snapshot). Default: true",
"default": true
}
},
"required": ["dependency"]
}使用例:
// Get latest stable release (default behavior)
const result1 = await mcpClient.callTool("maven-deps-server", "get_latest_release", {
dependency: "org.springframework:spring-core"
});
// Returns: "6.2.8" (latest stable, excludes "7.0.0-M6" milestone)
// Include pre-releases if needed
const result2 = await mcpClient.callTool("maven-deps-server", "get_latest_release", {
dependency: "org.springframework:spring-core",
excludePreReleases: false
});
// Returns: "7.0.0-M6" (includes pre-releases)check_maven_version_exists
特定のバージョンの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"
});list_maven_versions
Maven依存関係のバージョンをデプロイ順(最新のものから)に一覧表示します。オプションでプレリリースフィルタリングと深さ制御が可能です。出力は1行につき1バージョンです。
入力スキーマ:
{
"type": "object",
"properties": {
"dependency": {
"type": "string",
"description": "Maven coordinate in format \"groupId:artifactId[:packaging][:classifier]\" (e.g. \"org.springframework:spring-core\" or \"org.springframework:spring-core:jar\")"
},
"depth": {
"type": "number",
"description": "Number of versions to return (default: 15)",
"minimum": 1,
"maximum": 100
},
"excludePreReleases": {
"type": "boolean",
"description": "Whether to exclude pre-release versions (alpha, beta, milestone, RC, snapshot). Default: true",
"default": true
}
},
"required": ["dependency"]
}使用例:
// Get last 15 stable versions (default - excludes pre-releases)
const result1 = await mcpClient.callTool("maven-deps-server", "list_maven_versions", {
dependency: "org.springframework:spring-core"
});
// Returns only stable versions: "6.2.8\n6.1.21\n6.2.7\n..."
// Get last 5 versions including pre-releases
const result2 = await mcpClient.callTool("maven-deps-server", "list_maven_versions", {
dependency: "org.springframework:spring-core",
depth: 5,
excludePreReleases: false
});
// Returns: "7.0.0-M6\n6.2.8\n6.1.21\n7.0.0-M5\n6.2.7"実装の詳細
Maven Centralの
maven-metadata.xmlを直接クエリします(https://repo1.maven.org/maven2/<g>/<a>/maven-metadata.xml)。これは、MavenやGradle自体が依存関係解決時に参照する信頼できるファイルです。デプロイから数秒以内に更新されるため、結果が古くなることはありません。完全なMaven座標(groupId:artifactId:version:packaging:classifier)をサポート
正規表現パターンマッチングを使用したインテリジェントなプレリリース検出
maven-metadata.xmlに記録されている順序(最新のものから)でバージョンを返します無効な依存関係やAPIの問題に対するエラーハンドリングを含みます
有効な依存関係に対して、クリーンで解析可能なバージョン文字列を返します
バージョンの存在確認に対してブール値を返します
プレリリース検出
サーバーは以下のパターンを使用してプレリリースバージョンを自動的に検出します:
Alpha:
-alpha,-aBeta:
-beta,-bMilestone:
-milestone,-m,-MRelease Candidate:
-rc,-crSnapshot:
-snapshot
例:
7.0.0-M6→ プレリリース(milestone)6.2.8→ 安定版リリース3.1.0-SNAPSHOT→ プレリリース(snapshot)2.5.0-RC1→ プレリリース(release candidate)
破壊的変更に関する注意: ツール名は get_maven_last_updated_version から get_latest_release に変更され、デフォルトでプレリリースを除外するようになりました。これにより、本番アプリケーションはデフォルトで安定版を取得できるようになり、必要な場合にはプレリリースへのアクセスも引き続き可能です。
エラーハンドリング
サーバーは以下のエラーケースを処理します:
無効な依存関係形式
無効なバージョン形式
存在しない依存関係
安定版リリースが見つからない(フィルタリングが有効な場合)
API接続の問題
不正な形式のレスポンス
バージョン情報の欠落
開発
サーバーを変更または拡張するには:
src/index.tsを変更npm run buildを使用して再ビルドMCPサーバーを再起動して変更を適用
ライセンス
MIT
Available Tools
3 toolscheck_maven_version_existsC
Check if a specific version of a Maven dependency exists
Inputs: dependency (required), version.
get_latest_releaseA
Get the latest release version of a Maven dependency (excludes pre-releases by default)
Inputs: dependency (required), excludePreReleases.
list_maven_versionsB
List Maven dependency versions sorted by last updated date (most recent first)
Inputs: dependency (required), depth, excludePreReleases.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: checking if a specific version exists, getting the latest release version, and listing all versions sorted by recency. There is no overlap in functionality, and an agent can easily distinguish between them based on their specific use cases.
All tool names follow a consistent verb_noun pattern (check_maven_version_exists, get_latest_release, list_maven_versions), using snake_case throughout. The naming is predictable and readable, with no deviations in style or convention.
With only 3 tools, the server feels thin for a Maven dependency management domain. While the tools cover core query operations, the scope might be too limited, potentially lacking features like dependency resolution or artifact metadata retrieval that could be expected in such a server.
The tools provide good coverage for querying dependency versions, but there are notable gaps. For a Maven server, operations like searching for dependencies, retrieving artifact details (e.g., pom.xml), or managing repositories are missing, which could limit agent workflows in more complex scenarios.
Maintenance
Related MCP Connectors
MCP Server for JFrog, providing tools for development and artifact management.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for managing Maven dependency versions using direct metadata parsing from Maven Central. It provides tools to fetch latest stable versions, list version history, and compare versions with upgrade recommendations.4MIT
- AlicenseBqualityBmaintenanceA comprehensive MCP server for analyzing Maven jar files in the local repository, enabling AI agents to understand dependencies, analyze bytecode, and extract source code.1755 npm69 PyPI20MIT
- AlicenseBqualityDmaintenanceMaven MCP Server enables AI assistants to manage Maven dependencies through natural language, including version checking, security scanning, and dependency analysis.5MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that scans Maven project dependencies, decompiles Java class files, and provides class structure analysis to LLMs for accurate code generation.6Apache 2.0