Cloud Spend

v1.0.0Analyticsstable

MCP for AWS Cost Explorer and CloudWatch logs

bedrockclaude-desktopcloudwatchcloudwatch-logscost-explorer
Share:
13
Stars
0
Downloads
0
Weekly
0/5

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

Monitor AWS costs with CloudWatch integration for cost optimization.
Analyze cloud spending patterns through AI-powered dashboards.
aws-samples

Maintainer

LicenseMIT-0
Languagepython
Versionv1.0.0
UpdatedFeb 20, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx sample-cloud-spend

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 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
1

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-server
2

Set 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.toml
3

Configure 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-1
4

Set 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=stdio
5

Add 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.

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.

Quick Config Preview

{ "mcpServers": { "sample-cloud-spend": { "command": "npx", "args": ["-y", "sample-cloud-spend"] } } }

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

Read the full setup guide →

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.

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