0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

KiroでBilling and Cost Management MCPを利用する

0
Posted at

事前準備

上記の「前提条件」の箇所に記載があります。AWSアカウント側の準備は完了しているものとして、下記項目から実施していきます。環境はWindowsです。

Astral か GitHub README から uv をインストールしていること
uv python install 3.12 を使用して Python をインストールしていること
必要なサービスにアクセスできるように AWS クレデンシャルを設定していること
MCP クライアントの設定に MCP サーバーを追加していること

  • uvのインストール
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  • pythonのインストール
uv python install 3.12
Installed Python 3.12.10 in 7.28s                                   
 + cpython-3.12.10-windows-x86_64-none
  • AWSクレデンシャルの設定
aws configure
AWS Access Key ID [********************]: 
AWS Secret Access Key [********************]: 
Default region name [ap-northeast-1]: 
Default output format [json]: 
  • MCPサーバーの追加

kiroのマーク → MCP SERVERS → 編集マーク → User Configをクリックするとmcp.jsonが開きます。

mcp01.png

mcp.jsonに下記記載後、保存します。

{
  "mcpServers": {
    "awslabs.billing-cost-management-mcp-server": {
      "command": "uvx",
      "args": [
        "--from",
        "awslabs.billing-cost-management-mcp-server@latest",
        "awslabs.billing-cost-management-mcp-server.exe"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR",
        "AWS_PROFILE": "default",
        "AWS_REGION": "ap-northeast-1",
        "HTTP_PROXY": "http://proxy.example.com:8080",
        "HTTPS_PROXY": "http://proxy.example.com:8080"
      },
      "disabled": false,
      "autoApprove": [
        "cost-explorer"
      ]
    }
  }
}

社内環境でプロキシサーバーを使用している場合は上記、HTTP_PROXY、HTTPS_PROXYを追加します。

下記、MCPサーバが追加されてステータスがConnectedになっていれば完了です。

mcp0.png

  • 「#」→ MCP をクリックして今回追加したMCPサーバが表示されるか確認します。

mcp02.png

MCPサーバの利用

  • 下記から問合せを行います。

mcp03.png

  • 主要コスト項目や分析結果が表示されました。

mcp04.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?