AWS Cost Explorer
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.
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
Maintainer
Works with
Installation
Manual Installation
npx aws-cost-explorer-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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"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.tomlConfigure 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-1Set 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=CostExplorerReadRoleAdd 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.
AWS Cost Explorer Alternatives — Similar Cloud Services Servers
Looking for alternatives to AWS Cost Explorer? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
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.
Set Up AWS Cost Explorer in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.