AWS Cost Explorer

v1.0.0Cloud Servicesstable

MCP server for understanding AWS spend

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

Query AWS Cost Explorer data through AI assistants.
Understand cloud spending patterns and cost optimization opportunities.
aarora79

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx aws-cost-explorer

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

Install uv

Install the uv package manager which is required to run this project.

curl -LsSf https://astral.sh/uv/install.sh | sh
2

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

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

Add 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"
      }
    }
  }
}
5

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

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

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": { "command": "npx", "args": ["-y", "aws-cost-explorer"] } } }

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