awslabs.cloudwatch-appsignals-mcp-server 0.1.11__py3-none-any.whl → 0.1.12__py3-none-any.whl
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.
- awslabs/cloudwatch_appsignals_mcp_server/__init__.py +1 -1
- awslabs/cloudwatch_appsignals_mcp_server/enablement_guides/templates/ec2/ec2-python-enablement.md +1 -0
- awslabs/cloudwatch_appsignals_mcp_server/enablement_tools.py +147 -0
- {awslabs_cloudwatch_appsignals_mcp_server-0.1.11.dist-info → awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info}/METADATA +12 -2
- {awslabs_cloudwatch_appsignals_mcp_server-0.1.11.dist-info → awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info}/RECORD +9 -7
- {awslabs_cloudwatch_appsignals_mcp_server-0.1.11.dist-info → awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info}/WHEEL +0 -0
- {awslabs_cloudwatch_appsignals_mcp_server-0.1.11.dist-info → awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info}/entry_points.txt +0 -0
- {awslabs_cloudwatch_appsignals_mcp_server-0.1.11.dist-info → awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info}/licenses/LICENSE +0 -0
- {awslabs_cloudwatch_appsignals_mcp_server-0.1.11.dist-info → awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info}/licenses/NOTICE +0 -0
awslabs/cloudwatch_appsignals_mcp_server/enablement_guides/templates/ec2/ec2-python-enablement.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Placeholder content just to verify the tool can fetch the file.
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
# you may not use this file except in compliance with the License.
|
|
5
|
+
# You may obtain a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
# See the License for the specific language governing permissions and
|
|
13
|
+
# limitations under the License.
|
|
14
|
+
|
|
15
|
+
"""CloudWatch Application Signals MCP Server - Enablement Tools."""
|
|
16
|
+
|
|
17
|
+
from loguru import logger
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
async def get_enablement_guide(
|
|
22
|
+
service_platform: str,
|
|
23
|
+
service_language: str,
|
|
24
|
+
iac_directory: str,
|
|
25
|
+
app_directory: str,
|
|
26
|
+
) -> str:
|
|
27
|
+
"""Get enablement guide for AWS Application Signals.
|
|
28
|
+
|
|
29
|
+
Use this tool when the user wants to:
|
|
30
|
+
- Enable Application Signals for their AWS service
|
|
31
|
+
- Set up automatic instrumentation for their application on AWS
|
|
32
|
+
- Instrument their service running on EC2, ECS, Lambda, or EKS
|
|
33
|
+
|
|
34
|
+
This tool returns step-by-step enablement instructions that guide you through
|
|
35
|
+
modifying your infrastructure and application code to enable Application Signals,
|
|
36
|
+
which is the preferred way to enable automatic instrumentation for services on AWS.
|
|
37
|
+
|
|
38
|
+
Before calling this tool:
|
|
39
|
+
1. Ensure you know where the application code is located and that you have read/write permissions
|
|
40
|
+
2. Ensure you know where the IaC code is located and that you have read/write permissions
|
|
41
|
+
3. If the user provides relative paths or descriptions (e.g., "./infrastructure", "in the root"):
|
|
42
|
+
- Use the Bash tool to run 'pwd' to get the current working directory
|
|
43
|
+
- Use file exploration tools to locate the directories
|
|
44
|
+
- Convert relative paths to absolute paths before calling this tool
|
|
45
|
+
4. This tool REQUIRES absolute paths for both iac_directory and app_directory parameters
|
|
46
|
+
|
|
47
|
+
After calling this tool, you should:
|
|
48
|
+
1. Review the enablement guide and create a visible, trackable checklist of required changes
|
|
49
|
+
- Use your system's task tracking mechanism (todo lists, markdown checklists, etc.)
|
|
50
|
+
- Each item should be granular enough to complete in one step
|
|
51
|
+
- Mark items as complete as you finish them to track progress
|
|
52
|
+
- This allows you to resume work if the context window fills up
|
|
53
|
+
2. Work through the checklist systematically, one item at a time:
|
|
54
|
+
- Identify the specific file(s) that need modification for this step
|
|
55
|
+
- Read only the relevant file(s) (DO NOT load all IaC and app files at once)
|
|
56
|
+
- Apply the changes as specified in the guide
|
|
57
|
+
3. Keep context focused: Only load files needed for the current checklist item
|
|
58
|
+
|
|
59
|
+
Important guidelines:
|
|
60
|
+
- Use ABSOLUTE PATHS when reading and writing files
|
|
61
|
+
- Do NOT modify actual application logic files (.py, .js, .java source code), only
|
|
62
|
+
modify IaC code, Dockerfiles, and dependency files (requirements.txt, pyproject.toml,
|
|
63
|
+
package.json, pom.xml, build.gradle, *.csproj, etc.) as instructed by the guide.
|
|
64
|
+
- Read application files if needed to understand the setup, but avoid modifying them
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
service_platform: The AWS platform where the service runs.
|
|
68
|
+
MUST be one of: 'ec2', 'ecs', 'lambda', 'eks' (lowercase, exact match).
|
|
69
|
+
To help user determine: check their IaC for ECS services, Lambda functions, EKS deployments, or EC2 instances.
|
|
70
|
+
service_language: The service's programming language.
|
|
71
|
+
MUST be one of: 'python', 'nodejs', 'java', 'dotnet' (lowercase, exact match).
|
|
72
|
+
IMPORTANT: Use 'nodejs' (not 'js', 'node', or 'javascript'), 'dotnet' (not 'csharp' or 'c#').
|
|
73
|
+
To help user determine: check for package.json (nodejs), requirements.txt (python), pom.xml (java), or .csproj (dotnet).
|
|
74
|
+
iac_directory: ABSOLUTE path to the Infrastructure as Code (IaC) directory (e.g., /home/user/project/infrastructure)
|
|
75
|
+
app_directory: ABSOLUTE path to the application code directory (e.g., /home/user/project/app)
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Markdown-formatted enablement guide with step-by-step instructions
|
|
79
|
+
"""
|
|
80
|
+
logger.debug(
|
|
81
|
+
f'get_enablement_guide called: service_platform={service_platform}, service_language={service_language}, '
|
|
82
|
+
f'iac_directory={iac_directory}, app_directory={app_directory}'
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
# Normalize to lowercase
|
|
86
|
+
platform_str = service_platform.lower().strip()
|
|
87
|
+
language_str = service_language.lower().strip()
|
|
88
|
+
|
|
89
|
+
guides_dir = Path(__file__).parent / 'enablement_guides'
|
|
90
|
+
template_file = (
|
|
91
|
+
guides_dir / 'templates' / platform_str / f'{platform_str}-{language_str}-enablement.md'
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
logger.debug(f'Looking for enablement guide: {template_file}')
|
|
95
|
+
|
|
96
|
+
# Validate that paths are absolute
|
|
97
|
+
iac_path = Path(iac_directory)
|
|
98
|
+
app_path = Path(app_directory)
|
|
99
|
+
|
|
100
|
+
if not iac_path.is_absolute() or not app_path.is_absolute():
|
|
101
|
+
error_msg = (
|
|
102
|
+
f'Error: iac_directory and app_directory must be absolute paths.\n\n'
|
|
103
|
+
f'Received: {iac_directory} and {app_directory}\n'
|
|
104
|
+
f'Please provide absolute paths (e.g., /home/user/project/infrastructure)'
|
|
105
|
+
)
|
|
106
|
+
logger.error(error_msg)
|
|
107
|
+
return error_msg
|
|
108
|
+
|
|
109
|
+
if not template_file.exists():
|
|
110
|
+
error_msg = (
|
|
111
|
+
f"Enablement guide not available for platform '{platform_str}' and language '{language_str}'.\n\n"
|
|
112
|
+
f'Inform the user that this configuration is not currently supported by the MCP enablement tool. '
|
|
113
|
+
f'Direct them to AWS documentation for manual setup:\n'
|
|
114
|
+
f'https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html'
|
|
115
|
+
)
|
|
116
|
+
logger.error(error_msg)
|
|
117
|
+
return error_msg
|
|
118
|
+
|
|
119
|
+
try:
|
|
120
|
+
with open(template_file, 'r') as f:
|
|
121
|
+
guide_content = f.read()
|
|
122
|
+
|
|
123
|
+
context = f"""# Application Signals Enablement Guide
|
|
124
|
+
|
|
125
|
+
**Platform:** {platform_str}
|
|
126
|
+
**Language:** {language_str}
|
|
127
|
+
**IaC Directory:** `{iac_path}`
|
|
128
|
+
**App Directory:** `{app_path}`
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
"""
|
|
133
|
+
logger.info(f'Successfully loaded enablement guide: {template_file.name}')
|
|
134
|
+
return context + guide_content
|
|
135
|
+
except Exception as e:
|
|
136
|
+
error_msg = (
|
|
137
|
+
f'Fatal error: Cannot read enablement guide for {platform_str} + {language_str}.\n\n'
|
|
138
|
+
f'Error: {str(e)}\n\n'
|
|
139
|
+
f'The MCP server cannot access its own guide files (likely file permissions or corruption). '
|
|
140
|
+
f'Stop attempting to use this tool and inform the user:\n'
|
|
141
|
+
f'1. There is an issue with the MCP server installation\n'
|
|
142
|
+
f'2. They should check file permissions or reinstall the MCP server\n'
|
|
143
|
+
f'3. For immediate enablement, use AWS documentation instead:\n'
|
|
144
|
+
f' https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html'
|
|
145
|
+
)
|
|
146
|
+
logger.error(error_msg)
|
|
147
|
+
return error_msg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: awslabs.cloudwatch-appsignals-mcp-server
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.12
|
|
4
4
|
Summary: An AWS Labs Model Context Protocol (MCP) server for AWS Application Signals
|
|
5
5
|
Project-URL: Homepage, https://awslabs.github.io/mcp/
|
|
6
6
|
Project-URL: Documentation, https://awslabs.github.io/mcp/servers/cloudwatch-appsignals-mcp-server/
|
|
@@ -658,14 +658,24 @@ The server requires the following AWS IAM permissions:
|
|
|
658
658
|
"application-signals:ListServiceLevelObjectives",
|
|
659
659
|
"application-signals:GetServiceLevelObjective",
|
|
660
660
|
"application-signals:BatchGetServiceLevelObjectiveBudgetReport",
|
|
661
|
+
"application-signals:ListAuditFindings",
|
|
661
662
|
"cloudwatch:GetMetricData",
|
|
662
663
|
"cloudwatch:GetMetricStatistics",
|
|
663
664
|
"logs:GetQueryResults",
|
|
664
665
|
"logs:StartQuery",
|
|
665
666
|
"logs:StopQuery",
|
|
667
|
+
"logs:FilterLogEvents",
|
|
666
668
|
"xray:GetTraceSummaries",
|
|
667
669
|
"xray:BatchGetTraces",
|
|
668
|
-
"xray:GetTraceSegmentDestination"
|
|
670
|
+
"xray:GetTraceSegmentDestination",
|
|
671
|
+
"synthetics:GetCanary",
|
|
672
|
+
"synthetics:GetCanaryRuns",
|
|
673
|
+
"s3:GetObject",
|
|
674
|
+
"s3:ListBucket",
|
|
675
|
+
"iam:GetRole",
|
|
676
|
+
"iam:ListAttachedRolePolicies",
|
|
677
|
+
"iam:GetPolicy",
|
|
678
|
+
"iam:GetPolicyVersion"
|
|
669
679
|
],
|
|
670
680
|
"Resource": "*"
|
|
671
681
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
awslabs/__init__.py,sha256=WuqxdDgUZylWNmVoPKiK7qGsTB_G4UmuXIrJ-VBwDew,731
|
|
2
|
-
awslabs/cloudwatch_appsignals_mcp_server/__init__.py,sha256
|
|
2
|
+
awslabs/cloudwatch_appsignals_mcp_server/__init__.py,sha256=oy7fMXfGNGbCUq2uMovVhLkDWqcT99EvXKn0eNW3Z7Y,682
|
|
3
3
|
awslabs/cloudwatch_appsignals_mcp_server/audit_presentation_utils.py,sha256=xYJz0I-wdigYKxAaVLjyoMUh2UQpwlZM7sFxfL2pPmw,8923
|
|
4
4
|
awslabs/cloudwatch_appsignals_mcp_server/audit_utils.py,sha256=mcXxVjla0Wnh3ItuSralPFBhRWvhoWLgtvIHcAGJQog,31031
|
|
5
5
|
awslabs/cloudwatch_appsignals_mcp_server/aws_clients.py,sha256=YbUeyz_yz1n5e9EfOYYXSTZNmnkvkVF0iXrByT5aB-A,4726
|
|
6
6
|
awslabs/cloudwatch_appsignals_mcp_server/canary_utils.py,sha256=bymLDQ1kFeNIJwMRcWOLXOd2b0NyWSqmmwMrdXMxqPg,37456
|
|
7
|
+
awslabs/cloudwatch_appsignals_mcp_server/enablement_tools.py,sha256=H99Mhi2dFTAUc2tyz-EDdS3pi9R7lTbc1sR_YE_Z600,7141
|
|
7
8
|
awslabs/cloudwatch_appsignals_mcp_server/server.py,sha256=ZoYd-UgY7jFOsXLnV5gWTKDzFkmbvF2vpqEnHLgbO5Q,67903
|
|
8
9
|
awslabs/cloudwatch_appsignals_mcp_server/service_audit_utils.py,sha256=i-6emomFio4xsVsb5iRWvOzuHI7vo7WXe7VlLMD-qK8,9659
|
|
9
10
|
awslabs/cloudwatch_appsignals_mcp_server/service_tools.py,sha256=iJnkROnR0FdxEgF0LJb5zYNcD-CCSa9LVXwUqxU1_tI,29093
|
|
@@ -11,9 +12,10 @@ awslabs/cloudwatch_appsignals_mcp_server/sli_report_client.py,sha256=LGs7tDLVVa3
|
|
|
11
12
|
awslabs/cloudwatch_appsignals_mcp_server/slo_tools.py,sha256=dMLGqeZYHu2adk9uquBGIZkMZStb-puzlI0xtKhxYNI,17824
|
|
12
13
|
awslabs/cloudwatch_appsignals_mcp_server/trace_tools.py,sha256=SMIaxStaJNZOU4GaAFkUiNXrb978bPTlF7MRBRJVEP8,31785
|
|
13
14
|
awslabs/cloudwatch_appsignals_mcp_server/utils.py,sha256=nZBqiCBAUewQft26FVf4IGL4P1b152VAcG9Y7Mh0gZY,5782
|
|
14
|
-
|
|
15
|
-
awslabs_cloudwatch_appsignals_mcp_server-0.1.
|
|
16
|
-
awslabs_cloudwatch_appsignals_mcp_server-0.1.
|
|
17
|
-
awslabs_cloudwatch_appsignals_mcp_server-0.1.
|
|
18
|
-
awslabs_cloudwatch_appsignals_mcp_server-0.1.
|
|
19
|
-
awslabs_cloudwatch_appsignals_mcp_server-0.1.
|
|
15
|
+
awslabs/cloudwatch_appsignals_mcp_server/enablement_guides/templates/ec2/ec2-python-enablement.md,sha256=tE2mfcj2rw8p6HcupILG2M6l_7ok7jkO6sAjQKUEmtQ,64
|
|
16
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info/METADATA,sha256=S_gXxn1y1BLKFlvA7ego6NNuuoxZDMMyi5micfx25Kg,32176
|
|
17
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
18
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info/entry_points.txt,sha256=iGwIMLU6AsBawl2Fhqi9GoeWdMGIVtg86-McaaNQqAQ,114
|
|
19
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info/licenses/LICENSE,sha256=zE1N4JILDTkSIDtdmqdnKKxKEQh_VdqeoAV2230eNOI,10141
|
|
20
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info/licenses/NOTICE,sha256=Pfbul2Ga0IJU2RMZFHC8QwDvNk72WO2XMn9l3390VYs,108
|
|
21
|
+
awslabs_cloudwatch_appsignals_mcp_server-0.1.12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|