AWS Cost Explorer MCP Server

Integrate AWS Cost Explorer with FlowHunt and AI agents to interactively analyze and visualize cloud spending using natural language.

AWS Cost Explorer MCP Server

What does “AWS Cost Explorer” MCP Server do?

The AWS Cost Explorer MCP Server acts as a middleware tool that connects AI assistants, like Anthropic’s Claude, with AWS Cost Explorer and Amazon Bedrock Model Invocation Logs. This server enables developers and AI agents to query and analyze cloud spending data from AWS in natural language, facilitating tasks such as EC2 spend analysis, service spend reports, and granular cost breakdowns. By exposing AWS Cost Explorer API functionality via the Model Context Protocol (MCP), it provides an interactive interface for querying and visualizing AWS costs, which can greatly enhance cloud cost management and reporting workflows. This server can be run locally or remotely, and can aggregate spend data from multiple AWS accounts, provided the correct IAM roles are in place.

List of Prompts

  • No explicit prompt templates are listed in the repository or documentation.

List of Resources

  • No explicit MCP resources are listed in the repository or documentation.

List of Tools

  • No explicit tools or tool names are listed in server.py or README.md regarding MCP tool registration or exposure.

Use Cases of this MCP Server

  • EC2 Spend Analysis: Enables developers to get detailed breakdowns of EC2 spending for the previous day, helping identify cost drivers and optimize infrastructure.
  • Amazon Bedrock Spend Analysis: Provides insights into Bedrock usage and costs, broken down by region, user, and model, useful for tracking AI/ML workload expenses.
  • Service Spend Reports: Allows querying of overall AWS service spending over the last 30 days, aiding in comprehensive cloud cost monitoring.
  • Detailed Cost Breakdown: Supports granular analysis of AWS costs by day, region, service, and instance type, empowering precise budget tracking and anomaly detection.
  • Cross-account Spend Aggregation: If the IAM role allows, the server can aggregate and report spend from multiple AWS accounts, streamlining multi-account cost management.

How to set it up

Windsurf

  1. Ensure Python 3.12, AWS credentials, and Anthropic API access are set up.
  2. Locate your Windsurf configuration file.
  3. Add the AWS Cost Explorer MCP Server under the mcpServers object:
    {
      "mcpServers": {
        "aws-cost-explorer": {
          "command": "python3",
          "args": ["app.py"]
        }
      }
    }
    
  4. Save the config and restart Windsurf.
  5. Verify that the server is running and accessible.

Securing API Keys Example:

{
  "mcpServers": {
    "aws-cost-explorer": {
      "command": "python3",
      "args": ["app.py"],
      "env": {
        "AWS_ACCESS_KEY_ID": "your-access-key",
        "AWS_SECRET_ACCESS_KEY": "your-secret-key"
      }
    }
  }
}

Claude

  1. Install Python 3.12 and set up AWS credentials.
  2. Edit Claude’s MCP configuration file.
  3. Add the server as follows:
    {
      "mcpServers": {
        "aws-cost-explorer": {
          "command": "python3",
          "args": ["app.py"]
        }
      }
    }
    
  4. Restart Claude Desktop.
  5. Confirm integration via the Claude interface.

Cursor

  1. Set up Python 3.12 and your AWS credentials.
  2. Open Cursor’s configuration file.
  3. Insert the following in the mcpServers section:
    {
      "mcpServers": {
        "aws-cost-explorer": {
          "command": "python3",
          "args": ["app.py"]
        }
      }
    }
    
  4. Save changes and restart Cursor.
  5. Test the connection by running a sample query.

Cline

  1. Prepare Python 3.12 and required AWS credentials.
  2. Edit the Cline configuration file.
  3. Add the server configuration:
    {
      "mcpServers": {
        "aws-cost-explorer": {
          "command": "python3",
          "args": ["app.py"]
        }
      }
    }
    
  4. Restart Cline.
  5. Ensure the server is operational and responding.

Note: Use environment variables to secure API keys, as shown in the Windsurf example above.

How to use this MCP inside flows

Using MCP in FlowHunt

To integrate MCP servers into your FlowHunt workflow, start by adding the MCP component to your flow and connecting it to your AI agent:

FlowHunt MCP flow

Click on the MCP component to open the configuration panel. In the system MCP configuration section, insert your MCP server details using this JSON format:

{
  "aws-cost-explorer": {
    "transport": "streamable_http",
    "url": "https://yourmcpserver.example/pathtothemcp/url"
  }
}

Once configured, the AI agent is now able to use this MCP as a tool with access to all its functions and capabilities. Remember to change “aws-cost-explorer” to whatever the actual name of your MCP server is and replace the URL with your own MCP server URL.


Overview

SectionAvailabilityDetails/Notes
Overview
List of PromptsNo prompt templates in repo/docs
List of ResourcesNo explicit resources listed
List of ToolsNo explicit tools listed
Securing API KeysExample provided in setup section
Sampling Support (less important in evaluation)Not mentioned

Our opinion

This MCP server provides a useful interface for AWS cost analytics through Claude and related tools, but lacks explicit MCP prompt, resource, and tool definitions in its documentation. Its setup is straightforward, and it covers a practical cost analysis use case, but some advanced MCP features appear unsupported or undocumented.

MCP Score

Has a LICENSE✅ (MIT)
Has at least one tool
Number of Forks26
Number of Stars112

Frequently asked questions

What does the AWS Cost Explorer MCP Server do?

It connects AI assistants and agents to AWS Cost Explorer and Bedrock logs, allowing natural language queries and visualizations of AWS spending for better cloud cost management.

What are common use cases for this MCP server?

Typical uses include EC2 spend analysis, Amazon Bedrock spend breakdowns, overall AWS service cost reports, granular cost tracking by region/service/type, and multi-account cost aggregation.

Is it possible to aggregate costs across several AWS accounts?

Yes, as long as the necessary IAM role permissions are in place, the server can aggregate and report spend from multiple AWS accounts.

How do I secure my AWS API keys when setting up?

You should use environment variables to store sensitive AWS credentials. See the setup instructions for examples.

Are there prompt templates or tools included in this MCP server?

No explicit prompt templates, tools, or MCP resources are provided or documented in the server repository.

What are the prerequisites for running the AWS Cost Explorer MCP Server?

Python 3.12, AWS credentials (access key and secret), and (optionally) Anthropic API access if integrating with Claude.

Try the AWS Cost Explorer MCP Server

Easily analyze, visualize, and optimize your AWS cloud costs by integrating the AWS Cost Explorer MCP Server into your FlowHunt workflows or AI agents.

Learn more