awslabs.cost-explorer-mcp-server 0.0.6__tar.gz → 0.0.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/Dockerfile +33 -30
  2. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/PKG-INFO +5 -3
  3. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/README.md +3 -1
  4. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/docker-healthcheck.sh +7 -8
  5. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/pyproject.toml +2 -2
  6. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/uv.lock +755 -555
  7. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/.gitignore +0 -0
  8. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/.python-version +0 -0
  9. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/CHANGELOG.md +0 -0
  10. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/LICENSE +0 -0
  11. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/NOTICE +0 -0
  12. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/__init__.py +0 -0
  13. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/__init__.py +0 -0
  14. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/comparison_handler.py +0 -0
  15. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/constants.py +0 -0
  16. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/cost_usage_handler.py +0 -0
  17. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/forecasting_handler.py +0 -0
  18. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/helpers.py +0 -0
  19. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/metadata_handler.py +0 -0
  20. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/models.py +0 -0
  21. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/server.py +0 -0
  22. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/awslabs/cost_explorer_mcp_server/utility_handler.py +0 -0
  23. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/__init__.py +0 -0
  24. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/conftest.py +0 -0
  25. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_comparison_handler.py +0 -0
  26. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_cost_usage_handler.py +0 -0
  27. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_forecasting_handler.py +0 -0
  28. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_helpers.py +0 -0
  29. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_metadata_handler.py +0 -0
  30. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_models.py +0 -0
  31. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_server.py +0 -0
  32. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/tests/test_utility_handler.py +0 -0
  33. {awslabs_cost_explorer_mcp_server-0.0.6 → awslabs_cost_explorer_mcp_server-0.0.7}/uv-requirements.txt +0 -0
@@ -12,7 +12,8 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- FROM public.ecr.aws/sam/build-python3.10@sha256:d821662474d65f3cf2fc97dba2fa807a3adb580d02895fc4545527812550ea65 AS uv
15
+ # dependabot should continue to update this to the latest hash.
16
+ FROM public.ecr.aws/docker/library/python:3.13.5-alpine3.21@sha256:c9a09c45a4bcc618c7f7128585b8dd0d41d0c31a8a107db4c8255ffe0b69375d AS uv
16
17
 
17
18
  # Install the project into `/app`
18
19
  WORKDIR /app
@@ -32,54 +33,56 @@ ENV UV_FROZEN=true
32
33
  # Copy the required files first
33
34
  COPY pyproject.toml uv.lock uv-requirements.txt ./
34
35
 
36
+ # Python optimization and uv configuration
37
+ ENV PIP_NO_CACHE_DIR=1 \
38
+ PIP_DISABLE_PIP_VERSION_CHECK=1
39
+
40
+ # Install system dependencies and Python package manager
41
+ RUN apk update && \
42
+ apk add --no-cache --virtual .build-deps \
43
+ build-base \
44
+ gcc \
45
+ musl-dev \
46
+ libffi-dev \
47
+ openssl-dev \
48
+ cargo
49
+
35
50
  # Install the project's dependencies using the lockfile and settings
36
51
  RUN --mount=type=cache,target=/root/.cache/uv \
37
- pip install --require-hashes --requirement uv-requirements.txt && \
38
- uv sync --frozen --no-install-project --no-dev --no-editable
52
+ pip install --require-hashes --requirement uv-requirements.txt --no-cache-dir && \
53
+ uv sync --python 3.13 --frozen --no-install-project --no-dev --no-editable
39
54
 
40
55
  # Then, add the rest of the project source code and install it
41
56
  # Installing separately from its dependencies allows optimal layer caching
42
57
  COPY . /app
43
58
  RUN --mount=type=cache,target=/root/.cache/uv \
44
- uv sync --frozen --no-dev --no-editable
59
+ uv sync --python 3.13 --frozen --no-dev --no-editable
45
60
 
46
61
  # Make the directory just in case it doesn't exist
47
62
  RUN mkdir -p /root/.local
48
63
 
49
- FROM public.ecr.aws/sam/build-python3.10@sha256:d821662474d65f3cf2fc97dba2fa807a3adb580d02895fc4545527812550ea65
64
+ FROM public.ecr.aws/docker/library/python:3.13.5-alpine3.21@sha256:c9a09c45a4bcc618c7f7128585b8dd0d41d0c31a8a107db4c8255ffe0b69375d
50
65
 
51
66
  # Place executables in the environment at the front of the path and include other binaries
52
- ENV PATH="/app/.venv/bin:$PATH:/usr/sbin"
53
-
54
- # Set environment variables
55
- ENV PYTHONUNBUFFERED=1 \
56
- PYTHONDONTWRITEBYTECODE=1 \
57
- FASTMCP_LOG_LEVEL=INFO
58
-
59
- # Install lsof for the healthcheck
60
- # Install other tools as needed for the MCP server
61
- # Add non-root user and ability to change directory into /root
62
- RUN yum update -y && \
63
- yum install -y lsof && \
64
- yum clean all -y && \
65
- rm -rf /var/cache/yum && \
66
- groupadd --force --system app && \
67
- useradd app -g app -d /app && \
68
- chmod o+x /root
69
-
70
- # Get the project from the uv layer
71
- COPY --from=uv --chown=app:app /root/.local /root/.local
67
+ ENV PATH="/app/.venv/bin:$PATH" \
68
+ PYTHONUNBUFFERED=1
69
+
70
+ # Install runtime dependencies and create application user
71
+ RUN apk update && \
72
+ apk add --no-cache ca-certificates && \
73
+ update-ca-certificates && \
74
+ addgroup -S app && \
75
+ adduser -S app -G app -h /app
76
+
77
+ # Copy application artifacts from build stage
72
78
  COPY --from=uv --chown=app:app /app/.venv /app/.venv
73
79
 
74
80
  # Get healthcheck script
75
81
  COPY ./docker-healthcheck.sh /usr/local/bin/docker-healthcheck.sh
76
- RUN chmod +x /usr/local/bin/docker-healthcheck.sh
77
82
 
78
83
  # Run as non-root
79
84
  USER app
80
85
 
81
- # Health check
82
- HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "docker-healthcheck.sh" ]
83
-
84
- # Use entrypoint instead of CMD
86
+ # When running the container, add --db-path and a bind mount to the host's db file
87
+ HEALTHCHECK --interval=60s --timeout=10s --start-period=10s --retries=3 CMD ["docker-healthcheck.sh"]
85
88
  ENTRYPOINT ["awslabs.cost-explorer-mcp-server"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.cost-explorer-mcp-server
3
- Version: 0.0.6
3
+ Version: 0.0.7
4
4
  Summary: MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer API
5
5
  Project-URL: Homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: Documentation, https://awslabs.github.io/mcp/servers/cost-explorer-mcp-server/
@@ -23,7 +23,7 @@ Classifier: Programming Language :: Python :: 3.13
23
23
  Requires-Python: >=3.10
24
24
  Requires-Dist: boto3>=1.38.40
25
25
  Requires-Dist: loguru>=0.7.0
26
- Requires-Dist: mcp[cli]>=1.6.0
26
+ Requires-Dist: mcp[cli]>=1.11.0
27
27
  Requires-Dist: pandas>=2.2.3
28
28
  Requires-Dist: pydantic>=2.10.6
29
29
  Description-Content-Type: text/markdown
@@ -75,7 +75,9 @@ MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer
75
75
 
76
76
  ## Installation
77
77
 
78
- [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/install-mcp?name=awslabs.cost-explorer-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMuY29zdC1leHBsb3Jlci1tY3Atc2VydmVyQGxhdGVzdCIsImVudiI6eyJGQVNUTUNQX0xPR19MRVZFTCI6IkVSUk9SIiwiQVdTX1BST0ZJTEUiOiJ5b3VyLWF3cy1wcm9maWxlIn0sImRpc2FibGVkIjpmYWxzZSwiYXV0b0FwcHJvdmUiOltdfQ%3D%3D)
78
+ | Cursor | VS Code |
79
+ |:------:|:-------:|
80
+ | [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/install-mcp?name=awslabs.cost-explorer-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMuY29zdC1leHBsb3Jlci1tY3Atc2VydmVyQGxhdGVzdCIsImVudiI6eyJBV1NfUFJPRklMRSI6InlvdXItYXdzLXByb2ZpbGUiLCJBV1NfUkVHSU9OIjoidXMtZWFzdC0xIiwiRkFTVE1DUF9MT0dfTEVWRUwiOiJFUlJPUiJ9LCJkaXNhYmxlZCI6ZmFsc2UsImF1dG9BcHByb3ZlIjpbXX0%3D) | [![Install on VS Code](https://img.shields.io/badge/Install_on-VS_Code-FF9900?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=Cost%20Explorer%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.cost-explorer-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22AWS_PROFILE%22%3A%22your-aws-profile%22%2C%22AWS_REGION%22%3A%22us-east-1%22%2C%22FASTMCP_LOG_LEVEL%22%3A%22ERROR%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D) |
79
81
 
80
82
  Here are some ways you can work with MCP across AWS, and we'll be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q Developer CLI MCP, `~/.aws/amazonq/mcp.json`):
81
83
 
@@ -45,7 +45,9 @@ MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer
45
45
 
46
46
  ## Installation
47
47
 
48
- [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/install-mcp?name=awslabs.cost-explorer-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMuY29zdC1leHBsb3Jlci1tY3Atc2VydmVyQGxhdGVzdCIsImVudiI6eyJGQVNUTUNQX0xPR19MRVZFTCI6IkVSUk9SIiwiQVdTX1BST0ZJTEUiOiJ5b3VyLWF3cy1wcm9maWxlIn0sImRpc2FibGVkIjpmYWxzZSwiYXV0b0FwcHJvdmUiOltdfQ%3D%3D)
48
+ | Cursor | VS Code |
49
+ |:------:|:-------:|
50
+ | [![Install MCP Server](https://cursor.com/deeplink/mcp-install-light.svg)](https://cursor.com/install-mcp?name=awslabs.cost-explorer-mcp-server&config=eyJjb21tYW5kIjoidXZ4IGF3c2xhYnMuY29zdC1leHBsb3Jlci1tY3Atc2VydmVyQGxhdGVzdCIsImVudiI6eyJBV1NfUFJPRklMRSI6InlvdXItYXdzLXByb2ZpbGUiLCJBV1NfUkVHSU9OIjoidXMtZWFzdC0xIiwiRkFTVE1DUF9MT0dfTEVWRUwiOiJFUlJPUiJ9LCJkaXNhYmxlZCI6ZmFsc2UsImF1dG9BcHByb3ZlIjpbXX0%3D) | [![Install on VS Code](https://img.shields.io/badge/Install_on-VS_Code-FF9900?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=Cost%20Explorer%20MCP%20Server&config=%7B%22command%22%3A%22uvx%22%2C%22args%22%3A%5B%22awslabs.cost-explorer-mcp-server%40latest%22%5D%2C%22env%22%3A%7B%22AWS_PROFILE%22%3A%22your-aws-profile%22%2C%22AWS_REGION%22%3A%22us-east-1%22%2C%22FASTMCP_LOG_LEVEL%22%3A%22ERROR%22%7D%2C%22disabled%22%3Afalse%2C%22autoApprove%22%3A%5B%5D%7D) |
49
51
 
50
52
  Here are some ways you can work with MCP across AWS, and we'll be adding support to more products including Amazon Q Developer CLI soon: (e.g. for Amazon Q Developer CLI MCP, `~/.aws/amazonq/mcp.json`):
51
53
 
@@ -1,3 +1,4 @@
1
+ #!/bin/sh
1
2
  # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
3
  #
3
4
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,15 +13,13 @@
12
13
  # See the License for the specific language governing permissions and
13
14
  # limitations under the License.
14
15
 
15
- #!/bin/sh
16
+ SERVER="cost-explorer-mcp-server"
16
17
 
17
- if [ "$(lsof +c 0 -p 1 | grep -e "^awslabs\..*\s1\s.*\sunix\s.*socket$" | wc -l)" -ne "0" ]; then
18
- echo -n "$(lsof +c 0 -p 1 | grep -e "^awslabs\..*\s1\s.*\sunix\s.*socket$" | wc -l) awslabs.* streams found";
18
+ # Check if the server process is running
19
+ if pgrep -P 0 -a -l -x -f "/app/.venv/bin/python3 /app/.venv/bin/awslabs.$SERVER" > /dev/null; then
20
+ echo -n "$SERVER is running";
19
21
  exit 0;
20
- else
21
- echo -n "Zero awslabs.* streams found";
22
- exit 1;
23
22
  fi;
24
23
 
25
- echo -n "Never should reach here";
26
- exit 99;
24
+ # Unhealthy
25
+ exit 1;
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "awslabs.cost-explorer-mcp-server"
3
- version = "0.0.6"
3
+ version = "0.0.7"
4
4
  description = "MCP server for analyzing AWS costs and usage data through the AWS Cost Explorer API"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
7
7
  dependencies = [
8
8
  "boto3>=1.38.40",
9
9
  "loguru>=0.7.0",
10
- "mcp[cli]>=1.6.0",
10
+ "mcp[cli]>=1.11.0",
11
11
  "pandas>=2.2.3",
12
12
  "pydantic>=2.10.6",
13
13
  ]