AWS Billing and Cost Management
AW
Docker Hub MCP

AWS Billing and Cost Management

by awslabs · Finance

0.0 · 0 reviews
17 installs · 0 tools
Not yet security audited

Billing and cost management.

AWS Billing and Cost Management MCP Server

MCP server for accessing AWS Billing and Cost Management capabilities.

Important Note: This server accesses cost and usage data from AWS Billing and Cost Management APIs. All API calls are performed using the caller's AWS credentials and follow AWS service limits and quotas.

Features

AWS Free Tier

  • Free Tier optimization: Monitor Free Tier usage and avoid unexpected charges

AWS Cost and Usage Analysis

  • Cost Explorer insights: Analyze historical and forecasted AWS costs with flexible grouping and filtering
  • Usage metrics analysis: Track resource usage trends across your AWS environment
  • Budget monitoring: Check existing budgets and their status against actual spending, plus their configured enforcement actions and alert notifications (per-budget or account-wide)
  • Cost anomaly detection: Identify unusual spending patterns and their root causes

Cost Optimization Recommendations

  • Compute Optimizer recommendations: Get right-sizing suggestions for EC2, Lambda, EBS, and more
  • Cost Optimization Hub: Access cost-saving opportunities across your AWS environment

Savings Plans and Reserved Instanaces

  • Reserved Instance planning: Analyze RI coverage and receive purchase recommendations
  • Savings Plans performance: Analyze how much eligible spend existing plans cover and how much of their commitment is consumed over a lookback window
  • Savings Plans inventory: Describe the plans an account owns with their state, term, payment option, commitment, and expiry, including the queued, returned, and payment-failed plans that Cost Explorer does not report
  • Savings Plans rates and offerings: Look up the rates locked in on plans already owned, and the offerings available to purchase with their rates, to compare terms and payment options against real numbers
  • Savings Plans recommendations: Get personalized purchase recommendations based on usage patterns, the hourly data-points behind a recommendation, and the history of when recommendations were generated
  • Savings Plans purchase analysis: Run Purchase Analyzer what-if analyses — maximum savings, a specific commitment, or a target average coverage — and retrieve the projected cost, coverage, and utilization once an analysis completes

S3 Storage Lens Analysis

  • Storage metrics querying: Run SQL queries against Storage Lens metrics data
  • Storage cost breakdown: Analyze S3 storage costs by bucket, storage class, and region
  • Storage optimization opportunities: Identify lifecycle policy opportunities and cost-saving measures

Cost and Usage Comparison

  • Month-over-month comparisons: Compare cost and usage between time periods with detailed breakdown
  • Multi-account analysis: Analyze costs across multiple linked accounts
  • Cost driver identification: Identify key factors driving cost changes

AWS Billing and Cost Management Pricing Calculator

  • Workload estimate insights: Query workload estimates to see what usage you have estimated

AWS Billing Conductor & Proforma Cost Analysis

  • Billing group management: List and filter billing groups with details on type, status, pricing plans, and member accounts
  • Account associations: View linked account associations with billing groups, filter by monitored/unmonitored status
  • Billing group cost reports: Retrieve cost report summaries comparing actual AWS charges vs proforma costs with margin analysis
  • Detailed cost breakdowns: Get billing group cost reports broken down by service name or billing period
  • Pricing rules and plans: List pricing rules (MARKUP, DISCOUNT, TIERING) and pricing plans with their associations
  • Custom line items: List custom cost allocations including support fees, shared service costs, taxes, credits, and RI/SP distribution

Cost Allocation Tags

  • Tag activation status: List cost allocation tags with filters by status (Active/Inactive), type (AWSGenerated/UserDefined), and specific tag keys
  • Backfill history: Retrieve the history of tag backfill requests that retroactively apply activation status to historical billing data

Cost Category Definitions

  • Describe cost categories: Get the full definition of a cost category including rules, split charge rules, and processing status
  • List cost categories: List all cost category definitions in the account with summary metadata and filtering by effective date or supported resource types

AWS Invoicing

  • Invoice summaries: List invoice-level details (invoice ID, type, billing period, issued/due dates, issuing entity, and amounts with discount/tax/fee breakdowns across base, tax, and payment currencies) for an account or a single invoice, filtered by month or date range
  • Invoice units: List and retrieve invoice unit definitions (groups of accounts that receive a separate invoice, with their receiver account and linked-account rules), filtered by name, receiver, or member account; and fetch invoice receiver profiles (legal name, address, tax registration number) for a set of accounts
  • Procurement portal preferences: List and retrieve procurement portal connections (SAP Business Network, Coupa) and e-invoice delivery / purchase-order retrieval settings

AWS Billing Preferences

  • Discount sharing configuration: Retrieve which member accounts participate in the Reserved Instance / Savings Plans discount pool and in credit sharing, whether newly created accounts join automatically, and whether sharing is open — the authoritative answer to "is this account excluded from commitment sharing", which cannot be inferred from RI/SP coverage data
  • Sharing history: The per-billing-period record of those settings, for reconciling a closed billing period against the sharing state that was actually in force at the time
  • Billing alerts: Whether billing alerts are enabled

AWS Enterprise Support

  • Enterprise Support charge summary: Retrieve a billing period's Enterprise Support charge with the Support-eligible spend it was calculated from, the effective pricing plan, and any applied discounts
  • Support contract details: Review the contract terms that govern how a billing period's charge is allocated, including the allocation method, Reserved Instance and Savings Plan treatment, and the payer accounts covered
  • Per-account charge breakdown: Break a billing period's charge down by linked account with prorated Support-eligible spend, subscription periods, and per-service spend

Specialized Cost Optimization Prompts

  • Graviton migration analysis: Guided analysis to identify EC2 instances suitable for AWS Graviton migration
  • Savings Plans analysis: Structured recommendations for optimal Savings Plans purchases based on usage patterns

Prerequisites

  1. Install uv from Astral or the GitHub README
  2. Install Python 3.10 or newer using uv python install 3.10 (or a more recent version)
  3. Set up AWS credentials with access to AWS services
  4. You need an AWS account with appropriate permissions
  5. Configure AWS credentials with aws configure or environment variables
  6. Ensure your IAM role/user has permissions to access AWS Billing and Cost Management APIs

Installation

⚡ Using uv

Configure the MCP server in your MCP client configuration (e.g., for Kiro, edit ~/.kiro/settings/mcp.json):

For Linux/MacOS users:

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

For Windows users:

{
  "mcpServers": {
    "awslabs.billing-cost-management-mcp-server": {
      "command": "uvx",
      "args": [
         "--from",
         "awslabs.billing-cost-management-mcp-server@latest",
         "awslabs.billing-cost-management-mcp-server.exe"
      ],
      "env": {
        "FASTMCP_LOG_LEVEL": "ERROR",
        "AWS_PROFILE": "your-aws-profile",
        "AWS_REGION": "us-east-1"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Using Docker

Or docker after a successful docker build -t awslabs/billing-cost-management-mcp-server .:

# fictitious `.env` file with AWS temporary credentials
AWS_ACCESS_KEY_ID=ASIAIOSFODNN7EXAMPLE
AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
AWS_REGION=us-east-1
{
  "mcpServers": {
    "awslabs.billing-cost-management-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "--rm",
        "--interactive",
        "--env",
        "FASTMCP_LOG_LEVEL=ERROR",
        "--env-file",
        "/full/path/to/file/above/.env",
        "awslabs/billing-cost-management-mcp-server:latest"
      ],
      "env": {},
      "disabled": false,
      "autoApprove": []
    }
  }
}

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

Storage Lens Configuration

To use the Storage Lens functionality, you'll need to set the following environment variables:

  • STORAGE_LENS_MANIFEST_LOCATION: S3 URI to your Storage Lens manifest file or folder (e.g., s3://bucket-name/storage-lens/manifests/)
  • STORAGE_LENS_OUTPUT_LOCATION (optional): S3 location for Athena query results (defaults to the same bucket as the manifest with an athena-results/ suffix)

Example configuration:

"env": {
  "AWS_PROFILE": "your-aws-profile",
  "AWS_REGION": "us-east-1",
  "STORAGE_LENS_MANIFEST_LOCATION": "s3://your-bucket/storage-lens-data/",
  "STORAGE_LENS_OUTPUT_LOCATION": "s3://your-bucket/athena-results/"
}

AWS Authentication

The MCP server requires specific AWS permissions and configuration:

Required Permissions

Your AWS IAM role or user needs permissions to access various AWS Billing and Cost Management APIs:

Cost Explorer: - ce:GetReservationPurchaseRecommendation - ce:GetReservationCoverage - ce:GetReservationUtilization - ce:GetSavingsPlansUtilization - ce:GetSavingsPlansCoverage - ce:GetSavingsPlansUtilizationDetails - ce:GetSavingsPlansPurchaseRecommendation - ce:GetSavingsPlanPurchaseRecommendationDetails - ce:StartSavingsPlansPurchaseRecommendationGeneration - ce:ListSavingsPlansPurchaseRecommendationGeneration - ce:StartCommitmentPurchaseAnalysis - ce:GetCommitmentPurchaseAnalysis - ce:ListCommitmentPurchaseAnalyses - ce:GetCostAndUsageComparisons - ce:GetCostComparisonDrivers - ce:GetAnomalies - ce:GetCostAndUsage - ce:GetCostAndUsageComparisons - ce:GetCostAndUsageWithResources - ce:GetDimensionValues - ce:GetCostForecast - ce:GetUsageForecast - ce:GetTags - ce:GetCostCategories

Savings Plans: - savingsplans:DescribeSavingsPlans - savingsplans:DescribeSavingsPlanRates - savingsplans:DescribeSavingsPlansOfferings - savingsplans:DescribeSavingsPlansOfferingRates

Cost Allocation Tags: - ce:ListCostAllocationTags - ce:ListCostAllocationTagBackfillHistory

Cost Category Definitions: - ce:DescribeCostCategoryDefinition - ce:ListCostCategoryDefinitions

Cost Optimization Hub: - cost-optimization-hub:GetRecommendation - cost-optimization-hub:ListRecommendations - cost-optimization-hub:ListRecommendationSummaries - cost-optimization-hub:ListEfficiencyMetrics

Compute Optimizer: - compute-optimizer:GetAutoScalingGroupRecommendations - compute-optimizer:GetEBSVolumeRecommendations - compute-optimizer:GetEC2InstanceRecommendations - compute-optimizer:GetECSServiceRecommendations - compute-optimizer:GetRDSDatabaseRecommendations - compute-optimizer:GetLambdaFunctionRecommendations - compute-optimizer:GetEnrollmentStatus - compute-optimizer:GetIdleRecommendations

Compute Optimizer Automation: - aco-automation:GetAutomationEvent - aco-automation:GetAutomationRule - aco-automation:GetEnrollmentConfiguration - aco-automation:ListAccounts - aco-automation:ListAutomationEvents - aco-automation:ListAutomationEventSteps - aco-automation:ListAutomationEventSummaries - aco-automation:ListAutomationRules - aco-automation:ListRecommendedActions - aco-automation:ListRecommendedActionSummaries - aco-automation:ListAutomationRulePreview - aco-automation:ListAutomationRulePreviewSummaries - aco-automation:ListTagsForResource - ec2:DescribeVolumes (required by ListRecommendedActions and ListAutomationRulePreview)

AWS Budgets: - budgets:ViewBudget (also covers budget notifications, per-budget and account-wide) - budgets:DescribeBudgetActionsForBudget (required for budget actions by budget name) - budgets:DescribeBudgetActionsForAccount (required for account-wide budget actions)

AWS Pricing: - pricing:DescribeServices - pricing:GetAttributeValues - pricing:GetProducts

AWS Free Tier: - freetier:GetFreeTierUsage

AWS Billing and Cost Management Pricing Calculator: - bcm-pricing-calculator:GetPreferences - bcm-pricing-calculator:GetWorkloadEstimate - bcm-pricing-calculator:ListWorkloadEstimateUsage - bcm-pricing-calculator:ListWorkloadEstimates

Storage Lens (Athena and S3): - athena:StartQueryExecution - athena:GetQueryExecution - athena:GetQueryResults - athena:CreateWorkGroup - athena:GetWorkGroup - athena:CreateDataCatalog - athena:GetDataCatalog - athena:GetDatabase - athena:CreateTable - athena:GetTableMetadata - athena:ListDatabases - athena:ListTableMetadata - s3:GetObject - s3:ListBucket - s3:PutObject - s3:GetBucketLocation - s3:GetStorageLensConfiguration - s3:ListStorageLensConfigurations - s3:PutStorageLensConfiguration - s3:GetStorageLensConfigurationTagging - s3:PutStorageLensConfigurationTagging

AWS Billing Conductor: - billingconductor:ListBillingGroups - billingconductor:ListBillingGroupCostReports - billingconductor:GetBillingGroupCostReport - billingconductor:ListAccountAssociations - billingconductor:ListPricingPlans - billingconductor:ListPricingRules - billingconductor:ListPricingRulesAssociatedToPricingPlan - billingconductor:ListPricingPlansAssociatedWithPricingRule - billingconductor:ListCustomLineItems - billingconductor:ListCustomLineItemVersions - billingconductor:ListResourcesAssociatedToCustomLineItem

AWS Invoicing: - invoicing:ListInvoiceSummaries - invoicing:ListInvoiceUnits - invoicing:GetInvoiceUnit - invoicing:BatchGetInvoiceProfile - invoicing:ListProcurementPortalPreferences - invoicing:GetProcurementPortalPreference

AWS Billing: - billing:GetCredits - billing:GetCreditAllocationHistory - billing:GetBillingPreferences - billing:GetEnterpriseSupportChargeSummary - billing:GetEnterpriseSupportContractDetails - billing:ListEnterpriseSupportLinkedAccountCharges

Configuration

The server uses these key environment variables:

  • AWS_PROFILE: Specifies the AWS profile to use from your AWS configuration file. If not provided, it defaults to the "default" profile.
  • AWS_REGION: Determines the AWS region for API calls. Some APIs like Cost Explorer are only available in specific regions.
"env": {
  "AWS_PROFILE": "your-aws-profile",
  "AWS_REGION": "us-east-1"
}

Supported AWS Services

The server currently supports the following AWS services

  1. Cost Explorer
  2. get_reservation_purchase_recommendation
  3. get_reservation_coverage
  4. get_reservation_utilization
  5. get_savings_plans_purchase_recommendation
  6. get_savings_plans_utilization
  7. get_savings_plans_coverage
  8. get_savings_plans_details
  9. get_cost_comparison_drivers
  10. get_cost_and_usage_comparisons
  11. get_anomalies
  12. get_cost_and_usage
  13. get_cost_and_usage_with_resources
  14. get_dimension_values
  15. get_cost_forecast
  16. get_usage_forecast
  17. get_tags
  18. get_cost_categories

  19. AWS Budgets

  20. describe_budgets
  21. describe_budget_actions (DescribeBudgetActionsForBudget / DescribeBudgetActionsForAccount)
  22. describe_budget_notifications (DescribeNotificationsForBudget / DescribeBudgetNotificationsForAccount)

  23. AWS Free Tier

  24. get_free_tier_usage

  25. AWS Pricing

  26. get_service_codes
  27. get_service_attributes
  28. get_attribute_values
  29. get_products

  30. Cost Optimization Hub

  31. get_recommendation
  32. list_recommendations
  33. list_recommendation_summaries
  34. list_efficiency_metrics

  35. Compute Optimizer

  36. get_auto_scaling_group_recommendations
  37. get_ebs_volume_recommendations
  38. get_ec2_instance_recommendations
  39. get_ecs_service_recommendations
  40. get_rds_database_recommendations
  41. get_lambda_function_recommendations
  42. get_idle_recommendations

  43. Compute Optimizer Automation

  44. get_automation_event
  45. get_automation_rule
  46. get_enrollment_configuration
  47. list_accounts
  48. list_automation_events
  49. list_automation_event_steps
  50. list_automation_event_summaries
  51. list_automation_rules
  52. list_recommended_actions
  53. list_recommended_action_summaries
  54. list_automation_rule_preview
  55. list_automation_rule_preview_summaries
  56. list_tags_for_resource

  57. Pricing Calculator

  58. get-preferences
  59. get-workload-estimate
  60. list-workload-estimate-usage
  61. list-workload-estimates

  62. S3 Storage Lens

  63. storage_lens_run_query (custom implementation using Athena)

  64. AWS Billing Conductor

  65. list_billing_groups
  66. list_billing_group_cost_reports
  67. get_billing_group_cost_report
  68. list_account_associations
  69. list_pricing_plans
  70. list_pricing_rules
  71. list_pricing_rules_associated_to_pricing_plan
  72. list_pricing_plans_associated_with_pricing_rule
  73. list_custom_line_items
  74. list_custom_line_item_versions
  75. list_resources_associated_to_custom_line_item

  76. Cost Allocation Tags

    • list_cost_allocation_tags
    • list_cost_allocation_tag_backfill_history
  77. Cost Category Definitions

    • describe_cost_category_definition
    • list_cost_category_definitions
  78. AWS Invoicing

    • invoicing tool: list_invoice_summaries
    • invoice-units tool: list_invoice_units, get_invoice_unit, batch_get_invoice_profile
    • procurement-preferences tool: list_procurement_portal_preferences, get_procurement_portal_preference
  79. AWS Credits

    • credits tool: get_credits, get_credit_allocation_history
  80. AWS Billing Preferences

    • get-billing-preferences
  81. AWS Enterprise Support
    • enterprise_support tool: get_charge_summary, get_contract_details, list_linked_account_charges

No tools listed for this server.

Security Audit

This integration has not been scanned yet. Once a security audit has been completed, the results will be displayed here.

0.0
0 reviews
5
0%
4
0%
3
0%
2
0%
1
0%

Sign in to leave a review

No reviews yet — be the first!

Connect →
0.0
★ Rating
0
Tools
17
Installs

Configuration

AWS_REGION string
AWS_REGION

us-east-1

AWS_PROFILE string
AWS_PROFILE

default

STORAGE_LENS_MANIFEST_LOCATION string
STORAGE_LENS_MANIFEST_LOCATION

s3://bucket-name/storage-lens/manifests/

Docker Image

Docker Hub
mcp/billing-cost-management-mcp-server

Docker MCP Toolkit

docker mcp catalog import https://marketplace.orcorus.com/catalog.yaml
docker mcp server enable awslabs-billing-cost-management

Or download awslabs-billing-cost-management.yaml and run docker mcp catalog add my-catalog awslabs-billing-cost-management awslabs-billing-cost-management.yaml

Published by github.com/awslabs