Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Superceeded by awslabs.billing-cost-management-mcp-server

⚠️ DEPRECATION NOTICE: This server is deprecated and will no longer receive updates. Please migrate to the Billing and Cost Management MCP Server, which provides broader cost analysis capabilities including Cost Explorer, Budgets, and Cost Anomaly Detection. See the migration guide for a detailed tool-by-tool mapping.

Cost Explorer MCP Server

MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer API.

Features

Analyze AWS costs and usage data

  • Get detailed breakdown of your AWS costs by service, region, and other dimensions
  • Understand how costs are distributed across various services
  • Query historical cost data for specific time periods
  • Filter costs by various dimensions, tags, and cost categories

Compare costs between time periods

  • NEW AWS Feature: Leverage AWS Cost Explorer's new Cost Comparison feature
  • Compare costs between two time periods to identify changes and trends
  • Analyze cost drivers to understand what caused cost increases or decreases
  • Get detailed insights into the top 10 most significant cost change drivers automatically
  • Identify specific usage types, discount changes, and infrastructure changes affecting costs

Forecast future costs

  • Generate cost forecasts based on historical usage patterns
  • Get predictions with confidence intervals (80% or 95%)
  • Support for daily and monthly forecast granularity
  • Plan budgets and anticipate future AWS spending

Query cost data with natural language

  • Ask questions about your AWS costs in plain English
  • Get instant answers about your AWS spending patterns
  • Retrieve historical cost data with simple queries

Prerequisites

  1. Install uv from Astral or the GitHub README
  2. Install Python using uv python install 3.10
  3. Set up AWS credentials with access to AWS Cost Explorer
    • You need an AWS account with appropriate permissions
    • Configure AWS credentials with aws configure or environment variables
    • Ensure your IAM role/user has permissions to access AWS Cost Explorer API

Installation

Kiro Cursor VS Code
Add to Kiro Install MCP Server Install on VS Code

Example configuration for Kiro (~/.kiro/settings/mcp.json):

{
  "mcpServers": {
    "awslabs.cost-explorer-mcp-server": {
      "command": "uvx",
      "args": ["awslabs.cost-explorer-mcp-server@latest"],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR",
        "AWS_PROFILE": "your-aws-profile"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Windows Installation

For Windows users, the MCP server configuration format is slightly different:

{
  "mcpServers": {
    "awslabs.cost-explorer-mcp-server": {
      "disabled": false,
      "timeout": 60,
      "type": "stdio",
      "command": "uv",
      "args": [
        "tool",
        "run",
        "--from",
        "awslabs.cost-explorer-mcp-server@latest",
        "awslabs.cost-explorer-mcp-server.exe"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR",
        "AWS_PROFILE": "your-aws-profile",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

or docker after a successful docker build -t awslabs/cost-explorer-mcp-server .:

# fictitious `.env` file with AWS temporary credentials
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_SESSION_TOKEN=
{
  "mcpServers": {
    "awslabs.cost-explorer-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "FASTMCP_LOG_LEVEL=ERROR",
        "--env-file",
        "/full/path/to/file/above/.env",
        "awslabs/cost-explorer-mcp-server:latest"
      ],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}

NOTE: Your credentials will need to be kept refreshed from your host

AWS Authentication

The MCP server uses the AWS profile specified in the AWS_PROFILE environment variable. If not provided, it defaults to the "default" profile in your AWS configuration file.

"env": {
  "AWS_PROFILE": "your-aws-profile"
}

Make sure the AWS profile has permissions to access the AWS Cost Explorer API. The MCP server creates a boto3 session using the specified profile to authenticate with AWS services. Your AWS IAM credentials remain on your local machine and are strictly used for accessing AWS services.

Cost Considerations

Important: AWS Cost Explorer API incurs charges on a per-request basis. Each API call made by this MCP server will result in charges to your AWS account.

  • Cost Explorer API Pricing: The AWS Cost Explorer API lets you directly access the interactive, ad-hoc query engine that powers AWS Cost Explorer. Each request will incur a cost of $0.01.
  • Each tool invocation that queries Cost Explorer (get_dimension_values, get_tag_values, get_cost_and_usage) will generate at least one billable API request
  • Complex queries with multiple filters or large date ranges may result in multiple API calls

For current pricing information, please refer to the AWS Cost Explorer Pricing page.

Security Considerations

Required IAM Permissions

The following IAM permissions are required for this MCP server:

  • ce:GetCostAndUsage
  • ce:GetDimensionValues
  • ce:GetTags
  • ce:GetCostForecast
  • ce:GetCostAndUsageComparisons
  • ce:GetCostComparisonDrivers

Available Tools

The Cost Explorer MCP Server provides the following tools:

  1. get_today_date - Get the current date and month to determine relevent data when answering last month.
  2. get_dimension_values - Get available values for a specific dimension (e.g., SERVICE, REGION)
  3. get_tag_values - Get available values for a specific tag key
  4. get_cost_and_usage - Retrieve AWS cost and usage data with filtering and grouping options
  5. get_cost_and_usage_comparisons - Compare costs between two time periods to identify changes and trends
  6. get_cost_comparison_drivers - Analyze what drove cost changes between periods (top 10 most significant drivers)
  7. get_cost_forecast - Generate cost forecasts based on historical usage patterns

Example Usage

Here are some examples of how to use the Cost Explorer MCP Server through natural language queries:

Cost Analysis Examples

Show me my AWS costs for the last 3 months grouped by service in us-east-1 region
Break down my S3 costs by storage class for Q1 2025
Show me costs for production resources tagged with Environment=prod
What were my costs for reserved instances vs on-demand in May?
What was my EC2 instance usage by instance type?

Cost Comparison Examples

Compare my AWS costs between April and May 2025
How did my EC2 costs change from last month to this month?
Why did my AWS bill increase in June compared to May?
What caused the spike in my S3 costs last month?

Forecasting Examples

Forecast my AWS costs for next month
Predict my EC2 spending for the next quarter
What will my total AWS bill be for the rest of 2025?

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Release files for awslabs.cost-explorer-mcp-server 0.0.21

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awslabs.cost-explorer-mcp-server 0.0.21
File Size Uploaded
awslabs_cost_explorer_mcp_server-0.0.21.tar.gz 138.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for awslabs.cost-explorer-mcp-server 0.0.21
File Interpreter ABI Platform
awslabs_cost_explorer_mcp_server-0.0.21-py3-none-any.whl Python 3 none any Details

Total release size: 177.4 kB

Release files / awslabs_cost_explorer_mcp_server-0.0.21.tar.gz

Download URL awslabs_cost_explorer_mcp_server-0.0.21.tar.gz
Size 138.3 kB
Tags Source
SHA-256 checksum
How to use checksums
de9005b7d19edd10207df5d0684c64402fd6c7c7e19e216547bd30bc0042f841
BLAKE2b-256 checksum
How to use checksums
46f4dcf9e8db67d55aa857681253edb7cc63b7a23bb1d2bd93ced15fa9ea85bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release files / awslabs_cost_explorer_mcp_server-0.0.21-py3-none-any.whl

Download URL awslabs_cost_explorer_mcp_server-0.0.21-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8c0ee8c738db7e67f0021b2408a09cfc6b967c9514743a15873d715ef11e437
BLAKE2b-256 checksum
How to use checksums
139e142e8fd54e16d37adf554c602cf79536766147d680c59b732e1b94425efb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.21 This release

2 release files

0.0.17

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page