Cargo Metadata MCP Server
About
Cargo Metadata MCP Server implements a Model Context Protocol (MCP) server that exposes metadata from Cargo (Rust) projects. It provides tools to retrieve package information, dependencies, build targets, workspace details, and feature flags. This tool is for developers working…
Details
- Author
- frozenlib
- Downloads
- 312
- Categories
- Other
Jump to
- Get project metadata
- Get package information
- Get dependencies list
- Get build targets
- Get workspace information
- Get features information
Build the server with cargo build --release, then run it with cargo run or directly execute ./target/release/mcp-attr-example-cargo-metadata. To integrate with MCP clients like Claude Desktop, add the server configuration to the client settings JSON, specifying the command path to the binary.
Cargo Metadata MCP Server
このプロジェクトは、Model Context Protocol (MCP)を使用して、Cargo プロジェクトのメタデータ情報を提供するサーバーを実装しています。
機能
この MCP サーバーは以下の機能を提供します:
- プロジェクトのメタデータ情報の取得
- パッケージ情報の取得
- 依存関係リストの取得
- ビルドターゲットの取得
- ワークスペース情報の取得
- フィーチャー情報の取得
使い方
ビルド
cargo build --release
実行
cargo run
または、ビルド済みのバイナリを直接実行することもできます:
./target/release/mcp-attr-example-cargo-metadata
MCP クライアントとの連携
このサーバーを MCP クライアント(例:Claude Desktop)と連携するには、クライアントの設定ファイルに以下のように追加します:
{
"mcpServers": {
"cargo-metadata": {
"command": "path/to/mcp-attr-example-cargo-metadata"
}
}
}
提供されるツール
このサーバーは以下のツールを提供します:
1. get_metadata - プロジェクトのメタデータを取得します
2. get_package_info - プロジェクトのパッケージ情報を取得します
3. get_dependencies - プロジェクトの依存関係リストを取得します
4. get_targets - プロジェクトのビルドターゲットを取得します
5. get_workspace_info - プロジェクトのワークスペース情報を取得します
6. get_features - プロジェクトのフィーチャー情報を取得します
各ツールは、オプションで manifest_path パラメータを受け取ります。指定しない場合は、カレントディレクトリの Cargo.toml ファイルが使用されます。
技術的な詳細
このプロジェクトは以下の技術を使用しています:
- mcp-attr - MCP サーバーを宣言的に記述するための Rust クレート
- cargo_metadata - Cargo プロジェクトのメタデータを取得するための Rust クレート
- tokio - 非同期ランタイム
- serde - シリアライズ/デシリアライズフレームワーク
ライセンス
MIT または Apache-2.0
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



