Maven 依存関係 MCP サーバー
Mavenの依存関係バージョンを確認するためのツールを提供するMCP(Model Context Protocol)サーバー。このサーバーにより、LLMはMavenの依存関係を検証し、Maven Central Repositoryから最新バージョンを取得できます。
インストール
この MCP サーバーは、npm を使用してグローバルにインストールできます。
npm install -g mcp-maven-deps
または、npx を使用して直接実行します。
Smithery経由でインストール
Smithery経由で Claude Desktop 用の Maven Dependencies Server を自動的にインストールするには:
npx -y @smithery/cli install maven-deps-server --client claude
Related MCP server: cve-search_mcp
特徴
Maven依存関係の最新バージョンを照会する
Maven依存関係が存在するかどうかを確認する
依存関係の特定のバージョンが存在するかどうかを確認する
パッケージングと分類子を含む完全な 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=3000
MCP 設定で 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_maven_latest_version
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"
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"
});
実装の詳細
Maven CentralのREST APIを使用して依存関係情報を取得します
完全な Maven 座標 (groupId:artifactId:version:packaging:classifier) をサポートします
最新バージョンが返されるように、結果をタイムスタンプで並べ替えます
無効な依存関係やAPIの問題に対するエラー処理が含まれています
有効な依存関係のクリーンで解析可能なバージョン文字列を返します
バージョンの存在チェックにブール応答を提供します
エラー処理
サーバーはさまざまなエラーケースを処理します。
依存関係の形式が無効です
無効なバージョン形式
存在しない依存関係
API接続の問題
不正な応答
バージョン情報が見つかりません
発達
サーバーを変更または拡張するには:
src/index.tsに変更を加える
npm run buildを使用して再構築します
変更を適用するには、MCP サーバーを再起動します。
ライセンス
マサチューセッツ工科大学