mcp-trustedadvisor-server について
mcp-trustedadvisor-serverは、AWS Trusted Advisorのチェック、推奨事項、リソース情報にアクセスするMCPサーバーです。旧Support APIと新TrustedAdvisor APIに対応し、対象のAWSサポートプランでは組織単位の操作も行えます。
主な機能
- 01チェックの一覧表示と絞り込み
- 02推奨事項の閲覧と絞り込み
- 03推奨事項リソースの確認
- 04ライフサイクル状態と除外設定の更新
- 05組織の推奨事項の集約
活用シーン
- 01AWSアカウントのチェック項目の確認
- 02推奨リソースと状態の追跡
- 03推奨事項のライフサイクル管理
- 04組織全体の推奨事項の確認
MCP 対応
stdioを介して、AWS Trusted Advisorのチェック、推奨事項、リソース、ライフサイクル操作をMCPクライアントに公開します。組織単位の操作にはEnterprise Supportが必要です。
設定
ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。
このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。
ツール
ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。
詳細
MCP Trusted Advisor サーバー
レガシーな Support API と最新の TrustedAdvisor API エンドポイントの両方を通じて、AWS Trusted Advisor に包括的にアクセスできる Model Context Protocol(MCP)サーバーです。
概要
このサーバーは Model Context Protocol を実装し、次のような AWS Trusted Advisor の機能に標準化された方法でアクセスできるようにします。
- レガシー Support API:既存の Trusted Advisor 連携との互換性を提供します
- 最新の TrustedAdvisor API:パフォーマンスと機能を強化します
- Organizations のサポート:AWS Organizations 向けのエンタープライズレベルの機能を提供します
- リソース管理:詳細なリソース分析とライフサイクル管理を行います
機能
🔍 チェック管理
- 利用可能な Trusted Advisor チェックをすべて一覧表示し、絞り込めます
- 特定のチェックに関する詳細情報を取得できます
- 複数の言語(en、ja、fr、zh)に対応しています
📊 推奨事項
- さまざまな条件で推奨事項を一覧表示し、絞り込めます
- 推奨事項の詳細情報を取得できます
- リソースレベルの分析と管理を行えます
- ライフサイクル管理(進行中、却下済み、解決済みなど)を行えます
🏢 Organizations のサポート(エンタープライズサポートが必要です)
- 組織全体の推奨事項を集約します
- 複数アカウントのリソースを管理します
- 組織レベルのライフサイクル管理を行います
- アカウントごとにリソースを絞り込めます
⚙️ リソース操作
- リソースを一括で除外または包含します
- リソースのステータスを追跡します
- メタデータとリソースの詳細情報を取得します
- アカウントをまたいでリソースを表示できます
利用可能なリソース
レガシー Support API リソース
list-trusted-advisor-checks
レガシー Support API を使用して、利用可能な Trusted Advisor チェックをすべて一覧表示します。
- URI:
trusted-advisor://checks - パラメーター:
language、awsAccountId、region - フィルター:言語による絞り込み
- 要件:Business、Enterprise On-Ramp、または Enterprise Support プラン
get-trusted-advisor-recommendation
レガシー Support API を使用して、特定の推奨事項を取得します。
- URI:
trusted-advisor://recommendations/{checkId} - パラメーター:
checkId、language、awsAccountId - 要件:Business、Enterprise On-Ramp、または Enterprise Support プラン
最新の TrustedAdvisor API リソース
list-checks
絞り込み可能な Trusted Advisor チェックの一覧を取得します。
- URI:
trusted-advisor://checks/list - パラメーター:
awsService、pillar、source、maxResults、nextToken、language、awsAccountId、region - フィルター:AWS サービス、ピラー、ソース
- ページネーション:
nextTokenに対応しています
get-recommendation
特定の Trusted Advisor 推奨事項を取得します。
- URI:
trusted-advisor://recommendations/{recommendationIdentifier} - パラメーター:
recommendationIdentifier、language、awsAccountId、region - レスポンス:ライフサイクル情報を含む詳細な推奨事項
list-recommendations
絞り込み可能な Trusted Advisor 推奨事項の一覧を取得します。
- URI:
trusted-advisor://recommendations - パラメーター:
awsService、pillar、source、status、maxResults、nextToken、language、awsAccountId、region - フィルター:AWS サービス、ピラー、ソース、ステータス
- ページネーション:
nextTokenに対応しています
list-recommendation-resources
Trusted Advisor の推奨事項に関連するリソースを一覧表示します。
- URI:
trusted-advisor://recommendations/{recommendationIdentifier}/resources - パラメーター:
recommendationIdentifier、status、exclusionStatus、maxResults、nextToken、language、awsAccountId、region - フィルター:リソースのステータス、除外ステータス
- ページネーション:
nextTokenに対応しています
update-recommendation-lifecycle
Trusted Advisor 推奨事項のライフサイクルを更新します。
- URI:
trusted-advisor://recommendations/{recommendationIdentifier}/lifecycle - パラメーター:
recommendationIdentifier、lifecycleStage、updateReason、updateReasonCode、language、awsAccountId、region - ライフサイクルステージ:
pending_response、in_progress、dismissed、resolved - 注記:優先度付き推奨事項のみをサポートします。
batch-update-recommendation-resource-exclusion
推奨事項リソースのリストについて、1 つ以上の除外ステータスを更新します。
- URI:
trusted-advisor://recommendations/{recommendationIdentifier}/resource-exclusions - パラメーター:
recommendationIdentifier、resourceExclusions(配列)、language、awsAccountId、region - バッチサイズ:リクエストごとに最大 100 個のリソース
- 応答:各リソースの成功/エラーステータス
組織リソース(Enterprise Support が必要)
list-organization-recommendations
組織内の推奨事項をフィルタリング可能なセットとして一覧表示します。
- URI:
trusted-advisor://organizations/{organizationId}/recommendations - パラメーター:
organizationId、awsService、pillar、source、status、maxResults、nextToken、language、awsAccountId、region - 要件:Enterprise Support プラン
- 注記:優先度付き推奨事項のみをサポートします。
get-organization-recommendation
AWS Organizations の組織内にある特定の推奨事項を取得します。
- URI:
trusted-advisor://organizations/{organizationId}/recommendations/{recommendationIdentifier} - パラメーター:
organizationId、recommendationIdentifier、language、awsAccountId、region - 要件:Enterprise Support プラン
- 注記:優先度付き推奨事項のみをサポートします。
list-organization-recommendation-accounts
組織の集約推奨事項に含まれるリソースを所有するアカウントを一覧表示します。
- URI:
trusted-advisor://organizations/{organizationId}/recommendations/{recommendationIdentifier}/accounts - パラメーター:
organizationId、recommendationIdentifier、maxResults、nextToken、language、awsAccountId、region - 要件:Enterprise Support プラン
- 注記:優先度付き推奨事項のみをサポートします。
list-organization-recommendation-resources
組織内の推奨事項のリソースを一覧表示します。
- URI:
trusted-advisor://organizations/{organizationId}/recommendations/{recommendationIdentifier}/resources - パラメーター:
organizationId、recommendationIdentifier、status、exclusionStatus、affectedAccountId、maxResults、nextToken、language、awsAccountId、region - 要件:Enterprise Support プラン
- 注記:優先度付き推奨事項のみをサポートします。
update-organization-recommendation-lifecycle
組織内の推奨事項のライフサイクルを更新します。
- URI:
trusted-advisor://organizations/{organizationId}/recommendations/{recommendationIdentifier}/lifecycle - パラメーター:
organizationId、recommendationIdentifier、lifecycleStage、updateReason、updateReasonCode、language、awsAccountId、region - 要件:Enterprise Support プラン
- 注記:優先度付き推奨事項のみをサポートします。
設定
環境変数
AWS の設定はすべて、環境変数で管理できます。
# AWS Credentials
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
AWS_SESSION_TOKEN=your_session_token # if using temporary credentials
# AWS Configuration
AWS_REGION=us-east-1 # Default region
AWS_PROFILE=your_profile # AWS profile to use
# Trusted Advisor specific
AWS_SUPPORT_REGION=us-east-1 # Support API only available in us-east-1
AWS の権限
サーバーには、次の AWS 権限が必要です。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"support:DescribeTrustedAdvisorChecks",
"support:DescribeTrustedAdvisorCheckResult",
"trustedadvisor:ListChecks",
"trustedadvisor:GetRecommendation",
"trustedadvisor:ListRecommendations",
"trustedadvisor:ListRecommendationResources",
"trustedadvisor:UpdateRecommendationLifecycle",
"trustedadvisor:BatchUpdateRecommendationResourceExclusion",
"trustedadvisor:ListOrganizationRecommendations",
"trustedadvisor:GetOrganizationRecommendation",
"trustedadvisor:ListOrganizationRecommendationAccounts",
"trustedadvisor:ListOrganizationRecommendationResources",
"trustedadvisor:UpdateOrganizationRecommendationLifecycle"
],
"Resource": "*"
}
]
}
サポートプラン
機能によって、必要な AWS Support プランが異なります。
- Basic Support:Trusted Advisor にアクセスできません
- Developer Support:Trusted Advisor へのアクセスが制限されます
- Business Support:個別アカウントの Trusted Advisor にフルアクセスできます
- Enterprise On-Ramp:個別アカウントの Trusted Advisor にフルアクセスできます
- Enterprise Support:個別アカウントおよび組織全体の Trusted Advisor にフルアクセスできます
エラー処理
サーバーは包括的なエラー処理を実装しています。
- AWS API エラー:AWS エラーコードを含む適切な形式のエラーレスポンス
- 検証エラー:詳細なエラーメッセージを伴う入力検証
- ネットワークエラー:接続の問題への適切な対応
- 権限エラー:不足している権限を明確に表示
インストール
# Install dependencies
pnpm install
# Build the project
pnpm run build
# Run the server
pnpm start
MCP での使用
このサーバーは、MCP 対応クライアントで使用できるように設計されています。サーバーは stdio 経由で通信し、すべての操作に対して構造化された JSON レスポンスを提供します。
AI クライアントの設定
Claude Desktop
このサーバーを Claude Desktop の設定ファイルに追加します。
場所:~/Library/Application Support/Claude/claude_desktop_config.json(macOS)または %APPDATA%/Claude/claude_desktop_config.json(Windows)
{
"mcpServers": {
"trusted-advisor": {
"command": "node",
"args": ["/path/to/mcp-trustedadvisor-server/build/main.js"],
"env": {
"AWS_REGION": "us-east-1",
"AWS_ACCESS_KEY_ID": "your_access_key",
"AWS_SECRET_ACCESS_KEY": "your_secret_key"
}
}
}
}
Amazon Q Developer
Amazon Q Developer の設定で MCP サーバーを構成します。
{
"mcp": {
"servers": {
"trusted-advisor": {
"command": "node",
"args": ["/path/to/mcp-trustedadvisor-server/build/main.js"],
"environment": {
"AWS_REGION": "us-east-1",
"AWS_PROFILE": "your-aws-profile"
}
}
}
}
}
その他の MCP クライアント
MCP 対応クライアントでは、次のパラメーターを使用します。
# Command to run the server
node /path/to/mcp-trustedadvisor-server/build/main.js
# Required environment variables
AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_access_key
AWS_SECRET_ACCESS_KEY=your_secret_key
# Optional environment variables
AWS_PROFILE=your-profile
AWS_SESSION_TOKEN=your_session_token
サーバーの使用
設定が完了すると、AI クライアントに次のように依頼できます。
- 利用可能なチェックを一覧表示:「利用可能な Trusted Advisor チェックをすべて表示して」
- 推奨事項を取得:「アカウントに対する現在の Trusted Advisor の推奨事項は?」
- 特定のサービスを確認:「コスト最適化に関する推奨事項を表示して」
- リソースを管理:「推奨事項 xyz のライフサイクルステータスを resolved に更新して」
- 組織のインサイト:「組織全体の推奨事項をすべて一覧表示して」
AI クライアントは、依頼に応じて適切な MCP リソースを自動的に使用し、Trusted Advisor のデータを含む構造化されたレスポンスを提供します。
アーキテクチャ
サーバーはクリーンコードの原則に従っており、次の特徴があります。
- モジュール設計:各機能を独立したモジュールに配置
- 再利用可能なコンポーネント:共有スキーマ、ユーティリティ、エラー処理
- 型安全性:厳密な型付けによる TypeScript の完全な実装
- エラー耐性:包括的なエラー処理と検証
- 拡張性:新しい Trusted Advisor 機能を簡単に追加可能
コントリビューション
- リポジトリをフォークします
- 機能ブランチを作成します
- 既存のパターンに沿って変更を実装します
- 新しい機能のテストを追加します
- プルリクエストを送信します
ライセンス
このプロジェクトは MIT ライセンスの下でライセンスされています。詳細は LICENSE ファイルをご覧ください。
コメント
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。