Cloud Spend
MCP for AWS Cost Explorer and CloudWatch logs
What is Cloud Spend?
Cloud Spend is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp for aws cost explorer and cloudwatch logs
MCP for AWS Cost Explorer and CloudWatch logs
This server falls under the Analytics category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- MCP for AWS Cost Explorer and CloudWatch logs
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx sample-cloud-spendConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Cloud Spend
The Sample Cloud Spend MCP Server connects AI assistants to AWS Cost Explorer and CloudWatch Logs, exposing tools to query EC2 spending, get detailed cost breakdowns by region and service, and analyze Amazon Bedrock model usage statistics at daily and hourly granularity. It is designed as a reference implementation for building cost-monitoring AI workflows on AWS, letting engineers ask natural-language questions about their cloud bill and Bedrock inference costs without navigating the AWS Console. Teams building on Bedrock use it to track per-model spending and optimize LLM usage budgets.
Prerequisites
- Python 3.12+ installed
- uv package manager installed (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
- AWS credentials configured in ~/.aws/credentials with Cost Explorer and CloudWatch Logs read access
- An AWS IAM user or role with ce:GetCostAndUsage and logs:FilterLogEvents permissions
- An MCP-compatible client such as Claude Desktop
Clone the repository
Clone the AWS sample repository and navigate into the project directory.
git clone https://github.com/aws-samples/sample-cloud-spend-mcp-server
cd sample-cloud-spend-mcp-serverSet up the Python environment
Create a virtual environment with Python 3.12 and install all dependencies using uv.
uv venv --python 3.12
source .venv/bin/activate
uv pip install --requirement pyproject.tomlConfigure AWS credentials
Ensure your AWS credentials and default region are set. Create the credentials file if it does not exist.
mkdir -p ~/.aws
# Add your credentials to ~/.aws/credentials:
# [default]
# aws_access_key_id = YOUR_KEY
# aws_secret_access_key = YOUR_SECRET
# And region to ~/.aws/config:
# [default]
# region = us-east-1Set environment variables
Export the AWS profile name, region, and optionally the Bedrock CloudWatch log group name so the Bedrock usage tools know where to look.
export AWS_PROFILE=default
export AWS_REGION=us-east-1
export BEDROCK_LOG_GROUP_NAME=/aws/bedrock/model-invocations
export MCP_TRANSPORT=stdioAdd to your MCP client configuration
Register the server in Claude Desktop so it launches with the correct Python environment and AWS credentials.
Cloud Spend Examples
Client configuration
Claude Desktop configuration to launch the AWS Cloud Spend MCP server using the uv virtual environment.
{
"mcpServers": {
"cloud-spend": {
"command": "uv",
"args": ["run", "--directory", "/path/to/sample-cloud-spend-mcp-server", "python", "-m", "src.server"],
"env": {
"AWS_PROFILE": "default",
"AWS_REGION": "us-east-1",
"BEDROCK_LOG_GROUP_NAME": "/aws/bedrock/model-invocations",
"MCP_TRANSPORT": "stdio"
}
}
}
}Prompts to try
Natural-language prompts for querying AWS cost and usage data through an AI assistant.
- "What was my EC2 spend yesterday?"
- "Show me a detailed cost breakdown by service and region for the last 7 days."
- "Which AWS services cost the most in the past month?"
- "Give me daily Bedrock model usage statistics for the last two weeks."
- "Show me hourly Bedrock usage for today to identify peak inference times."
- "Help me understand my overall AWS spend trends for the last 30 days."Troubleshooting Cloud Spend
Cost Explorer API returns AccessDeniedException
Ensure the IAM user or role has the `ce:GetCostAndUsage` permission. Cost Explorer must also be enabled in your AWS account (it is not on by default for new accounts). Enable it at https://console.aws.amazon.com/cost-management/home.
Bedrock usage stats return no data
Verify that Bedrock model invocation logging is enabled in your AWS account and that BEDROCK_LOG_GROUP_NAME matches the actual CloudWatch log group name. Also confirm the IAM role has `logs:FilterLogEvents` on that log group.
uv command not found or venv activation fails
Install uv with `curl -LsSf https://astral.sh/uv/install.sh | sh` and restart your shell. On macOS, you may need to add ~/.cargo/bin or ~/.local/bin to your PATH depending on the installer version.
Frequently Asked Questions about Cloud Spend
What is Cloud Spend?
Cloud Spend is a Model Context Protocol (MCP) server that mcp for aws cost explorer and cloudwatch logs It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Cloud Spend?
Follow the installation instructions on the Cloud Spend GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Cloud Spend?
Cloud Spend works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Cloud Spend free to use?
Yes, Cloud Spend is open source and available under the MIT-0 license. You can use it freely in both personal and commercial projects.
Cloud Spend Alternatives — Similar Analytics Servers
Looking for alternatives to Cloud Spend? Here are other popular analytics servers you can use with Claude, Cursor, and VS Code.
OpenMetadata
★ 14.0kOpenMetadata is a unified metadata platform for data discovery, data observability, and data governance powered by a central metadata repository, in-depth column level lineage, and seamless team collaboration.
Superset
★ 10.9kAn MCP server that provides AI assistants with full access to Apache Superset instances, enabling interaction with dashboards, charts, datasets, databases, and SQL execution capabilities.
Horizon
★ 4.4k📡 Your own AI-powered news radar. Generates daily briefings in English & Chinese. | 用 AI 构建你专属的新闻雷达
MCP Server Chart
★ 4.1kEnables generation of 25+ types of charts and data visualizations using AntV, including bar charts, line charts, maps, mind maps, and specialized diagrams like fishbone and sankey charts. Supports both statistical charts and geographic visualizations
Muapi CLI
★ 997Official CLI for muapi.ai — generate images, videos & audio from the terminal. MCP server, 14 AI models, npm + pip installable.
Weather MCP Server
★ 907Weather Data Fetcher MCP server built with Node.js, MCP SDK, and Zod. Provides weather details like temperature and forecast for cities such as Noida and Delhi via a registered tool. Simplifies API integration, enabling structured responses for clien
Browse More Analytics MCP Servers
Explore all analytics servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Cloud Spend 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 Cloud Spend?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.