Registry /
aws / awslabs-cost-explorer-mcp-server
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
create_app
✓ from awscostexplorer.mcp_server.app import create_app
This is the primary entry point for the Flask application if embedding programmatically. Typical usage is to run the server directly via `flask run` or a WSGI server.
Installs the server and demonstrates how to run it locally using Flask's development server. This quickstart programmatically starts the server; alternatively, you can use `export FLASK_APP=awscostexplorer.mcp_server.app && flask run` from your shell. Requires AWS credentials and a default region to be configured in the environment or via other boto3-supported methods.
import os
from awscostexplorer.mcp_server.app import create_app
# Set dummy environment variables if not already set, for illustration.
# In a real scenario, ensure valid AWS credentials are configured (e.g., ~/.aws/credentials,
# IAM roles, or actual environment variables like AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY).
os.environ['AWS_ACCESS_KEY_ID'] = os.environ.get('AWS_ACCESS_KEY_ID', 'DUMMY_KEY')
os.environ['AWS_SECRET_ACCESS_KEY'] = os.environ.get('AWS_SECRET_ACCESS_KEY', 'DUMMY_SECRET')
os.environ['AWS_SESSION_TOKEN'] = os.environ.get('AWS_SESSION_TOKEN', '') # Optional
os.environ['AWS_REGION'] = os.environ.get('AWS_REGION', 'us-east-1') # Default region
# Create the Flask application instance
app = create_app()
if __name__ == '__main__':
# Run the Flask development server.
# For production, use a WSGI server (e.g., Gunicorn, uWSGI) instead of app.run().
print(f"\nStarting AWS Cost Explorer MCP Server (Flask dev server) on http://127.0.0.1:5000/")
print("Ensure valid AWS credentials and region are configured (e.g., via environment variables or ~/.aws/credentials).")
print("Access the UI at http://127.0.0.1:5000/ and check server logs for errors.\n")
app.run(debug=True, port=5000)
Debug
Known issues
breakingAs a `0.0.x` version, the API and internal structure of the `awslabs-cost-explorer-mcp-server` may not be stable. Backward incompatible changes could occur in minor or patch releases.fixReview release notes for each update. Pin dependencies to specific patch versions in production environments.
affects: All versions below 1.0.0
gotchaThe server relies heavily on correct AWS credentials and IAM permissions to access the Cost Explorer API and other AWS services. Incorrect or missing credentials/permissions are a very common source of errors.fixEnsure your environment has valid `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION` (or equivalent `~/.aws/credentials` setup, or IAM role for EC2/ECS). Grant necessary `ce:*` and `tag:*` permissions, and potentially `ec2:DescribeInstances` etc. as needed by the server's logic.
affects: All
gotchaThis library is primarily designed as a server application to be run directly (e.g., via `flask run`, Docker, or AWS CDK) rather than being imported and used as a traditional Python library within other applications. While programmatic embedding is possible, it's not the main use case.fixConsider running the server as a standalone service and interacting with its web interface, rather than trying to embed its internal components directly into custom Python scripts, unless explicitly developing extensions for it.
affects: All
Upgrade
Version history
0.0.21latest on PyPI · released Mar 13, 2026
Audit
Dependencies
boto3requiredRequired for AWS API interaction (Cost Explorer, EC2, etc.)
FlaskrequiredWeb framework used for the server application