AWS Cost Explorer

v1.0.0Cloud Servicesstable

A command-line interface and API that allows users to analyze and visualize AWS cloud spending data by enabling Claude to query AWS Cost Explorer through natural language conversations.

bedrockclaude-desktopcostcost-explorerlanggraph
Share:
127
Stars
0
Downloads
0
Weekly
0/5

What is AWS Cost Explorer?

AWS Cost Explorer is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to command-line interface and api that allows users to analyze and visualize aws cloud spending data by enabling claude to query aws cost explorer through natural language conversations.

A command-line interface and API that allows users to analyze and visualize AWS cloud spending data by enabling Claude to query AWS Cost Explorer through natural language conversations.

This server falls under the Cloud Services and Analytics categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A command-line interface and API that allows users to analyz

Use Cases

Analyze AWS cloud spending through natural language queries.
Visualize cost trends and optimize cloud expenses with AI insights.
aarora79

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedApr 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx aws-cost-explorer-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use AWS Cost Explorer

The AWS Cost Explorer MCP Server connects AI assistants to AWS Cost Explorer and Amazon Bedrock usage data, enabling natural language queries against your actual cloud spending without writing Cost Explorer API calls manually. It exposes four focused tools covering EC2 daily spend, service-level cost breakdowns, and Bedrock model usage statistics at both daily and hourly granularity. Finance teams, DevOps engineers, and ML practitioners use it to get instant answers about cloud cost trends, identify expensive services, and understand Bedrock usage patterns through conversation.

Prerequisites

  • Python 3.12+ with uv package manager installed
  • AWS account with Cost Explorer enabled and IAM credentials with ce:GetCostAndUsage permissions
  • AWS credentials configured via environment variables or ~/.aws/credentials
  • An MCP-compatible client such as Claude Desktop
  • Optional: CloudWatch access if using Bedrock usage stats (BEDROCK_LOG_GROUP_NAME)
1

Install uv

The project uses uv for dependency management. Install it before proceeding.

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2

Clone and set up the project

Clone the repository, create a virtual environment with Python 3.12, and install all dependencies.

git clone https://github.com/aarora79/aws-cost-explorer-mcp-server.git
cd aws-cost-explorer-mcp-server
uv venv --python 3.12
source .venv/bin/activate
uv pip install --requirement pyproject.toml
3

Configure AWS credentials

Create or update your AWS credentials files with an account that has Cost Explorer read permissions.

mkdir -p ~/.aws
# Then edit ~/.aws/credentials:
[default]
aws_access_key_id = YOUR_ACCESS_KEY_ID
aws_secret_access_key = YOUR_SECRET_ACCESS_KEY

# And ~/.aws/config:
[default]
region = us-east-1
4

Set optional environment variables

Configure optional environment variables for Bedrock log monitoring or cross-account role access.

export AWS_REGION=us-east-1
export BEDROCK_LOG_GROUP_NAME=/aws/bedrock/model-invocations
# For cross-account:
export CROSS_ACCOUNT_ROLE_NAME=CostExplorerReadRole
5

Add the server to Claude Desktop config

Register the server in your claude_desktop_config.json. The server uses stdio transport by default.

{
  "mcpServers": {
    "aws-cost-explorer": {
      "command": "/path/to/aws-cost-explorer-mcp-server/.venv/bin/python",
      "args": ["/path/to/aws-cost-explorer-mcp-server/server.py"],
      "env": {
        "AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_ID",
        "AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY",
        "AWS_REGION": "us-east-1",
        "MCP_TRANSPORT": "stdio"
      }
    }
  }
}

AWS Cost Explorer Examples

Client configuration

Complete Claude Desktop configuration entry for the AWS Cost Explorer MCP server with credentials in the env block.

{
  "mcpServers": {
    "aws-cost-explorer": {
      "command": "/path/to/aws-cost-explorer-mcp-server/.venv/bin/python",
      "args": ["/path/to/aws-cost-explorer-mcp-server/server.py"],
      "env": {
        "AWS_ACCESS_KEY_ID": "AKIAIOSFODNN7EXAMPLE",
        "AWS_SECRET_ACCESS_KEY": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
        "AWS_REGION": "us-east-1",
        "MCP_TRANSPORT": "stdio",
        "BEDROCK_LOG_GROUP_NAME": "/aws/bedrock/model-invocations"
      }
    }
  }
}

Prompts to try

These prompts demonstrate the four tools exposed by the AWS Cost Explorer MCP server.

- "What was my EC2 spend yesterday?"
- "Give me a detailed breakdown of my AWS costs by service and region for the last 7 days"
- "Show me my Bedrock model usage statistics for the past 14 days"
- "Which AWS services cost me the most last month?"
- "Break down my Bedrock usage by hour for the last 3 days in us-east-1"

Troubleshooting AWS Cost Explorer

AccessDeniedException when calling Cost Explorer tools

Ensure the IAM user or role has the 'ce:GetCostAndUsage' permission policy attached. You can add the AWS-managed 'AWSBillingReadOnlyAccess' policy to grant all necessary Cost Explorer read permissions.

Bedrock usage stats return empty results

Verify that BEDROCK_LOG_GROUP_NAME matches the exact CloudWatch log group name where Bedrock logs model invocations in your account. Also ensure the IAM credentials have 'logs:GetLogEvents' and 'logs:DescribeLogStreams' permissions.

Frequently Asked Questions about AWS Cost Explorer

What is AWS Cost Explorer?

AWS Cost Explorer is a Model Context Protocol (MCP) server that command-line interface and api that allows users to analyze and visualize aws cloud spending data by enabling claude to query aws cost explorer through natural language conversations. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install AWS Cost Explorer?

Follow the installation instructions on the AWS Cost Explorer GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with AWS Cost Explorer?

AWS Cost Explorer works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is AWS Cost Explorer free to use?

Yes, AWS Cost Explorer is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Cloud Services MCP Servers

Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "aws-cost-explorer-mcp-server": { "command": "npx", "args": ["-y", "aws-cost-explorer-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use AWS Cost Explorer?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides