AWS Cost Explorer
MCP server for understanding AWS spend
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 mcp server for understanding aws spend
MCP server for understanding AWS spend
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP server for understanding AWS spend
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx aws-cost-explorerConfiguration
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 provides AI assistants with direct access to AWS spending data through four targeted tools that query the Cost Explorer API, returning daily EC2 costs, cross-service breakdowns, and Amazon Bedrock model usage statistics in a format Claude can analyze and explain in plain language. It supports both local stdio transport for Claude Desktop use and SSE transport for remote or multi-client deployments. Cloud finance teams and engineers use it to quickly surface spending anomalies, track cost trends, and understand Bedrock consumption without navigating the AWS Console.
Prerequisites
- Python 3.12+ with uv package manager installed
- AWS account with Cost Explorer enabled (note: Cost Explorer has a small monthly fee per API call)
- IAM credentials with ce:GetCostAndUsage and optionally logs:GetLogEvents permissions
- An MCP-compatible client such as Claude Desktop
- AWS credentials configured in ~/.aws/ or via environment variables
Install uv
Install the uv package manager which is required to run this project.
curl -LsSf https://astral.sh/uv/install.sh | shClone the repository and install dependencies
Clone the AWS Cost Explorer MCP server repository and install its Python dependencies with uv.
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
Set up AWS credentials with Cost Explorer access. You can use environment variables or the ~/.aws/credentials file.
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY_ID
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY
export AWS_REGION=us-east-1Add the server to Claude Desktop
Register the server in your claude_desktop_config.json, pointing to the virtualenv Python binary and server script.
{
"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"
}
}
}
}Optionally configure Bedrock log monitoring
If you want Bedrock usage stats, set the BEDROCK_LOG_GROUP_NAME to the CloudWatch log group where Bedrock logs invocations in your account.
export BEDROCK_LOG_GROUP_NAME=/aws/bedrock/model-invocationsAWS Cost Explorer Examples
Client configuration
Full claude_desktop_config.json configuration for the AWS Cost Explorer MCP server with all relevant environment variables.
{
"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
Cost analysis prompts that map directly to the four tools exposed by this server.
- "What was my EC2 spend yesterday?"
- "Show me a detailed breakdown of my AWS costs by service and region for the last 7 days"
- "Help me understand my Bedrock spend over the last two weeks"
- "Which of my AWS services had the highest cost increase compared to last week?"
- "Give me an hourly Bedrock usage report for the last 3 days"Troubleshooting AWS Cost Explorer
Cost Explorer API returns AccessDeniedException
Ensure the IAM user has 'ce:GetCostAndUsage' permissions. Attach the AWS managed policy 'AWSBillingReadOnlyAccess' to grant all required Cost Explorer read permissions. Also note that Cost Explorer must be enabled in the AWS account (Billing console > Cost Explorer).
Bedrock usage stats tools return no data
Verify BEDROCK_LOG_GROUP_NAME matches the exact CloudWatch log group name for Bedrock in your account, and that the IAM credentials have 'logs:DescribeLogStreams' and 'logs:GetLogEvents' permissions. Bedrock must also be configured to log to CloudWatch in your account settings.
Frequently Asked Questions about AWS Cost Explorer
What is AWS Cost Explorer?
AWS Cost Explorer is a Model Context Protocol (MCP) server that mcp server for understanding aws spend 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. 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.