Skip to content

AWS Cost Explorer MCP Server

MCP server for understanding AWS spend

Install

$git clone https://github.com/aarora79/aws-cost-explorer-mcp-server

Install command taken from the project's README or registry entry. Always review code before running it.

AWS Cost Explorer and Amazon Bedrock Model Invocation Logs MCP Server & Client

An MCP server for getting AWS spend data via Cost Explorer and Amazon Bedrock usage data via Model invocation logs in Amazon Cloud Watch through Anthropic's MCP (Model Control Protocol). See section on "secure" remote MCP server to see how you can run your MCP server over HTTPS.

flowchart LR
    User([User]) --> UserApp[User Application]
    UserApp --> |Queries| Host[Host]
    
    subgraph "Claude Desktop"
        Host --> MCPClient[MCP Client]
    end
    
    MCPClient --> |MCP Protocol over HTTPS| MCPServer[AWS Cost Explorer MCP Server]
    
    subgraph "AWS Services"
        MCPServer --> |API Calls| CostExplorer[(AWS Cost Explorer)]
        MCPServer --> |API Calls| CloudWatchLogs[(AWS CloudWatch Logs)]
    end

You can run the MCP server locally and access it via the Claude Desktop or you could also run a Remote MCP server on Amazon EC2 and access it via a MCP client built into a LangGraph Agent.

🚨You can also use this MCP server to get AWS spend information from other accounts as long as the IAM role used by the MCP server can assume roles in those other accounts🚨

Demo video

Overview

This tool provides a convenient way to analyze and visualize AWS cloud spending data using Anthropic's Claude model as an interactive interface. It functions as an MCP server that exposes AWS Cost Explorer API functionality to Claude Desktop, allowing you to ask questions about your AWS spend in natural language.

Features

  • Amazon EC2 Spend Analysis: View detailed breakdowns of EC2 spending for the last day
  • Amazon Bedrock Spend Analysis: View breakdown by region, users and models over the last 30 days
  • Service Spend Reports: Analyze spending across all AWS services for the last 30 days
  • Detailed Cost Breakdown: Get granular cost data by day, region, service, and instance type
  • Interactive Interface: Use Claude to query your cost data through natural language

Requirements

  • Python 3.12
  • AWS credentials with Cost Explorer access
  • Anthropic API access (for Claude integration)
  • [Optional] Amazon Bedrock access (for LangGraph Agent)
  • [Optional] Amazon EC2 for running a remote MCP server

Installation

  1. Install uv:

    # On macOS and Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # On Windows
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    

    Additional installation options are documented here

  2. Clone this repository: (assuming this will be updated to point to aws-samples?)

    git clone https://github.com/aarora79/aws-cost-explorer-mcp.git
    cd aws-cost-explorer-mcp
    
  3. Set up the Python virtual environment and install dependencies:

    uv venv --python 3.12 && source .venv/bin/activate && uv pip install --requirement pyproject.toml
    
  4. Configure your AWS credentials:

    mkdir -p ~/.aws
    # Set up your credentials in ~/.aws/credentials and ~/.aws/config
    

    If you useAWS IAM Identity Center, follow the docs to configure your short-term credentials

Similar plugs

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

Explore related